htt.h 837 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221
  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. */
  226. #define HTT_CURRENT_VERSION_MAJOR 3
  227. #define HTT_CURRENT_VERSION_MINOR 104
  228. #define HTT_NUM_TX_FRAG_DESC 1024
  229. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  230. #define HTT_CHECK_SET_VAL(field, val) \
  231. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  232. /* macros to assist in sign-extending fields from HTT messages */
  233. #define HTT_SIGN_BIT_MASK(field) \
  234. ((field ## _M + (1 << field ## _S)) >> 1)
  235. #define HTT_SIGN_BIT(_val, field) \
  236. (_val & HTT_SIGN_BIT_MASK(field))
  237. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  238. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  239. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  240. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  241. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  242. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  243. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  244. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  245. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  246. /*
  247. * TEMPORARY:
  248. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  249. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  250. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  251. * updated.
  252. */
  253. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  254. /*
  255. * TEMPORARY:
  256. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  257. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  258. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  259. * updated.
  260. */
  261. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  262. /**
  263. * htt_dbg_stats_type -
  264. * bit positions for each stats type within a stats type bitmask
  265. * The bitmask contains 24 bits.
  266. */
  267. enum htt_dbg_stats_type {
  268. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  269. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  270. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  271. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  272. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  273. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  274. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  275. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  276. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  277. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  278. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  279. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  280. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  281. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  282. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  283. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  284. /* bits 16-23 currently reserved */
  285. /* keep this last */
  286. HTT_DBG_NUM_STATS
  287. };
  288. /*=== HTT option selection TLVs ===
  289. * Certain HTT messages have alternatives or options.
  290. * For such cases, the host and target need to agree on which option to use.
  291. * Option specification TLVs can be appended to the VERSION_REQ and
  292. * VERSION_CONF messages to select options other than the default.
  293. * These TLVs are entirely optional - if they are not provided, there is a
  294. * well-defined default for each option. If they are provided, they can be
  295. * provided in any order. Each TLV can be present or absent independent of
  296. * the presence / absence of other TLVs.
  297. *
  298. * The HTT option selection TLVs use the following format:
  299. * |31 16|15 8|7 0|
  300. * |---------------------------------+----------------+----------------|
  301. * | value (payload) | length | tag |
  302. * |-------------------------------------------------------------------|
  303. * The value portion need not be only 2 bytes; it can be extended by any
  304. * integer number of 4-byte units. The total length of the TLV, including
  305. * the tag and length fields, must be a multiple of 4 bytes. The length
  306. * field specifies the total TLV size in 4-byte units. Thus, the typical
  307. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  308. * field, would store 0x1 in its length field, to show that the TLV occupies
  309. * a single 4-byte unit.
  310. */
  311. /*--- TLV header format - applies to all HTT option TLVs ---*/
  312. enum HTT_OPTION_TLV_TAGS {
  313. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  314. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  315. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  316. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  317. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  318. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  319. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  320. };
  321. PREPACK struct htt_option_tlv_header_t {
  322. A_UINT8 tag;
  323. A_UINT8 length;
  324. } POSTPACK;
  325. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  326. #define HTT_OPTION_TLV_TAG_S 0
  327. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  328. #define HTT_OPTION_TLV_LENGTH_S 8
  329. /*
  330. * value0 - 16 bit value field stored in word0
  331. * The TLV's value field may be longer than 2 bytes, in which case
  332. * the remainder of the value is stored in word1, word2, etc.
  333. */
  334. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  335. #define HTT_OPTION_TLV_VALUE0_S 16
  336. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  337. do { \
  338. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  339. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  340. } while (0)
  341. #define HTT_OPTION_TLV_TAG_GET(word) \
  342. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  343. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  344. do { \
  345. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  346. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  347. } while (0)
  348. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  349. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  350. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  351. do { \
  352. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  353. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  354. } while (0)
  355. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  356. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  357. /*--- format of specific HTT option TLVs ---*/
  358. /*
  359. * HTT option TLV for specifying LL bus address size
  360. * Some chips require bus addresses used by the target to access buffers
  361. * within the host's memory to be 32 bits; others require bus addresses
  362. * used by the target to access buffers within the host's memory to be
  363. * 64 bits.
  364. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  365. * a suffix to the VERSION_CONF message to specify which bus address format
  366. * the target requires.
  367. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  368. * default to providing bus addresses to the target in 32-bit format.
  369. */
  370. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  371. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  372. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  373. };
  374. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  375. struct htt_option_tlv_header_t hdr;
  376. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  377. } POSTPACK;
  378. /*
  379. * HTT option TLV for specifying whether HL systems should indicate
  380. * over-the-air tx completion for individual frames, or should instead
  381. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  382. * requests an OTA tx completion for a particular tx frame.
  383. * This option does not apply to LL systems, where the TX_COMPL_IND
  384. * is mandatory.
  385. * This option is primarily intended for HL systems in which the tx frame
  386. * downloads over the host --> target bus are as slow as or slower than
  387. * the transmissions over the WLAN PHY. For cases where the bus is faster
  388. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  389. * and consquently will send one TX_COMPL_IND message that covers several
  390. * tx frames. For cases where the WLAN PHY is faster than the bus,
  391. * the target will end up transmitting very short A-MPDUs, and consequently
  392. * sending many TX_COMPL_IND messages, which each cover a very small number
  393. * of tx frames.
  394. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  395. * a suffix to the VERSION_REQ message to request whether the host desires to
  396. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  397. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  398. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  399. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  400. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  401. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  402. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  403. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  404. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  405. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  406. * TLV.
  407. */
  408. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  409. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  410. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  411. };
  412. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  413. struct htt_option_tlv_header_t hdr;
  414. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  415. } POSTPACK;
  416. /*
  417. * HTT option TLV for specifying how many tx queue groups the target
  418. * may establish.
  419. * This TLV specifies the maximum value the target may send in the
  420. * txq_group_id field of any TXQ_GROUP information elements sent by
  421. * the target to the host. This allows the host to pre-allocate an
  422. * appropriate number of tx queue group structs.
  423. *
  424. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  425. * a suffix to the VERSION_REQ message to specify whether the host supports
  426. * tx queue groups at all, and if so if there is any limit on the number of
  427. * tx queue groups that the host supports.
  428. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  429. * a suffix to the VERSION_CONF message. If the host has specified in the
  430. * VER_REQ message a limit on the number of tx queue groups the host can
  431. * supprt, the target shall limit its specification of the maximum tx groups
  432. * to be no larger than this host-specified limit.
  433. *
  434. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  435. * shall preallocate 4 tx queue group structs, and the target shall not
  436. * specify a txq_group_id larger than 3.
  437. */
  438. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  439. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  440. /*
  441. * values 1 through N specify the max number of tx queue groups
  442. * the sender supports
  443. */
  444. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  445. };
  446. /* TEMPORARY backwards-compatibility alias for a typo fix -
  447. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  448. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  449. * to support the old name (with the typo) until all references to the
  450. * old name are replaced with the new name.
  451. */
  452. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  453. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  454. struct htt_option_tlv_header_t hdr;
  455. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  456. } POSTPACK;
  457. /*
  458. * HTT option TLV for specifying whether the target supports an extended
  459. * version of the HTT tx descriptor. If the target provides this TLV
  460. * and specifies in the TLV that the target supports an extended version
  461. * of the HTT tx descriptor, the target must check the "extension" bit in
  462. * the HTT tx descriptor, and if the extension bit is set, to expect a
  463. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  464. * descriptor. Furthermore, the target must provide room for the HTT
  465. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  466. * This option is intended for systems where the host needs to explicitly
  467. * control the transmission parameters such as tx power for individual
  468. * tx frames.
  469. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  470. * as a suffix to the VERSION_CONF message to explicitly specify whether
  471. * the target supports the HTT tx MSDU extension descriptor.
  472. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  473. * by the host as lack of target support for the HTT tx MSDU extension
  474. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  475. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  476. * the HTT tx MSDU extension descriptor.
  477. * The host is not required to provide the HTT tx MSDU extension descriptor
  478. * just because the target supports it; the target must check the
  479. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  480. * extension descriptor is present.
  481. */
  482. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  483. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  484. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  485. };
  486. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  487. struct htt_option_tlv_header_t hdr;
  488. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  489. } POSTPACK;
  490. /*
  491. * For the tcl data command V2 and higher support added a new
  492. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  493. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  494. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  495. * HTT option TLV for specifying which version of the TCL metadata struct
  496. * should be used:
  497. * V1 -> use htt_tx_tcl_metadata struct
  498. * V2 -> use htt_tx_tcl_metadata_v2 struct
  499. * Old FW will only support V1.
  500. * New FW will support V2. New FW will still support V1, at least during
  501. * a transition period.
  502. * Similarly, old host will only support V1, and new host will support V1 + V2.
  503. *
  504. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  505. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  506. * of TCL metadata the host supports. If the host doesn't provide a
  507. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  508. * is implicitly understood that the host only supports V1.
  509. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  510. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  511. * the host shall use. The target shall only select one of the versions
  512. * supported by the host. If the target doesn't provide a
  513. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  514. * is implicitly understood that the V1 TCL metadata shall be used.
  515. */
  516. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  517. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  518. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  519. };
  520. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  521. struct htt_option_tlv_header_t hdr;
  522. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  523. } POSTPACK;
  524. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  525. HTT_OPTION_TLV_VALUE0_SET(word, value)
  526. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  527. HTT_OPTION_TLV_VALUE0_GET(word)
  528. typedef struct {
  529. union {
  530. /* BIT [11 : 0] :- tag
  531. * BIT [23 : 12] :- length
  532. * BIT [31 : 24] :- reserved
  533. */
  534. A_UINT32 tag__length;
  535. /*
  536. * The following struct is not endian-portable.
  537. * It is suitable for use within the target, which is known to be
  538. * little-endian.
  539. * The host should use the above endian-portable macros to access
  540. * the tag and length bitfields in an endian-neutral manner.
  541. */
  542. struct {
  543. A_UINT32 tag : 12, /* BIT [11 : 0] */
  544. length : 12, /* BIT [23 : 12] */
  545. reserved : 8; /* BIT [31 : 24] */
  546. };
  547. };
  548. } htt_tlv_hdr_t;
  549. /** HTT stats TLV tag values */
  550. typedef enum {
  551. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  552. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  553. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  554. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  555. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  556. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  557. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  558. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  559. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  560. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  561. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  562. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  563. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  564. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  565. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  566. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  567. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  568. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  569. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  570. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  571. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  572. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  573. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  574. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  575. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  576. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  577. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  578. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  579. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  580. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  581. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  582. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  583. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  584. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  585. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  586. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  587. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  588. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  589. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  590. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  591. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  592. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  593. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  594. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  595. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  596. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  597. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  598. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  599. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  600. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  601. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  602. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  603. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  604. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  605. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  606. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  607. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  608. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  609. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  610. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  611. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  612. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  613. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  614. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  615. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  616. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  617. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  618. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  619. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  620. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  621. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  622. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  623. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  624. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  625. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  626. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  627. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  628. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  629. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  630. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  631. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  632. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  633. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  634. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  635. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  636. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  637. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  638. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  639. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  640. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  641. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  642. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  643. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  644. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  645. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  646. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  647. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  648. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  649. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  650. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  651. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  652. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  653. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  654. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  655. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  656. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  657. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  658. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  659. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  660. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  661. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  662. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  663. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  664. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv */
  665. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv */
  666. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv */
  667. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv */
  668. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  669. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  670. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  671. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  672. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  673. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  674. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  675. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  676. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  677. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  678. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  679. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  680. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  681. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  682. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  683. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  684. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  685. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  686. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  687. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  688. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  689. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  690. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  691. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  692. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  693. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  694. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  695. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  696. HTT_STATS_MAX_TAG,
  697. } htt_stats_tlv_tag_t;
  698. /* retain deprecated enum name as an alias for the current enum name */
  699. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  700. #define HTT_STATS_TLV_TAG_M 0x00000fff
  701. #define HTT_STATS_TLV_TAG_S 0
  702. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  703. #define HTT_STATS_TLV_LENGTH_S 12
  704. #define HTT_STATS_TLV_TAG_GET(_var) \
  705. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  706. HTT_STATS_TLV_TAG_S)
  707. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  708. do { \
  709. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  710. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  711. } while (0)
  712. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  713. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  714. HTT_STATS_TLV_LENGTH_S)
  715. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  716. do { \
  717. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  718. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  719. } while (0)
  720. /*=== host -> target messages ===============================================*/
  721. enum htt_h2t_msg_type {
  722. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  723. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  724. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  725. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  726. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  727. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  728. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  729. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  730. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  731. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  732. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  733. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  734. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  735. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  736. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  737. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  738. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  739. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  740. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  741. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  742. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  743. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  744. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  745. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  746. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  747. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  748. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  749. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  750. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  751. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  752. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  753. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  754. /* keep this last */
  755. HTT_H2T_NUM_MSGS
  756. };
  757. /*
  758. * HTT host to target message type -
  759. * stored in bits 7:0 of the first word of the message
  760. */
  761. #define HTT_H2T_MSG_TYPE_M 0xff
  762. #define HTT_H2T_MSG_TYPE_S 0
  763. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  764. do { \
  765. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  766. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  767. } while (0)
  768. #define HTT_H2T_MSG_TYPE_GET(word) \
  769. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  770. /**
  771. * @brief host -> target version number request message definition
  772. *
  773. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  774. *
  775. *
  776. * |31 24|23 16|15 8|7 0|
  777. * |----------------+----------------+----------------+----------------|
  778. * | reserved | msg type |
  779. * |-------------------------------------------------------------------|
  780. * : option request TLV (optional) |
  781. * :...................................................................:
  782. *
  783. * The VER_REQ message may consist of a single 4-byte word, or may be
  784. * extended with TLVs that specify which HTT options the host is requesting
  785. * from the target.
  786. * The following option TLVs may be appended to the VER_REQ message:
  787. * - HL_SUPPRESS_TX_COMPL_IND
  788. * - HL_MAX_TX_QUEUE_GROUPS
  789. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  790. * may be appended to the VER_REQ message (but only one TLV of each type).
  791. *
  792. * Header fields:
  793. * - MSG_TYPE
  794. * Bits 7:0
  795. * Purpose: identifies this as a version number request message
  796. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  797. */
  798. #define HTT_VER_REQ_BYTES 4
  799. /* TBDXXX: figure out a reasonable number */
  800. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  801. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  802. /**
  803. * @brief HTT tx MSDU descriptor
  804. *
  805. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  806. *
  807. * @details
  808. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  809. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  810. * the target firmware needs for the FW's tx processing, particularly
  811. * for creating the HW msdu descriptor.
  812. * The same HTT tx descriptor is used for HL and LL systems, though
  813. * a few fields within the tx descriptor are used only by LL or
  814. * only by HL.
  815. * The HTT tx descriptor is defined in two manners: by a struct with
  816. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  817. * definitions.
  818. * The target should use the struct def, for simplicitly and clarity,
  819. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  820. * neutral. Specifically, the host shall use the get/set macros built
  821. * around the mask + shift defs.
  822. */
  823. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  824. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  825. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  826. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  827. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  828. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  829. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  830. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  831. #define HTT_TX_VDEV_ID_WORD 0
  832. #define HTT_TX_VDEV_ID_MASK 0x3f
  833. #define HTT_TX_VDEV_ID_SHIFT 16
  834. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  835. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  836. #define HTT_TX_MSDU_LEN_DWORD 1
  837. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  838. /*
  839. * HTT_VAR_PADDR macros
  840. * Allow physical / bus addresses to be either a single 32-bit value,
  841. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  842. */
  843. #define HTT_VAR_PADDR32(var_name) \
  844. A_UINT32 var_name
  845. #define HTT_VAR_PADDR64_LE(var_name) \
  846. struct { \
  847. /* little-endian: lo precedes hi */ \
  848. A_UINT32 lo; \
  849. A_UINT32 hi; \
  850. } var_name
  851. /*
  852. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  853. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  854. * addresses are stored in a XXX-bit field.
  855. * This macro is used to define both htt_tx_msdu_desc32_t and
  856. * htt_tx_msdu_desc64_t structs.
  857. */
  858. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  859. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  860. { \
  861. /* DWORD 0: flags and meta-data */ \
  862. A_UINT32 \
  863. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  864. \
  865. /* pkt_subtype - \
  866. * Detailed specification of the tx frame contents, extending the \
  867. * general specification provided by pkt_type. \
  868. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  869. * pkt_type | pkt_subtype \
  870. * ============================================================== \
  871. * 802.3 | bit 0:3 - Reserved \
  872. * | bit 4: 0x0 - Copy-Engine Classification Results \
  873. * | not appended to the HTT message \
  874. * | 0x1 - Copy-Engine Classification Results \
  875. * | appended to the HTT message in the \
  876. * | format: \
  877. * | [HTT tx desc, frame header, \
  878. * | CE classification results] \
  879. * | The CE classification results begin \
  880. * | at the next 4-byte boundary after \
  881. * | the frame header. \
  882. * ------------+------------------------------------------------- \
  883. * Eth2 | bit 0:3 - Reserved \
  884. * | bit 4: 0x0 - Copy-Engine Classification Results \
  885. * | not appended to the HTT message \
  886. * | 0x1 - Copy-Engine Classification Results \
  887. * | appended to the HTT message. \
  888. * | See the above specification of the \
  889. * | CE classification results location. \
  890. * ------------+------------------------------------------------- \
  891. * native WiFi | bit 0:3 - Reserved \
  892. * | bit 4: 0x0 - Copy-Engine Classification Results \
  893. * | not appended to the HTT message \
  894. * | 0x1 - Copy-Engine Classification Results \
  895. * | appended to the HTT message. \
  896. * | See the above specification of the \
  897. * | CE classification results location. \
  898. * ------------+------------------------------------------------- \
  899. * mgmt | 0x0 - 802.11 MAC header absent \
  900. * | 0x1 - 802.11 MAC header present \
  901. * ------------+------------------------------------------------- \
  902. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  903. * | 0x1 - 802.11 MAC header present \
  904. * | bit 1: 0x0 - allow aggregation \
  905. * | 0x1 - don't allow aggregation \
  906. * | bit 2: 0x0 - perform encryption \
  907. * | 0x1 - don't perform encryption \
  908. * | bit 3: 0x0 - perform tx classification / queuing \
  909. * | 0x1 - don't perform tx classification; \
  910. * | insert the frame into the "misc" \
  911. * | tx queue \
  912. * | bit 4: 0x0 - Copy-Engine Classification Results \
  913. * | not appended to the HTT message \
  914. * | 0x1 - Copy-Engine Classification Results \
  915. * | appended to the HTT message. \
  916. * | See the above specification of the \
  917. * | CE classification results location. \
  918. */ \
  919. pkt_subtype: 5, \
  920. \
  921. /* pkt_type - \
  922. * General specification of the tx frame contents. \
  923. * The htt_pkt_type enum should be used to specify and check the \
  924. * value of this field. \
  925. */ \
  926. pkt_type: 3, \
  927. \
  928. /* vdev_id - \
  929. * ID for the vdev that is sending this tx frame. \
  930. * For certain non-standard packet types, e.g. pkt_type == raw \
  931. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  932. * This field is used primarily for determining where to queue \
  933. * broadcast and multicast frames. \
  934. */ \
  935. vdev_id: 6, \
  936. /* ext_tid - \
  937. * The extended traffic ID. \
  938. * If the TID is unknown, the extended TID is set to \
  939. * HTT_TX_EXT_TID_INVALID. \
  940. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  941. * value of the QoS TID. \
  942. * If the tx frame is non-QoS data, then the extended TID is set to \
  943. * HTT_TX_EXT_TID_NON_QOS. \
  944. * If the tx frame is multicast or broadcast, then the extended TID \
  945. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  946. */ \
  947. ext_tid: 5, \
  948. \
  949. /* postponed - \
  950. * This flag indicates whether the tx frame has been downloaded to \
  951. * the target before but discarded by the target, and now is being \
  952. * downloaded again; or if this is a new frame that is being \
  953. * downloaded for the first time. \
  954. * This flag allows the target to determine the correct order for \
  955. * transmitting new vs. old frames. \
  956. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  957. * This flag only applies to HL systems, since in LL systems, \
  958. * the tx flow control is handled entirely within the target. \
  959. */ \
  960. postponed: 1, \
  961. \
  962. /* extension - \
  963. * This flag indicates whether a HTT tx MSDU extension descriptor \
  964. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  965. * \
  966. * 0x0 - no extension MSDU descriptor is present \
  967. * 0x1 - an extension MSDU descriptor immediately follows the \
  968. * regular MSDU descriptor \
  969. */ \
  970. extension: 1, \
  971. \
  972. /* cksum_offload - \
  973. * This flag indicates whether checksum offload is enabled or not \
  974. * for this frame. Target FW use this flag to turn on HW checksumming \
  975. * 0x0 - No checksum offload \
  976. * 0x1 - L3 header checksum only \
  977. * 0x2 - L4 checksum only \
  978. * 0x3 - L3 header checksum + L4 checksum \
  979. */ \
  980. cksum_offload: 2, \
  981. \
  982. /* tx_comp_req - \
  983. * This flag indicates whether Tx Completion \
  984. * from fw is required or not. \
  985. * This flag is only relevant if tx completion is not \
  986. * universally enabled. \
  987. * For all LL systems, tx completion is mandatory, \
  988. * so this flag will be irrelevant. \
  989. * For HL systems tx completion is optional, but HL systems in which \
  990. * the bus throughput exceeds the WLAN throughput will \
  991. * probably want to always use tx completion, and thus \
  992. * would not check this flag. \
  993. * This flag is required when tx completions are not used universally, \
  994. * but are still required for certain tx frames for which \
  995. * an OTA delivery acknowledgment is needed by the host. \
  996. * In practice, this would be for HL systems in which the \
  997. * bus throughput is less than the WLAN throughput. \
  998. * \
  999. * 0x0 - Tx Completion Indication from Fw not required \
  1000. * 0x1 - Tx Completion Indication from Fw is required \
  1001. */ \
  1002. tx_compl_req: 1; \
  1003. \
  1004. \
  1005. /* DWORD 1: MSDU length and ID */ \
  1006. A_UINT32 \
  1007. len: 16, /* MSDU length, in bytes */ \
  1008. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1009. * and this id is used to calculate fragmentation \
  1010. * descriptor pointer inside the target based on \
  1011. * the base address, configured inside the target. \
  1012. */ \
  1013. \
  1014. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1015. /* frags_desc_ptr - \
  1016. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1017. * where the tx frame's fragments reside in memory. \
  1018. * This field only applies to LL systems, since in HL systems the \
  1019. * (degenerate single-fragment) fragmentation descriptor is created \
  1020. * within the target. \
  1021. */ \
  1022. _paddr__frags_desc_ptr_; \
  1023. \
  1024. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1025. /* \
  1026. * Peer ID : Target can use this value to know which peer-id packet \
  1027. * destined to. \
  1028. * It's intended to be specified by host in case of NAWDS. \
  1029. */ \
  1030. A_UINT16 peerid; \
  1031. \
  1032. /* \
  1033. * Channel frequency: This identifies the desired channel \
  1034. * frequency (in mhz) for tx frames. This is used by FW to help \
  1035. * determine when it is safe to transmit or drop frames for \
  1036. * off-channel operation. \
  1037. * The default value of zero indicates to FW that the corresponding \
  1038. * VDEV's home channel (if there is one) is the desired channel \
  1039. * frequency. \
  1040. */ \
  1041. A_UINT16 chanfreq; \
  1042. \
  1043. /* Reason reserved is commented is increasing the htt structure size \
  1044. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  1045. * A_UINT32 reserved_dword3_bits0_31; \
  1046. */ \
  1047. } POSTPACK
  1048. /* define a htt_tx_msdu_desc32_t type */
  1049. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1050. /* define a htt_tx_msdu_desc64_t type */
  1051. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1052. /*
  1053. * Make htt_tx_msdu_desc_t be an alias for either
  1054. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1055. */
  1056. #if HTT_PADDR64
  1057. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1058. #else
  1059. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1060. #endif
  1061. /* decriptor information for Management frame*/
  1062. /*
  1063. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1064. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1065. */
  1066. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1067. extern A_UINT32 mgmt_hdr_len;
  1068. PREPACK struct htt_mgmt_tx_desc_t {
  1069. A_UINT32 msg_type;
  1070. #if HTT_PADDR64
  1071. A_UINT64 frag_paddr; /* DMAble address of the data */
  1072. #else
  1073. A_UINT32 frag_paddr; /* DMAble address of the data */
  1074. #endif
  1075. A_UINT32 desc_id; /* returned to host during completion
  1076. * to free the meory*/
  1077. A_UINT32 len; /* Fragment length */
  1078. A_UINT32 vdev_id; /* virtual device ID*/
  1079. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1080. } POSTPACK;
  1081. PREPACK struct htt_mgmt_tx_compl_ind {
  1082. A_UINT32 desc_id;
  1083. A_UINT32 status;
  1084. } POSTPACK;
  1085. /*
  1086. * This SDU header size comes from the summation of the following:
  1087. * 1. Max of:
  1088. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1089. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1090. * b. 802.11 header, for raw frames: 36 bytes
  1091. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1092. * QoS header, HT header)
  1093. * c. 802.3 header, for ethernet frames: 14 bytes
  1094. * (destination address, source address, ethertype / length)
  1095. * 2. Max of:
  1096. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1097. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1098. * 3. 802.1Q VLAN header: 4 bytes
  1099. * 4. LLC/SNAP header: 8 bytes
  1100. */
  1101. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1102. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1103. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1104. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1105. A_COMPILE_TIME_ASSERT(
  1106. htt_encap_hdr_size_max_check_nwifi,
  1107. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1108. A_COMPILE_TIME_ASSERT(
  1109. htt_encap_hdr_size_max_check_enet,
  1110. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1111. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1112. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1113. #define HTT_TX_HDR_SIZE_802_1Q 4
  1114. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1115. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1116. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1117. HTT_TX_HDR_SIZE_802_1Q + \
  1118. HTT_TX_HDR_SIZE_LLC_SNAP)
  1119. #define HTT_HL_TX_FRM_HDR_LEN \
  1120. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1121. #define HTT_LL_TX_FRM_HDR_LEN \
  1122. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1123. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1124. /* dword 0 */
  1125. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1126. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1127. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1128. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1129. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1130. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1131. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1132. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1133. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1134. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1135. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1136. #define HTT_TX_DESC_PKT_TYPE_S 13
  1137. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1138. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1139. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1140. #define HTT_TX_DESC_VDEV_ID_S 16
  1141. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1142. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1143. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1144. #define HTT_TX_DESC_EXT_TID_S 22
  1145. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1146. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1147. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1148. #define HTT_TX_DESC_POSTPONED_S 27
  1149. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1150. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1151. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1152. #define HTT_TX_DESC_EXTENSION_S 28
  1153. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1154. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1155. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1156. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1157. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1158. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1159. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1160. #define HTT_TX_DESC_TX_COMP_S 31
  1161. /* dword 1 */
  1162. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1163. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1164. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1165. #define HTT_TX_DESC_FRM_LEN_S 0
  1166. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1167. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1168. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1169. #define HTT_TX_DESC_FRM_ID_S 16
  1170. /* dword 2 */
  1171. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1172. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1173. /* for systems using 64-bit format for bus addresses */
  1174. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1175. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1176. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1177. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1178. /* for systems using 32-bit format for bus addresses */
  1179. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1180. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1181. /* dword 3 */
  1182. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1183. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1184. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1185. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1186. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1187. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1188. #if HTT_PADDR64
  1189. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1190. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1191. #else
  1192. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1193. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1194. #endif
  1195. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1196. #define HTT_TX_DESC_PEER_ID_S 0
  1197. /*
  1198. * TEMPORARY:
  1199. * The original definitions for the PEER_ID fields contained typos
  1200. * (with _DESC_PADDR appended to this PEER_ID field name).
  1201. * Retain deprecated original names for PEER_ID fields until all code that
  1202. * refers to them has been updated.
  1203. */
  1204. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1205. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1206. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1207. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1208. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1209. HTT_TX_DESC_PEER_ID_M
  1210. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1211. HTT_TX_DESC_PEER_ID_S
  1212. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1213. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1214. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1215. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1216. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1217. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1218. #if HTT_PADDR64
  1219. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1220. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1221. #else
  1222. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1223. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1224. #endif
  1225. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1226. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1227. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1228. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1229. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1230. do { \
  1231. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1232. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1233. } while (0)
  1234. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1235. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1236. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1237. do { \
  1238. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1239. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1240. } while (0)
  1241. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1242. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1243. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1244. do { \
  1245. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1246. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1247. } while (0)
  1248. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1249. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1250. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1251. do { \
  1252. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1253. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1254. } while (0)
  1255. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1256. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1257. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1258. do { \
  1259. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1260. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1261. } while (0)
  1262. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1263. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1264. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1265. do { \
  1266. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1267. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1268. } while (0)
  1269. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1270. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1271. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1272. do { \
  1273. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1274. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1275. } while (0)
  1276. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1277. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1278. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1279. do { \
  1280. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1281. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1282. } while (0)
  1283. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1284. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1285. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1286. do { \
  1287. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1288. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1289. } while (0)
  1290. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1291. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1292. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1293. do { \
  1294. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1295. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1296. } while (0)
  1297. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1298. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1299. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1300. do { \
  1301. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1302. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1303. } while (0)
  1304. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1305. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1306. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1307. do { \
  1308. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1309. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1310. } while (0)
  1311. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1312. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1313. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1314. do { \
  1315. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1316. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1317. } while (0)
  1318. /* enums used in the HTT tx MSDU extension descriptor */
  1319. enum {
  1320. htt_tx_guard_interval_regular = 0,
  1321. htt_tx_guard_interval_short = 1,
  1322. };
  1323. enum {
  1324. htt_tx_preamble_type_ofdm = 0,
  1325. htt_tx_preamble_type_cck = 1,
  1326. htt_tx_preamble_type_ht = 2,
  1327. htt_tx_preamble_type_vht = 3,
  1328. };
  1329. enum {
  1330. htt_tx_bandwidth_5MHz = 0,
  1331. htt_tx_bandwidth_10MHz = 1,
  1332. htt_tx_bandwidth_20MHz = 2,
  1333. htt_tx_bandwidth_40MHz = 3,
  1334. htt_tx_bandwidth_80MHz = 4,
  1335. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1336. };
  1337. /**
  1338. * @brief HTT tx MSDU extension descriptor
  1339. * @details
  1340. * If the target supports HTT tx MSDU extension descriptors, the host has
  1341. * the option of appending the following struct following the regular
  1342. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1343. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1344. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1345. * tx specs for each frame.
  1346. */
  1347. PREPACK struct htt_tx_msdu_desc_ext_t {
  1348. /* DWORD 0: flags */
  1349. A_UINT32
  1350. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1351. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1352. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1353. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1354. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1355. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1356. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1357. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1358. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1359. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1360. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1361. /* DWORD 1: tx power, tx rate, tx BW */
  1362. A_UINT32
  1363. /* pwr -
  1364. * Specify what power the tx frame needs to be transmitted at.
  1365. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1366. * The value needs to be appropriately sign-extended when extracting
  1367. * the value from the message and storing it in a variable that is
  1368. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1369. * automatically handles this sign-extension.)
  1370. * If the transmission uses multiple tx chains, this power spec is
  1371. * the total transmit power, assuming incoherent combination of
  1372. * per-chain power to produce the total power.
  1373. */
  1374. pwr: 8,
  1375. /* mcs_mask -
  1376. * Specify the allowable values for MCS index (modulation and coding)
  1377. * to use for transmitting the frame.
  1378. *
  1379. * For HT / VHT preamble types, this mask directly corresponds to
  1380. * the HT or VHT MCS indices that are allowed. For each bit N set
  1381. * within the mask, MCS index N is allowed for transmitting the frame.
  1382. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1383. * rates versus OFDM rates, so the host has the option of specifying
  1384. * that the target must transmit the frame with CCK or OFDM rates
  1385. * (not HT or VHT), but leaving the decision to the target whether
  1386. * to use CCK or OFDM.
  1387. *
  1388. * For CCK and OFDM, the bits within this mask are interpreted as
  1389. * follows:
  1390. * bit 0 -> CCK 1 Mbps rate is allowed
  1391. * bit 1 -> CCK 2 Mbps rate is allowed
  1392. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1393. * bit 3 -> CCK 11 Mbps rate is allowed
  1394. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1395. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1396. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1397. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1398. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1399. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1400. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1401. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1402. *
  1403. * The MCS index specification needs to be compatible with the
  1404. * bandwidth mask specification. For example, a MCS index == 9
  1405. * specification is inconsistent with a preamble type == VHT,
  1406. * Nss == 1, and channel bandwidth == 20 MHz.
  1407. *
  1408. * Furthermore, the host has only a limited ability to specify to
  1409. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1410. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1411. */
  1412. mcs_mask: 12,
  1413. /* nss_mask -
  1414. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1415. * Each bit in this mask corresponds to a Nss value:
  1416. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1417. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1418. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1419. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1420. * The values in the Nss mask must be suitable for the recipient, e.g.
  1421. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1422. * recipient which only supports 2x2 MIMO.
  1423. */
  1424. nss_mask: 4,
  1425. /* guard_interval -
  1426. * Specify a htt_tx_guard_interval enum value to indicate whether
  1427. * the transmission should use a regular guard interval or a
  1428. * short guard interval.
  1429. */
  1430. guard_interval: 1,
  1431. /* preamble_type_mask -
  1432. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1433. * may choose from for transmitting this frame.
  1434. * The bits in this mask correspond to the values in the
  1435. * htt_tx_preamble_type enum. For example, to allow the target
  1436. * to transmit the frame as either CCK or OFDM, this field would
  1437. * be set to
  1438. * (1 << htt_tx_preamble_type_ofdm) |
  1439. * (1 << htt_tx_preamble_type_cck)
  1440. */
  1441. preamble_type_mask: 4,
  1442. reserved1_31_29: 3; /* unused, set to 0x0 */
  1443. /* DWORD 2: tx chain mask, tx retries */
  1444. A_UINT32
  1445. /* chain_mask - specify which chains to transmit from */
  1446. chain_mask: 4,
  1447. /* retry_limit -
  1448. * Specify the maximum number of transmissions, including the
  1449. * initial transmission, to attempt before giving up if no ack
  1450. * is received.
  1451. * If the tx rate is specified, then all retries shall use the
  1452. * same rate as the initial transmission.
  1453. * If no tx rate is specified, the target can choose whether to
  1454. * retain the original rate during the retransmissions, or to
  1455. * fall back to a more robust rate.
  1456. */
  1457. retry_limit: 4,
  1458. /* bandwidth_mask -
  1459. * Specify what channel widths may be used for the transmission.
  1460. * A value of zero indicates "don't care" - the target may choose
  1461. * the transmission bandwidth.
  1462. * The bits within this mask correspond to the htt_tx_bandwidth
  1463. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1464. * The bandwidth_mask must be consistent with the preamble_type_mask
  1465. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1466. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1467. */
  1468. bandwidth_mask: 6,
  1469. reserved2_31_14: 18; /* unused, set to 0x0 */
  1470. /* DWORD 3: tx expiry time (TSF) LSBs */
  1471. A_UINT32 expire_tsf_lo;
  1472. /* DWORD 4: tx expiry time (TSF) MSBs */
  1473. A_UINT32 expire_tsf_hi;
  1474. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1475. } POSTPACK;
  1476. /* DWORD 0 */
  1477. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1478. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1479. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1480. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1481. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1482. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1483. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1484. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1485. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1486. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1487. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1488. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1489. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1490. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1491. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1492. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1493. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1494. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1495. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1496. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1497. /* DWORD 1 */
  1498. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1499. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1500. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1501. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1502. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1503. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1504. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1505. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1506. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1507. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1508. /* DWORD 2 */
  1509. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1510. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1511. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1512. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1513. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1514. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1515. /* DWORD 0 */
  1516. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1517. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1518. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1519. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1520. do { \
  1521. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1522. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1523. } while (0)
  1524. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1525. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1526. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1527. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1528. do { \
  1529. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1530. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1531. } while (0)
  1532. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1533. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1534. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1535. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1536. do { \
  1537. HTT_CHECK_SET_VAL( \
  1538. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1539. ((_var) |= ((_val) \
  1540. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1541. } while (0)
  1542. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1543. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1544. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1545. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1546. do { \
  1547. HTT_CHECK_SET_VAL( \
  1548. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1549. ((_var) |= ((_val) \
  1550. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1551. } while (0)
  1552. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1553. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1554. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1555. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1556. do { \
  1557. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1558. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1559. } while (0)
  1560. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1561. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1562. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1563. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1564. do { \
  1565. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1566. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1567. } while (0)
  1568. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1569. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1570. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1571. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1572. do { \
  1573. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1574. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1575. } while (0)
  1576. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1577. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1578. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1579. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1580. do { \
  1581. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1582. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1583. } while (0)
  1584. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1585. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1586. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1587. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1588. do { \
  1589. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1590. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1591. } while (0)
  1592. /* DWORD 1 */
  1593. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1594. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1595. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1596. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1597. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1598. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1599. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1600. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1601. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1602. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1603. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1604. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1605. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1606. do { \
  1607. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1608. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1609. } while (0)
  1610. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1611. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1612. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1613. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1614. do { \
  1615. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1616. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1617. } while (0)
  1618. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1619. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1620. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1621. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1622. do { \
  1623. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1624. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1625. } while (0)
  1626. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1627. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1628. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1629. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1630. do { \
  1631. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1632. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1633. } while (0)
  1634. /* DWORD 2 */
  1635. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1636. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1637. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1638. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1639. do { \
  1640. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1641. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1642. } while (0)
  1643. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1644. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1645. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1646. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1647. do { \
  1648. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1649. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1650. } while (0)
  1651. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1652. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1653. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1654. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1655. do { \
  1656. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1657. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1658. } while (0)
  1659. typedef enum {
  1660. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1661. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1662. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1663. } htt_11ax_ltf_subtype_t;
  1664. typedef enum {
  1665. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1666. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1667. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1668. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1669. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1670. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1671. } htt_tx_ext2_preamble_type_t;
  1672. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1673. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1674. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1675. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1676. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1677. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1678. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1679. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1680. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1681. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1682. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1683. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1684. /**
  1685. * @brief HTT tx MSDU extension descriptor v2
  1686. * @details
  1687. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1688. * is received as tcl_exit_base->host_meta_info in firmware.
  1689. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1690. * are already part of tcl_exit_base.
  1691. */
  1692. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1693. /* DWORD 0: flags */
  1694. A_UINT32
  1695. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1696. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1697. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1698. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1699. valid_retries : 1, /* if set, tx retries spec is valid */
  1700. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1701. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1702. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1703. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1704. valid_key_flags : 1, /* if set, key flags is valid */
  1705. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1706. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1707. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1708. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1709. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1710. 1 = ENCRYPT,
  1711. 2 ~ 3 - Reserved */
  1712. /* retry_limit -
  1713. * Specify the maximum number of transmissions, including the
  1714. * initial transmission, to attempt before giving up if no ack
  1715. * is received.
  1716. * If the tx rate is specified, then all retries shall use the
  1717. * same rate as the initial transmission.
  1718. * If no tx rate is specified, the target can choose whether to
  1719. * retain the original rate during the retransmissions, or to
  1720. * fall back to a more robust rate.
  1721. */
  1722. retry_limit : 4,
  1723. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1724. * Valid only for 11ax preamble types HE_SU
  1725. * and HE_EXT_SU
  1726. */
  1727. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1728. * Valid only for 11ax preamble types HE_SU
  1729. * and HE_EXT_SU
  1730. */
  1731. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1732. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1733. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1734. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1735. */
  1736. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1737. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1738. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1739. * Use cases:
  1740. * Any time firmware uses TQM-BYPASS for Data
  1741. * TID, firmware expect host to set this bit.
  1742. */
  1743. /* DWORD 1: tx power, tx rate */
  1744. A_UINT32
  1745. power : 8, /* unit of the power field is 0.5 dbm
  1746. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1747. * signed value ranging from -64dbm to 63.5 dbm
  1748. */
  1749. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1750. * Setting more than one MCS isn't currently
  1751. * supported by the target (but is supported
  1752. * in the interface in case in the future
  1753. * the target supports specifications of
  1754. * a limited set of MCS values.
  1755. */
  1756. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1757. * Setting more than one Nss isn't currently
  1758. * supported by the target (but is supported
  1759. * in the interface in case in the future
  1760. * the target supports specifications of
  1761. * a limited set of Nss values.
  1762. */
  1763. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1764. update_peer_cache : 1; /* When set these custom values will be
  1765. * used for all packets, until the next
  1766. * update via this ext header.
  1767. * This is to make sure not all packets
  1768. * need to include this header.
  1769. */
  1770. /* DWORD 2: tx chain mask, tx retries */
  1771. A_UINT32
  1772. /* chain_mask - specify which chains to transmit from */
  1773. chain_mask : 8,
  1774. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1775. * TODO: Update Enum values for key_flags
  1776. */
  1777. /*
  1778. * Channel frequency: This identifies the desired channel
  1779. * frequency (in MHz) for tx frames. This is used by FW to help
  1780. * determine when it is safe to transmit or drop frames for
  1781. * off-channel operation.
  1782. * The default value of zero indicates to FW that the corresponding
  1783. * VDEV's home channel (if there is one) is the desired channel
  1784. * frequency.
  1785. */
  1786. chanfreq : 16;
  1787. /* DWORD 3: tx expiry time (TSF) LSBs */
  1788. A_UINT32 expire_tsf_lo;
  1789. /* DWORD 4: tx expiry time (TSF) MSBs */
  1790. A_UINT32 expire_tsf_hi;
  1791. /* DWORD 5: flags to control routing / processing of the MSDU */
  1792. A_UINT32
  1793. /* learning_frame
  1794. * When this flag is set, this frame will be dropped by FW
  1795. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1796. */
  1797. learning_frame : 1,
  1798. /* send_as_standalone
  1799. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1800. * i.e. with no A-MSDU or A-MPDU aggregation.
  1801. * The scope is extended to other use-cases.
  1802. */
  1803. send_as_standalone : 1,
  1804. /* is_host_opaque_valid
  1805. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1806. * with valid information.
  1807. */
  1808. is_host_opaque_valid : 1,
  1809. rsvd0 : 29;
  1810. /* DWORD 6 : Host opaque cookie for special frames */
  1811. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1812. rsvd1 : 16;
  1813. /*
  1814. * This structure can be expanded further up to 40 bytes
  1815. * by adding further DWORDs as needed.
  1816. */
  1817. } POSTPACK;
  1818. /* DWORD 0 */
  1819. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1820. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1821. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1822. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1823. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1824. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1825. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1826. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1827. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1828. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1829. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1830. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1831. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1832. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1833. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1834. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1835. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1836. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1837. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1838. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1839. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1840. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1841. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1842. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1843. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1844. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1845. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1846. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1847. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1848. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1849. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1850. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1851. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1852. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1853. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1854. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1855. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1856. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1857. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1858. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1859. /* DWORD 1 */
  1860. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1861. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1862. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1863. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1864. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1865. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1866. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1867. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1868. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1869. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1870. /* DWORD 2 */
  1871. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1872. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1873. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1874. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1875. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1876. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1877. /* DWORD 5 */
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1880. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1881. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1882. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1883. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1884. /* DWORD 6 */
  1885. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1886. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1887. /* DWORD 0 */
  1888. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1889. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1890. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1891. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1892. do { \
  1893. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1894. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1895. } while (0)
  1896. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1897. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1898. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1899. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1900. do { \
  1901. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1902. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1903. } while (0)
  1904. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1905. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1906. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1907. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1908. do { \
  1909. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1910. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1911. } while (0)
  1912. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1913. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1914. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1915. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1916. do { \
  1917. HTT_CHECK_SET_VAL( \
  1918. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1919. ((_var) |= ((_val) \
  1920. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1921. } while (0)
  1922. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1923. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1924. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1925. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1926. do { \
  1927. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1928. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1929. } while (0)
  1930. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1931. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1932. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1933. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1934. do { \
  1935. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1936. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1937. } while (0)
  1938. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1939. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1940. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1941. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1942. do { \
  1943. HTT_CHECK_SET_VAL( \
  1944. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1945. ((_var) |= ((_val) \
  1946. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1947. } while (0)
  1948. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1949. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1950. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1951. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1952. do { \
  1953. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1954. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1955. } while (0)
  1956. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1957. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1958. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1959. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1960. do { \
  1961. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1962. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1963. } while (0)
  1964. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1965. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1966. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1967. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1968. do { \
  1969. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1970. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1971. } while (0)
  1972. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1973. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1974. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1975. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1976. do { \
  1977. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1978. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1979. } while (0)
  1980. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1981. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1982. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1983. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1984. do { \
  1985. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1986. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1987. } while (0)
  1988. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1989. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1990. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1991. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1992. do { \
  1993. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1994. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1995. } while (0)
  1996. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1997. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1998. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1999. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2000. do { \
  2001. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2002. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2003. } while (0)
  2004. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2005. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2006. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2007. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2008. do { \
  2009. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2010. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2011. } while (0)
  2012. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2013. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2014. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2015. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2016. do { \
  2017. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2018. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2019. } while (0)
  2020. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2021. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2022. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2023. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2024. do { \
  2025. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2026. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2027. } while (0)
  2028. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2029. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2030. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2031. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2032. do { \
  2033. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2034. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2035. } while (0)
  2036. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2037. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2038. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2039. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2040. do { \
  2041. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2042. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2043. } while (0)
  2044. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2045. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2046. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2047. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2048. do { \
  2049. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2050. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2051. } while (0)
  2052. /* DWORD 1 */
  2053. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2054. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2055. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2056. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2057. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2058. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2059. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2060. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2061. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2062. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2063. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2064. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2065. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2066. do { \
  2067. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2068. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2069. } while (0)
  2070. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2071. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2072. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2073. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2074. do { \
  2075. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2076. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2077. } while (0)
  2078. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2079. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2080. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2081. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2082. do { \
  2083. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2084. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2085. } while (0)
  2086. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2087. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2088. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2089. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2090. do { \
  2091. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2092. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2093. } while (0)
  2094. /* DWORD 2 */
  2095. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2096. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2097. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2098. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2099. do { \
  2100. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2101. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2102. } while (0)
  2103. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2104. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2105. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2106. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2107. do { \
  2108. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2109. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2110. } while (0)
  2111. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2112. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2113. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2114. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2115. do { \
  2116. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2117. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2118. } while (0)
  2119. /* DWORD 5 */
  2120. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2121. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2122. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2123. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2124. do { \
  2125. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2126. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2127. } while (0)
  2128. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2129. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2130. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2131. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2132. do { \
  2133. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2134. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2135. } while (0)
  2136. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2137. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2138. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2139. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2140. do { \
  2141. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2142. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2143. } while (0)
  2144. /* DWORD 6 */
  2145. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2146. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2147. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2148. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2149. do { \
  2150. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2151. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2152. } while (0)
  2153. typedef enum {
  2154. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2155. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2156. } htt_tcl_metadata_type;
  2157. /**
  2158. * @brief HTT TCL command number format
  2159. * @details
  2160. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2161. * available to firmware as tcl_exit_base->tcl_status_number.
  2162. * For regular / multicast packets host will send vdev and mac id and for
  2163. * NAWDS packets, host will send peer id.
  2164. * A_UINT32 is used to avoid endianness conversion problems.
  2165. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2166. */
  2167. typedef struct {
  2168. A_UINT32
  2169. type: 1, /* vdev_id based or peer_id based */
  2170. rsvd: 31;
  2171. } htt_tx_tcl_vdev_or_peer_t;
  2172. typedef struct {
  2173. A_UINT32
  2174. type: 1, /* vdev_id based or peer_id based */
  2175. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2176. vdev_id: 8,
  2177. pdev_id: 2,
  2178. host_inspected:1,
  2179. rsvd: 19;
  2180. } htt_tx_tcl_vdev_metadata;
  2181. typedef struct {
  2182. A_UINT32
  2183. type: 1, /* vdev_id based or peer_id based */
  2184. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2185. peer_id: 14,
  2186. rsvd: 16;
  2187. } htt_tx_tcl_peer_metadata;
  2188. PREPACK struct htt_tx_tcl_metadata {
  2189. union {
  2190. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2191. htt_tx_tcl_vdev_metadata vdev_meta;
  2192. htt_tx_tcl_peer_metadata peer_meta;
  2193. };
  2194. } POSTPACK;
  2195. /* DWORD 0 */
  2196. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2197. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2198. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2199. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2200. /* VDEV metadata */
  2201. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2202. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2203. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2204. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2205. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2206. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2207. /* PEER metadata */
  2208. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2209. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2210. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2211. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2212. HTT_TX_TCL_METADATA_TYPE_S)
  2213. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2214. do { \
  2215. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2216. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2217. } while (0)
  2218. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2219. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2220. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2221. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2222. do { \
  2223. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2224. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2225. } while (0)
  2226. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2227. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2228. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2229. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2230. do { \
  2231. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2232. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2233. } while (0)
  2234. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2235. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2236. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2237. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2238. do { \
  2239. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2240. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2241. } while (0)
  2242. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2243. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2244. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2245. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2246. do { \
  2247. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2248. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2249. } while (0)
  2250. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2251. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2252. HTT_TX_TCL_METADATA_PEER_ID_S)
  2253. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2254. do { \
  2255. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2256. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2257. } while (0)
  2258. /*------------------------------------------------------------------
  2259. * V2 Version of TCL Data Command
  2260. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2261. * MLO global_seq all flavours of TCL Data Cmd.
  2262. *-----------------------------------------------------------------*/
  2263. typedef enum {
  2264. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2265. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2266. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2267. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2268. } htt_tcl_metadata_type_v2;
  2269. /**
  2270. * @brief HTT TCL command number format
  2271. * @details
  2272. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2273. * available to firmware as tcl_exit_base->tcl_status_number.
  2274. * A_UINT32 is used to avoid endianness conversion problems.
  2275. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2276. */
  2277. typedef struct {
  2278. A_UINT32
  2279. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2280. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2281. vdev_id: 8,
  2282. pdev_id: 2,
  2283. host_inspected:1,
  2284. rsvd: 2,
  2285. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2286. } htt_tx_tcl_vdev_metadata_v2;
  2287. typedef struct {
  2288. A_UINT32
  2289. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2290. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2291. peer_id: 13,
  2292. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2293. } htt_tx_tcl_peer_metadata_v2;
  2294. typedef struct {
  2295. A_UINT32
  2296. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2297. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2298. svc_class_id: 8,
  2299. rsvd: 5,
  2300. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2301. } htt_tx_tcl_svc_class_id_metadata;
  2302. typedef struct {
  2303. A_UINT32
  2304. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2305. host_inspected: 1,
  2306. global_seq_no: 12,
  2307. rsvd: 1,
  2308. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2309. } htt_tx_tcl_global_seq_metadata;
  2310. PREPACK struct htt_tx_tcl_metadata_v2 {
  2311. union {
  2312. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2313. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2314. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2315. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2316. };
  2317. } POSTPACK;
  2318. /* DWORD 0 */
  2319. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2320. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2321. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2322. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2323. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2324. /* VDEV V2 metadata */
  2325. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2326. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2327. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2328. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2329. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2330. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2331. /* PEER V2 metadata */
  2332. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2333. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2334. /* SVC_CLASS_ID metadata */
  2335. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2336. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2337. /* Global Seq no metadata */
  2338. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2339. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2340. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2341. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2342. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2343. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2344. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2345. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2346. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2347. do { \
  2348. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2349. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2350. } while (0)
  2351. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2352. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2353. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2354. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2355. do { \
  2356. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2357. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2358. } while (0)
  2359. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2360. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2361. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2362. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2363. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2364. do { \
  2365. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2366. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2367. } while (0)
  2368. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2369. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2370. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2371. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2372. do { \
  2373. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2374. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2375. } while (0)
  2376. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2377. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2378. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2379. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2380. do { \
  2381. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2382. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2383. } while (0)
  2384. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2385. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2386. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2387. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2388. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2389. do { \
  2390. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2391. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2392. } while (0)
  2393. /*----- Get and Set V2 type field in Service Class fields ----*/
  2394. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2395. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2396. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2397. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2398. do { \
  2399. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2400. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2401. } while (0)
  2402. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2403. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2404. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2405. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2406. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2407. do { \
  2408. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2409. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2410. } while (0)
  2411. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2412. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2413. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2414. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2415. do { \
  2416. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2417. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2418. } while (0)
  2419. /*------------------------------------------------------------------
  2420. * End V2 Version of TCL Data Command
  2421. *-----------------------------------------------------------------*/
  2422. typedef enum {
  2423. HTT_TX_FW2WBM_TX_STATUS_OK,
  2424. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2425. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2426. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2427. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2428. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2429. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2430. HTT_TX_FW2WBM_TX_STATUS_MAX
  2431. } htt_tx_fw2wbm_tx_status_t;
  2432. typedef enum {
  2433. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2434. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2435. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2436. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2437. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2438. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2439. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2440. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2441. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2442. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2443. } htt_tx_fw2wbm_reinject_reason_t;
  2444. /**
  2445. * @brief HTT TX WBM Completion from firmware to host
  2446. * @details
  2447. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2448. * DWORD 3 and 4 for software based completions (Exception frames and
  2449. * TQM bypass frames)
  2450. * For software based completions, wbm_release_ring->release_source_module will
  2451. * be set to release_source_fw
  2452. */
  2453. PREPACK struct htt_tx_wbm_completion {
  2454. A_UINT32
  2455. sch_cmd_id: 24,
  2456. exception_frame: 1, /* If set, this packet was queued via exception path */
  2457. rsvd0_31_25: 7;
  2458. A_UINT32
  2459. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2460. * reception of an ACK or BA, this field indicates
  2461. * the RSSI of the received ACK or BA frame.
  2462. * When the frame is removed as result of a direct
  2463. * remove command from the SW, this field is set
  2464. * to 0x0 (which is never a valid value when real
  2465. * RSSI is available).
  2466. * Units: dB w.r.t noise floor
  2467. */
  2468. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2469. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2470. rsvd1_31_16: 16;
  2471. } POSTPACK;
  2472. /* DWORD 0 */
  2473. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2474. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2475. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2476. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2477. /* DWORD 1 */
  2478. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2479. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2480. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2481. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2482. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2483. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2484. /* DWORD 0 */
  2485. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2486. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2487. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2488. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2489. do { \
  2490. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2491. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2492. } while (0)
  2493. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2494. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2495. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2496. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2497. do { \
  2498. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2499. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2500. } while (0)
  2501. /* DWORD 1 */
  2502. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2503. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2504. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2505. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2506. do { \
  2507. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2508. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2509. } while (0)
  2510. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2511. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2512. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2513. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2514. do { \
  2515. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2516. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2517. } while (0)
  2518. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2519. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2520. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2521. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2522. do { \
  2523. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2524. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2525. } while (0)
  2526. /**
  2527. * @brief HTT TX WBM Completion from firmware to host
  2528. * @details
  2529. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2530. * (WBM) offload HW.
  2531. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2532. * For software based completions, release_source_module will
  2533. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2534. * struct wbm_release_ring and then switch to this after looking at
  2535. * release_source_module.
  2536. */
  2537. PREPACK struct htt_tx_wbm_completion_v2 {
  2538. A_UINT32
  2539. used_by_hw0; /* Refer to struct wbm_release_ring */
  2540. A_UINT32
  2541. used_by_hw1; /* Refer to struct wbm_release_ring */
  2542. A_UINT32
  2543. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2544. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2545. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2546. exception_frame: 1,
  2547. rsvd0: 12, /* For future use */
  2548. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2549. rsvd1: 1; /* For future use */
  2550. A_UINT32
  2551. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2552. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2553. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2554. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2555. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2556. */
  2557. A_UINT32
  2558. data1: 32;
  2559. A_UINT32
  2560. data2: 32;
  2561. A_UINT32
  2562. used_by_hw3; /* Refer to struct wbm_release_ring */
  2563. } POSTPACK;
  2564. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2565. /* DWORD 3 */
  2566. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2567. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2568. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2569. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2570. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2571. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2572. /* DWORD 3 */
  2573. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2574. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2575. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2576. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2577. do { \
  2578. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2579. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2580. } while (0)
  2581. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2582. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2583. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2584. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2585. do { \
  2586. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2587. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2588. } while (0)
  2589. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2590. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2591. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2592. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2593. do { \
  2594. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2595. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2596. } while (0)
  2597. /**
  2598. * @brief HTT TX WBM Completion from firmware to host (V3)
  2599. * @details
  2600. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2601. * (WBM) offload HW.
  2602. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2603. * For software based completions, release_source_module will
  2604. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2605. * struct wbm_release_ring and then switch to this after looking at
  2606. * release_source_module.
  2607. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2608. * by new generations of targets.
  2609. */
  2610. PREPACK struct htt_tx_wbm_completion_v3 {
  2611. A_UINT32
  2612. used_by_hw0; /* Refer to struct wbm_release_ring */
  2613. A_UINT32
  2614. used_by_hw1; /* Refer to struct wbm_release_ring */
  2615. A_UINT32
  2616. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2617. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2618. used_by_hw3: 15;
  2619. A_UINT32
  2620. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2621. exception_frame: 1,
  2622. rsvd0: 27; /* For future use */
  2623. A_UINT32
  2624. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2625. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2626. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2627. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2628. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2629. */
  2630. A_UINT32
  2631. data1: 32;
  2632. A_UINT32
  2633. data2: 32;
  2634. A_UINT32
  2635. rsvd1: 20,
  2636. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2637. } POSTPACK;
  2638. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2639. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2640. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2641. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2642. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2643. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2644. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2645. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2646. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2647. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2648. do { \
  2649. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2650. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2651. } while (0)
  2652. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2653. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2654. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2655. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2656. do { \
  2657. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2658. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2659. } while (0)
  2660. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2661. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2662. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2663. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2664. do { \
  2665. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2666. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2667. } while (0)
  2668. typedef enum {
  2669. TX_FRAME_TYPE_UNDEFINED = 0,
  2670. TX_FRAME_TYPE_EAPOL = 1,
  2671. } htt_tx_wbm_status_frame_type;
  2672. /**
  2673. * @brief HTT TX WBM transmit status from firmware to host
  2674. * @details
  2675. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2676. * (WBM) offload HW.
  2677. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2678. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2679. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2680. */
  2681. PREPACK struct htt_tx_wbm_transmit_status {
  2682. A_UINT32
  2683. sch_cmd_id: 24,
  2684. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2685. * reception of an ACK or BA, this field indicates
  2686. * the RSSI of the received ACK or BA frame.
  2687. * When the frame is removed as result of a direct
  2688. * remove command from the SW, this field is set
  2689. * to 0x0 (which is never a valid value when real
  2690. * RSSI is available).
  2691. * Units: dB w.r.t noise floor
  2692. */
  2693. A_UINT32
  2694. sw_peer_id: 16,
  2695. tid_num: 5,
  2696. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2697. * and tid_num fields contain valid data.
  2698. * If this "valid" flag is not set, the
  2699. * sw_peer_id and tid_num fields must be ignored.
  2700. */
  2701. mcast: 1,
  2702. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2703. * contains valid data.
  2704. */
  2705. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2706. reserved: 4;
  2707. A_UINT32
  2708. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2709. * packets in the wbm completion path
  2710. */
  2711. } POSTPACK;
  2712. /* DWORD 4 */
  2713. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2714. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2715. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2716. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2717. /* DWORD 5 */
  2718. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2719. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2720. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2721. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2722. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2723. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2724. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2725. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2726. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2727. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2728. /* DWORD 4 */
  2729. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2730. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2731. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2732. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2733. do { \
  2734. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2735. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2736. } while (0)
  2737. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2738. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2739. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2740. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2741. do { \
  2742. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2743. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2744. } while (0)
  2745. /* DWORD 5 */
  2746. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2747. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2748. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2749. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2750. do { \
  2751. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2752. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2753. } while (0)
  2754. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2755. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2756. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2757. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2758. do { \
  2759. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2760. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2761. } while (0)
  2762. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2763. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2764. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2765. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2766. do { \
  2767. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2768. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2769. } while (0)
  2770. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2771. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2772. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2773. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2774. do { \
  2775. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2776. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2777. } while (0)
  2778. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2779. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2780. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2781. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2782. do { \
  2783. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2784. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2785. } while (0)
  2786. /**
  2787. * @brief HTT TX WBM reinject status from firmware to host
  2788. * @details
  2789. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2790. * (WBM) offload HW.
  2791. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2792. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2793. */
  2794. PREPACK struct htt_tx_wbm_reinject_status {
  2795. A_UINT32
  2796. reserved0: 32;
  2797. A_UINT32
  2798. reserved1: 32;
  2799. A_UINT32
  2800. reserved2: 32;
  2801. } POSTPACK;
  2802. /**
  2803. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2804. * @details
  2805. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2806. * (WBM) offload HW.
  2807. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2808. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2809. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2810. * STA side.
  2811. */
  2812. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2813. A_UINT32
  2814. mec_sa_addr_31_0;
  2815. A_UINT32
  2816. mec_sa_addr_47_32: 16,
  2817. sa_ast_index: 16;
  2818. A_UINT32
  2819. vdev_id: 8,
  2820. reserved0: 24;
  2821. } POSTPACK;
  2822. /* DWORD 4 - mec_sa_addr_31_0 */
  2823. /* DWORD 5 */
  2824. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2825. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2826. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2827. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2828. /* DWORD 6 */
  2829. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2830. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2831. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2832. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2833. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2834. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2835. do { \
  2836. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2837. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2838. } while (0)
  2839. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2840. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2841. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2842. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2843. do { \
  2844. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2845. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2846. } while (0)
  2847. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2848. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2849. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2850. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2851. do { \
  2852. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2853. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2854. } while (0)
  2855. typedef enum {
  2856. TX_FLOW_PRIORITY_BE,
  2857. TX_FLOW_PRIORITY_HIGH,
  2858. TX_FLOW_PRIORITY_LOW,
  2859. } htt_tx_flow_priority_t;
  2860. typedef enum {
  2861. TX_FLOW_LATENCY_SENSITIVE,
  2862. TX_FLOW_LATENCY_INSENSITIVE,
  2863. } htt_tx_flow_latency_t;
  2864. typedef enum {
  2865. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2866. TX_FLOW_INTERACTIVE_TRAFFIC,
  2867. TX_FLOW_PERIODIC_TRAFFIC,
  2868. TX_FLOW_BURSTY_TRAFFIC,
  2869. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2870. } htt_tx_flow_traffic_pattern_t;
  2871. /**
  2872. * @brief HTT TX Flow search metadata format
  2873. * @details
  2874. * Host will set this metadata in flow table's flow search entry along with
  2875. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2876. * firmware and TQM ring if the flow search entry wins.
  2877. * This metadata is available to firmware in that first MSDU's
  2878. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2879. * to one of the available flows for specific tid and returns the tqm flow
  2880. * pointer as part of htt_tx_map_flow_info message.
  2881. */
  2882. PREPACK struct htt_tx_flow_metadata {
  2883. A_UINT32
  2884. rsvd0_1_0: 2,
  2885. tid: 4,
  2886. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2887. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2888. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2889. * Else choose final tid based on latency, priority.
  2890. */
  2891. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2892. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2893. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2894. } POSTPACK;
  2895. /* DWORD 0 */
  2896. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2897. #define HTT_TX_FLOW_METADATA_TID_S 2
  2898. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2899. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2900. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2901. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2902. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2903. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2904. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2905. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2906. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2907. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2908. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2909. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2910. /* DWORD 0 */
  2911. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2912. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2913. HTT_TX_FLOW_METADATA_TID_S)
  2914. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2915. do { \
  2916. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2917. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2918. } while (0)
  2919. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2920. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2921. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2922. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2923. do { \
  2924. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2925. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2926. } while (0)
  2927. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2928. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2929. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2930. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2931. do { \
  2932. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2933. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2934. } while (0)
  2935. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2936. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2937. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2938. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2939. do { \
  2940. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2941. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2942. } while (0)
  2943. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2944. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2945. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2946. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2947. do { \
  2948. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2949. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2950. } while (0)
  2951. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2952. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2953. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2954. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2955. do { \
  2956. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2957. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2958. } while (0)
  2959. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2960. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2961. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2962. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2963. do { \
  2964. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2965. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2966. } while (0)
  2967. /**
  2968. * @brief host -> target ADD WDS Entry
  2969. *
  2970. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2971. *
  2972. * @brief host -> target DELETE WDS Entry
  2973. *
  2974. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2975. *
  2976. * @details
  2977. * HTT wds entry from source port learning
  2978. * Host will learn wds entries from rx and send this message to firmware
  2979. * to enable firmware to configure/delete AST entries for wds clients.
  2980. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2981. * and when SA's entry is deleted, firmware removes this AST entry
  2982. *
  2983. * The message would appear as follows:
  2984. *
  2985. * |31 30|29 |17 16|15 8|7 0|
  2986. * |----------------+----------------+----------------+----------------|
  2987. * | rsvd0 |PDVID| vdev_id | msg_type |
  2988. * |-------------------------------------------------------------------|
  2989. * | sa_addr_31_0 |
  2990. * |-------------------------------------------------------------------|
  2991. * | | ta_peer_id | sa_addr_47_32 |
  2992. * |-------------------------------------------------------------------|
  2993. * Where PDVID = pdev_id
  2994. *
  2995. * The message is interpreted as follows:
  2996. *
  2997. * dword0 - b'0:7 - msg_type: This will be set to
  2998. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2999. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3000. *
  3001. * dword0 - b'8:15 - vdev_id
  3002. *
  3003. * dword0 - b'16:17 - pdev_id
  3004. *
  3005. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3006. *
  3007. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3008. *
  3009. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3010. *
  3011. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3012. */
  3013. PREPACK struct htt_wds_entry {
  3014. A_UINT32
  3015. msg_type: 8,
  3016. vdev_id: 8,
  3017. pdev_id: 2,
  3018. rsvd0: 14;
  3019. A_UINT32 sa_addr_31_0;
  3020. A_UINT32
  3021. sa_addr_47_32: 16,
  3022. ta_peer_id: 14,
  3023. rsvd2: 2;
  3024. } POSTPACK;
  3025. /* DWORD 0 */
  3026. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3027. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3028. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3029. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3030. /* DWORD 2 */
  3031. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3032. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3033. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3034. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3035. /* DWORD 0 */
  3036. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3037. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3038. HTT_WDS_ENTRY_VDEV_ID_S)
  3039. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3040. do { \
  3041. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3042. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3043. } while (0)
  3044. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3045. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3046. HTT_WDS_ENTRY_PDEV_ID_S)
  3047. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3048. do { \
  3049. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3050. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3051. } while (0)
  3052. /* DWORD 2 */
  3053. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3054. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3055. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3056. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3057. do { \
  3058. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3059. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3060. } while (0)
  3061. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3062. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3063. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3064. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3065. do { \
  3066. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3067. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3068. } while (0)
  3069. /**
  3070. * @brief MAC DMA rx ring setup specification
  3071. *
  3072. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3073. *
  3074. * @details
  3075. * To allow for dynamic rx ring reconfiguration and to avoid race
  3076. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3077. * it uses. Instead, it sends this message to the target, indicating how
  3078. * the rx ring used by the host should be set up and maintained.
  3079. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3080. * specifications.
  3081. *
  3082. * |31 16|15 8|7 0|
  3083. * |---------------------------------------------------------------|
  3084. * header: | reserved | num rings | msg type |
  3085. * |---------------------------------------------------------------|
  3086. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3087. #if HTT_PADDR64
  3088. * | FW_IDX shadow register physical address (bits 63:32) |
  3089. #endif
  3090. * |---------------------------------------------------------------|
  3091. * | rx ring base physical address (bits 31:0) |
  3092. #if HTT_PADDR64
  3093. * | rx ring base physical address (bits 63:32) |
  3094. #endif
  3095. * |---------------------------------------------------------------|
  3096. * | rx ring buffer size | rx ring length |
  3097. * |---------------------------------------------------------------|
  3098. * | FW_IDX initial value | enabled flags |
  3099. * |---------------------------------------------------------------|
  3100. * | MSDU payload offset | 802.11 header offset |
  3101. * |---------------------------------------------------------------|
  3102. * | PPDU end offset | PPDU start offset |
  3103. * |---------------------------------------------------------------|
  3104. * | MPDU end offset | MPDU start offset |
  3105. * |---------------------------------------------------------------|
  3106. * | MSDU end offset | MSDU start offset |
  3107. * |---------------------------------------------------------------|
  3108. * | frag info offset | rx attention offset |
  3109. * |---------------------------------------------------------------|
  3110. * payload 2, if present, has the same format as payload 1
  3111. * Header fields:
  3112. * - MSG_TYPE
  3113. * Bits 7:0
  3114. * Purpose: identifies this as an rx ring configuration message
  3115. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3116. * - NUM_RINGS
  3117. * Bits 15:8
  3118. * Purpose: indicates whether the host is setting up one rx ring or two
  3119. * Value: 1 or 2
  3120. * Payload:
  3121. * for systems using 64-bit format for bus addresses:
  3122. * - IDX_SHADOW_REG_PADDR_LO
  3123. * Bits 31:0
  3124. * Value: lower 4 bytes of physical address of the host's
  3125. * FW_IDX shadow register
  3126. * - IDX_SHADOW_REG_PADDR_HI
  3127. * Bits 31:0
  3128. * Value: upper 4 bytes of physical address of the host's
  3129. * FW_IDX shadow register
  3130. * - RING_BASE_PADDR_LO
  3131. * Bits 31:0
  3132. * Value: lower 4 bytes of physical address of the host's rx ring
  3133. * - RING_BASE_PADDR_HI
  3134. * Bits 31:0
  3135. * Value: uppper 4 bytes of physical address of the host's rx ring
  3136. * for systems using 32-bit format for bus addresses:
  3137. * - IDX_SHADOW_REG_PADDR
  3138. * Bits 31:0
  3139. * Value: physical address of the host's FW_IDX shadow register
  3140. * - RING_BASE_PADDR
  3141. * Bits 31:0
  3142. * Value: physical address of the host's rx ring
  3143. * - RING_LEN
  3144. * Bits 15:0
  3145. * Value: number of elements in the rx ring
  3146. * - RING_BUF_SZ
  3147. * Bits 31:16
  3148. * Value: size of the buffers referenced by the rx ring, in byte units
  3149. * - ENABLED_FLAGS
  3150. * Bits 15:0
  3151. * Value: 1-bit flags to show whether different rx fields are enabled
  3152. * bit 0: 802.11 header enabled (1) or disabled (0)
  3153. * bit 1: MSDU payload enabled (1) or disabled (0)
  3154. * bit 2: PPDU start enabled (1) or disabled (0)
  3155. * bit 3: PPDU end enabled (1) or disabled (0)
  3156. * bit 4: MPDU start enabled (1) or disabled (0)
  3157. * bit 5: MPDU end enabled (1) or disabled (0)
  3158. * bit 6: MSDU start enabled (1) or disabled (0)
  3159. * bit 7: MSDU end enabled (1) or disabled (0)
  3160. * bit 8: rx attention enabled (1) or disabled (0)
  3161. * bit 9: frag info enabled (1) or disabled (0)
  3162. * bit 10: unicast rx enabled (1) or disabled (0)
  3163. * bit 11: multicast rx enabled (1) or disabled (0)
  3164. * bit 12: ctrl rx enabled (1) or disabled (0)
  3165. * bit 13: mgmt rx enabled (1) or disabled (0)
  3166. * bit 14: null rx enabled (1) or disabled (0)
  3167. * bit 15: phy data rx enabled (1) or disabled (0)
  3168. * - IDX_INIT_VAL
  3169. * Bits 31:16
  3170. * Purpose: Specify the initial value for the FW_IDX.
  3171. * Value: the number of buffers initially present in the host's rx ring
  3172. * - OFFSET_802_11_HDR
  3173. * Bits 15:0
  3174. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3175. * - OFFSET_MSDU_PAYLOAD
  3176. * Bits 31:16
  3177. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3178. * - OFFSET_PPDU_START
  3179. * Bits 15:0
  3180. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3181. * - OFFSET_PPDU_END
  3182. * Bits 31:16
  3183. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3184. * - OFFSET_MPDU_START
  3185. * Bits 15:0
  3186. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3187. * - OFFSET_MPDU_END
  3188. * Bits 31:16
  3189. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3190. * - OFFSET_MSDU_START
  3191. * Bits 15:0
  3192. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3193. * - OFFSET_MSDU_END
  3194. * Bits 31:16
  3195. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3196. * - OFFSET_RX_ATTN
  3197. * Bits 15:0
  3198. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3199. * - OFFSET_FRAG_INFO
  3200. * Bits 31:16
  3201. * Value: offset in QUAD-bytes of frag info table
  3202. */
  3203. /* header fields */
  3204. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3205. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3206. /* payload fields */
  3207. /* for systems using a 64-bit format for bus addresses */
  3208. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3209. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3210. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3211. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3212. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3213. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3214. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3215. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3216. /* for systems using a 32-bit format for bus addresses */
  3217. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3218. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3219. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3220. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3221. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3222. #define HTT_RX_RING_CFG_LEN_S 0
  3223. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3224. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3225. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3226. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3227. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3228. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3229. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3230. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3231. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3232. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3233. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3234. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3235. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3236. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3237. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3238. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3239. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3240. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3241. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3242. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3243. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3244. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3245. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3246. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3247. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3248. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3249. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3250. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3251. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3252. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3253. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3254. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3255. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3256. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3257. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3258. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3259. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3260. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3261. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3262. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3263. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3264. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3265. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3266. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3267. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3268. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3269. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3270. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3271. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3272. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3273. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3274. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3275. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3276. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3277. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3278. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3279. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3280. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3281. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3282. #if HTT_PADDR64
  3283. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3284. #else
  3285. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3286. #endif
  3287. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3288. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3289. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3290. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3291. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3292. do { \
  3293. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3294. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3295. } while (0)
  3296. /* degenerate case for 32-bit fields */
  3297. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3298. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3299. ((_var) = (_val))
  3300. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3301. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3302. ((_var) = (_val))
  3303. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3304. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3305. ((_var) = (_val))
  3306. /* degenerate case for 32-bit fields */
  3307. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3308. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3309. ((_var) = (_val))
  3310. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3311. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3312. ((_var) = (_val))
  3313. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3314. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3315. ((_var) = (_val))
  3316. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3317. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3318. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3319. do { \
  3320. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3321. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3322. } while (0)
  3323. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3324. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3325. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3326. do { \
  3327. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3328. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3329. } while (0)
  3330. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3331. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3332. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3333. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3334. do { \
  3335. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3336. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3337. } while (0)
  3338. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3339. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3340. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3341. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3342. do { \
  3343. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3344. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3345. } while (0)
  3346. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3347. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3348. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3349. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3350. do { \
  3351. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3352. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3353. } while (0)
  3354. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3355. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3356. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3357. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3358. do { \
  3359. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3360. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3361. } while (0)
  3362. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3363. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3364. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3365. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3366. do { \
  3367. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3368. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3369. } while (0)
  3370. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3371. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3372. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3373. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3374. do { \
  3375. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3376. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3377. } while (0)
  3378. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3379. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3380. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3381. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3382. do { \
  3383. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3384. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3385. } while (0)
  3386. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3387. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3388. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3389. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3390. do { \
  3391. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3392. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3393. } while (0)
  3394. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3395. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3396. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3397. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3398. do { \
  3399. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3400. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3401. } while (0)
  3402. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3403. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3404. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3405. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3406. do { \
  3407. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3408. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3409. } while (0)
  3410. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3411. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3412. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3413. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3414. do { \
  3415. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3416. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3417. } while (0)
  3418. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3419. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3420. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3421. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3422. do { \
  3423. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3424. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3425. } while (0)
  3426. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3427. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3428. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3429. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3430. do { \
  3431. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3432. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3433. } while (0)
  3434. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3435. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3436. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3437. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3438. do { \
  3439. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3440. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3441. } while (0)
  3442. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3443. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3444. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3445. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3446. do { \
  3447. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3448. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3449. } while (0)
  3450. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3451. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3452. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3453. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3454. do { \
  3455. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3456. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3457. } while (0)
  3458. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3459. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3460. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3461. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3462. do { \
  3463. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3464. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3465. } while (0)
  3466. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3467. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3468. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3469. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3470. do { \
  3471. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3472. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3473. } while (0)
  3474. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3475. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3476. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3477. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3478. do { \
  3479. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3480. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3481. } while (0)
  3482. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3483. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3484. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3485. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3486. do { \
  3487. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3488. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3489. } while (0)
  3490. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3491. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3492. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3493. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3494. do { \
  3495. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3496. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3497. } while (0)
  3498. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3499. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3500. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3501. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3502. do { \
  3503. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3504. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3505. } while (0)
  3506. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3507. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3508. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3509. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3510. do { \
  3511. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3512. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3513. } while (0)
  3514. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3515. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3516. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3517. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3518. do { \
  3519. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3520. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3521. } while (0)
  3522. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3523. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3524. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3525. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3526. do { \
  3527. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3528. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3529. } while (0)
  3530. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3531. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3532. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3533. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3534. do { \
  3535. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3536. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3537. } while (0)
  3538. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3539. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3540. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3541. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3542. do { \
  3543. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3544. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3545. } while (0)
  3546. /**
  3547. * @brief host -> target FW statistics retrieve
  3548. *
  3549. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3550. *
  3551. * @details
  3552. * The following field definitions describe the format of the HTT host
  3553. * to target FW stats retrieve message. The message specifies the type of
  3554. * stats host wants to retrieve.
  3555. *
  3556. * |31 24|23 16|15 8|7 0|
  3557. * |-----------------------------------------------------------|
  3558. * | stats types request bitmask | msg type |
  3559. * |-----------------------------------------------------------|
  3560. * | stats types reset bitmask | reserved |
  3561. * |-----------------------------------------------------------|
  3562. * | stats type | config value |
  3563. * |-----------------------------------------------------------|
  3564. * | cookie LSBs |
  3565. * |-----------------------------------------------------------|
  3566. * | cookie MSBs |
  3567. * |-----------------------------------------------------------|
  3568. * Header fields:
  3569. * - MSG_TYPE
  3570. * Bits 7:0
  3571. * Purpose: identifies this is a stats upload request message
  3572. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3573. * - UPLOAD_TYPES
  3574. * Bits 31:8
  3575. * Purpose: identifies which types of FW statistics to upload
  3576. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3577. * - RESET_TYPES
  3578. * Bits 31:8
  3579. * Purpose: identifies which types of FW statistics to reset
  3580. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3581. * - CFG_VAL
  3582. * Bits 23:0
  3583. * Purpose: give an opaque configuration value to the specified stats type
  3584. * Value: stats-type specific configuration value
  3585. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3586. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3587. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3588. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3589. * - CFG_STAT_TYPE
  3590. * Bits 31:24
  3591. * Purpose: specify which stats type (if any) the config value applies to
  3592. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3593. * a valid configuration specification
  3594. * - COOKIE_LSBS
  3595. * Bits 31:0
  3596. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3597. * message with its preceding host->target stats request message.
  3598. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3599. * - COOKIE_MSBS
  3600. * Bits 31:0
  3601. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3602. * message with its preceding host->target stats request message.
  3603. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3604. */
  3605. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3606. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3607. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3608. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3609. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3610. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3611. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3612. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3613. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3614. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3615. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3616. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3617. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3618. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3619. do { \
  3620. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3621. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3622. } while (0)
  3623. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3624. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3625. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3626. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3627. do { \
  3628. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3629. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3630. } while (0)
  3631. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3632. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3633. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3634. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3635. do { \
  3636. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3637. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3638. } while (0)
  3639. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3640. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3641. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3642. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3643. do { \
  3644. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3645. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3646. } while (0)
  3647. /**
  3648. * @brief host -> target HTT out-of-band sync request
  3649. *
  3650. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3651. *
  3652. * @details
  3653. * The HTT SYNC tells the target to suspend processing of subsequent
  3654. * HTT host-to-target messages until some other target agent locally
  3655. * informs the target HTT FW that the current sync counter is equal to
  3656. * or greater than (in a modulo sense) the sync counter specified in
  3657. * the SYNC message.
  3658. * This allows other host-target components to synchronize their operation
  3659. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3660. * security key has been downloaded to and activated by the target.
  3661. * In the absence of any explicit synchronization counter value
  3662. * specification, the target HTT FW will use zero as the default current
  3663. * sync value.
  3664. *
  3665. * |31 24|23 16|15 8|7 0|
  3666. * |-----------------------------------------------------------|
  3667. * | reserved | sync count | msg type |
  3668. * |-----------------------------------------------------------|
  3669. * Header fields:
  3670. * - MSG_TYPE
  3671. * Bits 7:0
  3672. * Purpose: identifies this as a sync message
  3673. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3674. * - SYNC_COUNT
  3675. * Bits 15:8
  3676. * Purpose: specifies what sync value the HTT FW will wait for from
  3677. * an out-of-band specification to resume its operation
  3678. * Value: in-band sync counter value to compare against the out-of-band
  3679. * counter spec.
  3680. * The HTT target FW will suspend its host->target message processing
  3681. * as long as
  3682. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3683. */
  3684. #define HTT_H2T_SYNC_MSG_SZ 4
  3685. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3686. #define HTT_H2T_SYNC_COUNT_S 8
  3687. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3688. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3689. HTT_H2T_SYNC_COUNT_S)
  3690. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3691. do { \
  3692. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3693. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3694. } while (0)
  3695. /**
  3696. * @brief host -> target HTT aggregation configuration
  3697. *
  3698. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3699. */
  3700. #define HTT_AGGR_CFG_MSG_SZ 4
  3701. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3702. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3703. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3704. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3705. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3706. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3707. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3708. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3709. do { \
  3710. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3711. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3712. } while (0)
  3713. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3714. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3715. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3716. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3717. do { \
  3718. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3719. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3720. } while (0)
  3721. /**
  3722. * @brief host -> target HTT configure max amsdu info per vdev
  3723. *
  3724. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3725. *
  3726. * @details
  3727. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3728. *
  3729. * |31 21|20 16|15 8|7 0|
  3730. * |-----------------------------------------------------------|
  3731. * | reserved | vdev id | max amsdu | msg type |
  3732. * |-----------------------------------------------------------|
  3733. * Header fields:
  3734. * - MSG_TYPE
  3735. * Bits 7:0
  3736. * Purpose: identifies this as a aggr cfg ex message
  3737. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3738. * - MAX_NUM_AMSDU_SUBFRM
  3739. * Bits 15:8
  3740. * Purpose: max MSDUs per A-MSDU
  3741. * - VDEV_ID
  3742. * Bits 20:16
  3743. * Purpose: ID of the vdev to which this limit is applied
  3744. */
  3745. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3746. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3747. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3748. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3749. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3750. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3751. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3752. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3753. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3754. do { \
  3755. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3756. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3757. } while (0)
  3758. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3759. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3760. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3761. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3762. do { \
  3763. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3764. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3765. } while (0)
  3766. /**
  3767. * @brief HTT WDI_IPA Config Message
  3768. *
  3769. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3770. *
  3771. * @details
  3772. * The HTT WDI_IPA config message is created/sent by host at driver
  3773. * init time. It contains information about data structures used on
  3774. * WDI_IPA TX and RX path.
  3775. * TX CE ring is used for pushing packet metadata from IPA uC
  3776. * to WLAN FW
  3777. * TX Completion ring is used for generating TX completions from
  3778. * WLAN FW to IPA uC
  3779. * RX Indication ring is used for indicating RX packets from FW
  3780. * to IPA uC
  3781. * RX Ring2 is used as either completion ring or as second
  3782. * indication ring. when Ring2 is used as completion ring, IPA uC
  3783. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3784. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3785. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3786. * indicated in RX Indication ring. Please see WDI_IPA specification
  3787. * for more details.
  3788. * |31 24|23 16|15 8|7 0|
  3789. * |----------------+----------------+----------------+----------------|
  3790. * | tx pkt pool size | Rsvd | msg_type |
  3791. * |-------------------------------------------------------------------|
  3792. * | tx comp ring base (bits 31:0) |
  3793. #if HTT_PADDR64
  3794. * | tx comp ring base (bits 63:32) |
  3795. #endif
  3796. * |-------------------------------------------------------------------|
  3797. * | tx comp ring size |
  3798. * |-------------------------------------------------------------------|
  3799. * | tx comp WR_IDX physical address (bits 31:0) |
  3800. #if HTT_PADDR64
  3801. * | tx comp WR_IDX physical address (bits 63:32) |
  3802. #endif
  3803. * |-------------------------------------------------------------------|
  3804. * | tx CE WR_IDX physical address (bits 31:0) |
  3805. #if HTT_PADDR64
  3806. * | tx CE WR_IDX physical address (bits 63:32) |
  3807. #endif
  3808. * |-------------------------------------------------------------------|
  3809. * | rx indication ring base (bits 31:0) |
  3810. #if HTT_PADDR64
  3811. * | rx indication ring base (bits 63:32) |
  3812. #endif
  3813. * |-------------------------------------------------------------------|
  3814. * | rx indication ring size |
  3815. * |-------------------------------------------------------------------|
  3816. * | rx ind RD_IDX physical address (bits 31:0) |
  3817. #if HTT_PADDR64
  3818. * | rx ind RD_IDX physical address (bits 63:32) |
  3819. #endif
  3820. * |-------------------------------------------------------------------|
  3821. * | rx ind WR_IDX physical address (bits 31:0) |
  3822. #if HTT_PADDR64
  3823. * | rx ind WR_IDX physical address (bits 63:32) |
  3824. #endif
  3825. * |-------------------------------------------------------------------|
  3826. * |-------------------------------------------------------------------|
  3827. * | rx ring2 base (bits 31:0) |
  3828. #if HTT_PADDR64
  3829. * | rx ring2 base (bits 63:32) |
  3830. #endif
  3831. * |-------------------------------------------------------------------|
  3832. * | rx ring2 size |
  3833. * |-------------------------------------------------------------------|
  3834. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3835. #if HTT_PADDR64
  3836. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3837. #endif
  3838. * |-------------------------------------------------------------------|
  3839. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3840. #if HTT_PADDR64
  3841. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3842. #endif
  3843. * |-------------------------------------------------------------------|
  3844. *
  3845. * Header fields:
  3846. * Header fields:
  3847. * - MSG_TYPE
  3848. * Bits 7:0
  3849. * Purpose: Identifies this as WDI_IPA config message
  3850. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3851. * - TX_PKT_POOL_SIZE
  3852. * Bits 15:0
  3853. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3854. * WDI_IPA TX path
  3855. * For systems using 32-bit format for bus addresses:
  3856. * - TX_COMP_RING_BASE_ADDR
  3857. * Bits 31:0
  3858. * Purpose: TX Completion Ring base address in DDR
  3859. * - TX_COMP_RING_SIZE
  3860. * Bits 31:0
  3861. * Purpose: TX Completion Ring size (must be power of 2)
  3862. * - TX_COMP_WR_IDX_ADDR
  3863. * Bits 31:0
  3864. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3865. * updates the Write Index for WDI_IPA TX completion ring
  3866. * - TX_CE_WR_IDX_ADDR
  3867. * Bits 31:0
  3868. * Purpose: DDR address where IPA uC
  3869. * updates the WR Index for TX CE ring
  3870. * (needed for fusion platforms)
  3871. * - RX_IND_RING_BASE_ADDR
  3872. * Bits 31:0
  3873. * Purpose: RX Indication Ring base address in DDR
  3874. * - RX_IND_RING_SIZE
  3875. * Bits 31:0
  3876. * Purpose: RX Indication Ring size
  3877. * - RX_IND_RD_IDX_ADDR
  3878. * Bits 31:0
  3879. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3880. * RX indication ring
  3881. * - RX_IND_WR_IDX_ADDR
  3882. * Bits 31:0
  3883. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3884. * updates the Write Index for WDI_IPA RX indication ring
  3885. * - RX_RING2_BASE_ADDR
  3886. * Bits 31:0
  3887. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3888. * - RX_RING2_SIZE
  3889. * Bits 31:0
  3890. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3891. * - RX_RING2_RD_IDX_ADDR
  3892. * Bits 31:0
  3893. * Purpose: If Second RX ring is Indication ring, DDR address where
  3894. * IPA uC updates the Read Index for Ring2.
  3895. * If Second RX ring is completion ring, this is NOT used
  3896. * - RX_RING2_WR_IDX_ADDR
  3897. * Bits 31:0
  3898. * Purpose: If Second RX ring is Indication ring, DDR address where
  3899. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3900. * If second RX ring is completion ring, DDR address where
  3901. * IPA uC updates the Write Index for Ring 2.
  3902. * For systems using 64-bit format for bus addresses:
  3903. * - TX_COMP_RING_BASE_ADDR_LO
  3904. * Bits 31:0
  3905. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3906. * - TX_COMP_RING_BASE_ADDR_HI
  3907. * Bits 31:0
  3908. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3909. * - TX_COMP_RING_SIZE
  3910. * Bits 31:0
  3911. * Purpose: TX Completion Ring size (must be power of 2)
  3912. * - TX_COMP_WR_IDX_ADDR_LO
  3913. * Bits 31:0
  3914. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3915. * Lower 4 bytes of DDR address where WIFI FW
  3916. * updates the Write Index for WDI_IPA TX completion ring
  3917. * - TX_COMP_WR_IDX_ADDR_HI
  3918. * Bits 31:0
  3919. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3920. * Higher 4 bytes of DDR address where WIFI FW
  3921. * updates the Write Index for WDI_IPA TX completion ring
  3922. * - TX_CE_WR_IDX_ADDR_LO
  3923. * Bits 31:0
  3924. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3925. * updates the WR Index for TX CE ring
  3926. * (needed for fusion platforms)
  3927. * - TX_CE_WR_IDX_ADDR_HI
  3928. * Bits 31:0
  3929. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3930. * updates the WR Index for TX CE ring
  3931. * (needed for fusion platforms)
  3932. * - RX_IND_RING_BASE_ADDR_LO
  3933. * Bits 31:0
  3934. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3935. * - RX_IND_RING_BASE_ADDR_HI
  3936. * Bits 31:0
  3937. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3938. * - RX_IND_RING_SIZE
  3939. * Bits 31:0
  3940. * Purpose: RX Indication Ring size
  3941. * - RX_IND_RD_IDX_ADDR_LO
  3942. * Bits 31:0
  3943. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3944. * for WDI_IPA RX indication ring
  3945. * - RX_IND_RD_IDX_ADDR_HI
  3946. * Bits 31:0
  3947. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3948. * for WDI_IPA RX indication ring
  3949. * - RX_IND_WR_IDX_ADDR_LO
  3950. * Bits 31:0
  3951. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3952. * Lower 4 bytes of DDR address where WIFI FW
  3953. * updates the Write Index for WDI_IPA RX indication ring
  3954. * - RX_IND_WR_IDX_ADDR_HI
  3955. * Bits 31:0
  3956. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3957. * Higher 4 bytes of DDR address where WIFI FW
  3958. * updates the Write Index for WDI_IPA RX indication ring
  3959. * - RX_RING2_BASE_ADDR_LO
  3960. * Bits 31:0
  3961. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3962. * - RX_RING2_BASE_ADDR_HI
  3963. * Bits 31:0
  3964. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3965. * - RX_RING2_SIZE
  3966. * Bits 31:0
  3967. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3968. * - RX_RING2_RD_IDX_ADDR_LO
  3969. * Bits 31:0
  3970. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3971. * DDR address where IPA uC updates the Read Index for Ring2.
  3972. * If Second RX ring is completion ring, this is NOT used
  3973. * - RX_RING2_RD_IDX_ADDR_HI
  3974. * Bits 31:0
  3975. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3976. * DDR address where IPA uC updates the Read Index for Ring2.
  3977. * If Second RX ring is completion ring, this is NOT used
  3978. * - RX_RING2_WR_IDX_ADDR_LO
  3979. * Bits 31:0
  3980. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3981. * DDR address where WIFI FW updates the Write Index
  3982. * for WDI_IPA RX ring2
  3983. * If second RX ring is completion ring, lower 4 bytes of
  3984. * DDR address where IPA uC updates the Write Index for Ring 2.
  3985. * - RX_RING2_WR_IDX_ADDR_HI
  3986. * Bits 31:0
  3987. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3988. * DDR address where WIFI FW updates the Write Index
  3989. * for WDI_IPA RX ring2
  3990. * If second RX ring is completion ring, higher 4 bytes of
  3991. * DDR address where IPA uC updates the Write Index for Ring 2.
  3992. */
  3993. #if HTT_PADDR64
  3994. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3995. #else
  3996. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3997. #endif
  3998. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3999. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4000. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4001. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4002. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4003. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4004. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4005. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4006. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4007. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4008. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4009. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4010. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4011. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4012. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4013. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4014. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4015. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4016. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4017. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4018. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4019. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4020. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4021. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4022. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4023. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4024. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4025. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4026. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4027. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4028. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4029. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4030. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4031. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4032. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4033. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4034. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4035. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4036. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4037. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4038. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4039. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4040. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4041. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4042. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4043. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4044. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4045. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4046. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4047. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4048. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4049. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4050. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4051. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4052. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4053. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4054. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4055. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4056. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4057. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4058. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4059. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4060. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4061. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4062. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4063. do { \
  4064. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4065. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4066. } while (0)
  4067. /* for systems using 32-bit format for bus addr */
  4068. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4069. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4070. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4071. do { \
  4072. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4073. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4074. } while (0)
  4075. /* for systems using 64-bit format for bus addr */
  4076. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4077. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4078. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4079. do { \
  4080. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4081. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4082. } while (0)
  4083. /* for systems using 64-bit format for bus addr */
  4084. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4085. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4086. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4087. do { \
  4088. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4089. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4090. } while (0)
  4091. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4092. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4093. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4094. do { \
  4095. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4096. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4097. } while (0)
  4098. /* for systems using 32-bit format for bus addr */
  4099. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4100. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4101. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4102. do { \
  4103. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4104. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4105. } while (0)
  4106. /* for systems using 64-bit format for bus addr */
  4107. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4108. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4109. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4110. do { \
  4111. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4112. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4113. } while (0)
  4114. /* for systems using 64-bit format for bus addr */
  4115. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4116. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4117. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4118. do { \
  4119. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4120. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4121. } while (0)
  4122. /* for systems using 32-bit format for bus addr */
  4123. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4124. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4125. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4126. do { \
  4127. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4128. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4129. } while (0)
  4130. /* for systems using 64-bit format for bus addr */
  4131. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4132. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4133. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4134. do { \
  4135. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4136. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4137. } while (0)
  4138. /* for systems using 64-bit format for bus addr */
  4139. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4140. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4141. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4142. do { \
  4143. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4144. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4145. } while (0)
  4146. /* for systems using 32-bit format for bus addr */
  4147. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4148. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4149. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4150. do { \
  4151. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4152. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4153. } while (0)
  4154. /* for systems using 64-bit format for bus addr */
  4155. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4156. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4157. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4158. do { \
  4159. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4160. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4161. } while (0)
  4162. /* for systems using 64-bit format for bus addr */
  4163. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4164. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4165. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4166. do { \
  4167. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4168. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4169. } while (0)
  4170. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4171. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4172. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4173. do { \
  4174. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4175. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4176. } while (0)
  4177. /* for systems using 32-bit format for bus addr */
  4178. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4179. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4180. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4181. do { \
  4182. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4183. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4184. } while (0)
  4185. /* for systems using 64-bit format for bus addr */
  4186. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4187. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4188. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4189. do { \
  4190. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4191. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4192. } while (0)
  4193. /* for systems using 64-bit format for bus addr */
  4194. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4195. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4196. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4197. do { \
  4198. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4199. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4200. } while (0)
  4201. /* for systems using 32-bit format for bus addr */
  4202. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4203. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4204. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4205. do { \
  4206. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4207. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4208. } while (0)
  4209. /* for systems using 64-bit format for bus addr */
  4210. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4211. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4212. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4213. do { \
  4214. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4215. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4216. } while (0)
  4217. /* for systems using 64-bit format for bus addr */
  4218. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4219. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4220. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4221. do { \
  4222. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4223. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4224. } while (0)
  4225. /* for systems using 32-bit format for bus addr */
  4226. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4227. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4228. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4229. do { \
  4230. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4231. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4232. } while (0)
  4233. /* for systems using 64-bit format for bus addr */
  4234. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4235. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4236. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4237. do { \
  4238. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4239. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4240. } while (0)
  4241. /* for systems using 64-bit format for bus addr */
  4242. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4243. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4244. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4245. do { \
  4246. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4247. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4248. } while (0)
  4249. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4250. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4251. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4252. do { \
  4253. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4254. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4255. } while (0)
  4256. /* for systems using 32-bit format for bus addr */
  4257. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4258. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4259. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4260. do { \
  4261. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4262. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4263. } while (0)
  4264. /* for systems using 64-bit format for bus addr */
  4265. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4266. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4267. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4268. do { \
  4269. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4270. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4271. } while (0)
  4272. /* for systems using 64-bit format for bus addr */
  4273. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4274. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4275. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4276. do { \
  4277. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4278. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4279. } while (0)
  4280. /* for systems using 32-bit format for bus addr */
  4281. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4282. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4283. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4284. do { \
  4285. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4286. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4287. } while (0)
  4288. /* for systems using 64-bit format for bus addr */
  4289. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4290. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4291. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4292. do { \
  4293. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4294. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4295. } while (0)
  4296. /* for systems using 64-bit format for bus addr */
  4297. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4298. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4299. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4300. do { \
  4301. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4302. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4303. } while (0)
  4304. /*
  4305. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4306. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4307. * addresses are stored in a XXX-bit field.
  4308. * This macro is used to define both htt_wdi_ipa_config32_t and
  4309. * htt_wdi_ipa_config64_t structs.
  4310. */
  4311. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4312. _paddr__tx_comp_ring_base_addr_, \
  4313. _paddr__tx_comp_wr_idx_addr_, \
  4314. _paddr__tx_ce_wr_idx_addr_, \
  4315. _paddr__rx_ind_ring_base_addr_, \
  4316. _paddr__rx_ind_rd_idx_addr_, \
  4317. _paddr__rx_ind_wr_idx_addr_, \
  4318. _paddr__rx_ring2_base_addr_,\
  4319. _paddr__rx_ring2_rd_idx_addr_,\
  4320. _paddr__rx_ring2_wr_idx_addr_) \
  4321. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4322. { \
  4323. /* DWORD 0: flags and meta-data */ \
  4324. A_UINT32 \
  4325. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4326. reserved: 8, \
  4327. tx_pkt_pool_size: 16;\
  4328. /* DWORD 1 */\
  4329. _paddr__tx_comp_ring_base_addr_;\
  4330. /* DWORD 2 (or 3)*/\
  4331. A_UINT32 tx_comp_ring_size;\
  4332. /* DWORD 3 (or 4)*/\
  4333. _paddr__tx_comp_wr_idx_addr_;\
  4334. /* DWORD 4 (or 6)*/\
  4335. _paddr__tx_ce_wr_idx_addr_;\
  4336. /* DWORD 5 (or 8)*/\
  4337. _paddr__rx_ind_ring_base_addr_;\
  4338. /* DWORD 6 (or 10)*/\
  4339. A_UINT32 rx_ind_ring_size;\
  4340. /* DWORD 7 (or 11)*/\
  4341. _paddr__rx_ind_rd_idx_addr_;\
  4342. /* DWORD 8 (or 13)*/\
  4343. _paddr__rx_ind_wr_idx_addr_;\
  4344. /* DWORD 9 (or 15)*/\
  4345. _paddr__rx_ring2_base_addr_;\
  4346. /* DWORD 10 (or 17) */\
  4347. A_UINT32 rx_ring2_size;\
  4348. /* DWORD 11 (or 18) */\
  4349. _paddr__rx_ring2_rd_idx_addr_;\
  4350. /* DWORD 12 (or 20) */\
  4351. _paddr__rx_ring2_wr_idx_addr_;\
  4352. } POSTPACK
  4353. /* define a htt_wdi_ipa_config32_t type */
  4354. 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));
  4355. /* define a htt_wdi_ipa_config64_t type */
  4356. 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));
  4357. #if HTT_PADDR64
  4358. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4359. #else
  4360. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4361. #endif
  4362. enum htt_wdi_ipa_op_code {
  4363. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4364. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4365. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4366. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4367. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4368. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4369. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4370. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4371. /* keep this last */
  4372. HTT_WDI_IPA_OPCODE_MAX
  4373. };
  4374. /**
  4375. * @brief HTT WDI_IPA Operation Request Message
  4376. *
  4377. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4378. *
  4379. * @details
  4380. * HTT WDI_IPA Operation Request message is sent by host
  4381. * to either suspend or resume WDI_IPA TX or RX path.
  4382. * |31 24|23 16|15 8|7 0|
  4383. * |----------------+----------------+----------------+----------------|
  4384. * | op_code | Rsvd | msg_type |
  4385. * |-------------------------------------------------------------------|
  4386. *
  4387. * Header fields:
  4388. * - MSG_TYPE
  4389. * Bits 7:0
  4390. * Purpose: Identifies this as WDI_IPA Operation Request message
  4391. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4392. * - OP_CODE
  4393. * Bits 31:16
  4394. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4395. * value: = enum htt_wdi_ipa_op_code
  4396. */
  4397. PREPACK struct htt_wdi_ipa_op_request_t
  4398. {
  4399. /* DWORD 0: flags and meta-data */
  4400. A_UINT32
  4401. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4402. reserved: 8,
  4403. op_code: 16;
  4404. } POSTPACK;
  4405. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4406. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4407. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4408. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4409. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4410. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4411. do { \
  4412. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4413. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4414. } while (0)
  4415. /*
  4416. * @brief host -> target HTT_MSI_SETUP message
  4417. *
  4418. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4419. *
  4420. * @details
  4421. * After target is booted up, host can send MSI setup message so that
  4422. * target sets up HW registers based on setup message.
  4423. *
  4424. * The message would appear as follows:
  4425. * |31 24|23 16|15|14 8|7 0|
  4426. * |---------------+-----------------+-----------------+-----------------|
  4427. * | reserved | msi_type | pdev_id | msg_type |
  4428. * |---------------------------------------------------------------------|
  4429. * | msi_addr_lo |
  4430. * |---------------------------------------------------------------------|
  4431. * | msi_addr_hi |
  4432. * |---------------------------------------------------------------------|
  4433. * | msi_data |
  4434. * |---------------------------------------------------------------------|
  4435. *
  4436. * The message is interpreted as follows:
  4437. * dword0 - b'0:7 - msg_type: This will be set to
  4438. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4439. * b'8:15 - pdev_id:
  4440. * 0 (for rings at SOC/UMAC level),
  4441. * 1/2/3 mac id (for rings at LMAC level)
  4442. * b'16:23 - msi_type: identify which msi registers need to be setup
  4443. * more details can be got from enum htt_msi_setup_type
  4444. * b'24:31 - reserved
  4445. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4446. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4447. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4448. */
  4449. PREPACK struct htt_msi_setup_t {
  4450. A_UINT32 msg_type: 8,
  4451. pdev_id: 8,
  4452. msi_type: 8,
  4453. reserved: 8;
  4454. A_UINT32 msi_addr_lo;
  4455. A_UINT32 msi_addr_hi;
  4456. A_UINT32 msi_data;
  4457. } POSTPACK;
  4458. enum htt_msi_setup_type {
  4459. HTT_PPDU_END_MSI_SETUP_TYPE,
  4460. /* Insert new types here*/
  4461. };
  4462. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4463. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4464. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4465. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4466. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4467. HTT_MSI_SETUP_PDEV_ID_S)
  4468. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4469. do { \
  4470. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4471. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4472. } while (0)
  4473. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4474. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4475. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4476. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4477. HTT_MSI_SETUP_MSI_TYPE_S)
  4478. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4479. do { \
  4480. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4481. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4482. } while (0)
  4483. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4484. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4485. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4486. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4487. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4488. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4489. do { \
  4490. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4491. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4492. } while (0)
  4493. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4494. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4495. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4496. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4497. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4498. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4499. do { \
  4500. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4501. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4502. } while (0)
  4503. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4504. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4505. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4506. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4507. HTT_MSI_SETUP_MSI_DATA_S)
  4508. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4509. do { \
  4510. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4511. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4512. } while (0)
  4513. /*
  4514. * @brief host -> target HTT_SRING_SETUP message
  4515. *
  4516. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4517. *
  4518. * @details
  4519. * After target is booted up, Host can send SRING setup message for
  4520. * each host facing LMAC SRING. Target setups up HW registers based
  4521. * on setup message and confirms back to Host if response_required is set.
  4522. * Host should wait for confirmation message before sending new SRING
  4523. * setup message
  4524. *
  4525. * The message would appear as follows:
  4526. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4527. * |--------------- +-----------------+-----------------+-----------------|
  4528. * | ring_type | ring_id | pdev_id | msg_type |
  4529. * |----------------------------------------------------------------------|
  4530. * | ring_base_addr_lo |
  4531. * |----------------------------------------------------------------------|
  4532. * | ring_base_addr_hi |
  4533. * |----------------------------------------------------------------------|
  4534. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4535. * |----------------------------------------------------------------------|
  4536. * | ring_head_offset32_remote_addr_lo |
  4537. * |----------------------------------------------------------------------|
  4538. * | ring_head_offset32_remote_addr_hi |
  4539. * |----------------------------------------------------------------------|
  4540. * | ring_tail_offset32_remote_addr_lo |
  4541. * |----------------------------------------------------------------------|
  4542. * | ring_tail_offset32_remote_addr_hi |
  4543. * |----------------------------------------------------------------------|
  4544. * | ring_msi_addr_lo |
  4545. * |----------------------------------------------------------------------|
  4546. * | ring_msi_addr_hi |
  4547. * |----------------------------------------------------------------------|
  4548. * | ring_msi_data |
  4549. * |----------------------------------------------------------------------|
  4550. * | intr_timer_th |IM| intr_batch_counter_th |
  4551. * |----------------------------------------------------------------------|
  4552. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4553. * |----------------------------------------------------------------------|
  4554. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4555. * |----------------------------------------------------------------------|
  4556. * Where
  4557. * IM = sw_intr_mode
  4558. * RR = response_required
  4559. * PTCF = prefetch_timer_cfg
  4560. * IP = IPA drop flag
  4561. *
  4562. * The message is interpreted as follows:
  4563. * dword0 - b'0:7 - msg_type: This will be set to
  4564. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4565. * b'8:15 - pdev_id:
  4566. * 0 (for rings at SOC/UMAC level),
  4567. * 1/2/3 mac id (for rings at LMAC level)
  4568. * b'16:23 - ring_id: identify which ring is to setup,
  4569. * more details can be got from enum htt_srng_ring_id
  4570. * b'24:31 - ring_type: identify type of host rings,
  4571. * more details can be got from enum htt_srng_ring_type
  4572. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4573. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4574. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4575. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4576. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4577. * SW_TO_HW_RING.
  4578. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4579. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4580. * Lower 32 bits of memory address of the remote variable
  4581. * storing the 4-byte word offset that identifies the head
  4582. * element within the ring.
  4583. * (The head offset variable has type A_UINT32.)
  4584. * Valid for HW_TO_SW and SW_TO_SW rings.
  4585. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4586. * Upper 32 bits of memory address of the remote variable
  4587. * storing the 4-byte word offset that identifies the head
  4588. * element within the ring.
  4589. * (The head offset variable has type A_UINT32.)
  4590. * Valid for HW_TO_SW and SW_TO_SW rings.
  4591. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4592. * Lower 32 bits of memory address of the remote variable
  4593. * storing the 4-byte word offset that identifies the tail
  4594. * element within the ring.
  4595. * (The tail offset variable has type A_UINT32.)
  4596. * Valid for HW_TO_SW and SW_TO_SW rings.
  4597. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4598. * Upper 32 bits of memory address of the remote variable
  4599. * storing the 4-byte word offset that identifies the tail
  4600. * element within the ring.
  4601. * (The tail offset variable has type A_UINT32.)
  4602. * Valid for HW_TO_SW and SW_TO_SW rings.
  4603. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4604. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4605. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4606. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4607. * dword10 - b'0:31 - ring_msi_data: MSI data
  4608. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4609. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4610. * dword11 - b'0:14 - intr_batch_counter_th:
  4611. * batch counter threshold is in units of 4-byte words.
  4612. * HW internally maintains and increments batch count.
  4613. * (see SRING spec for detail description).
  4614. * When batch count reaches threshold value, an interrupt
  4615. * is generated by HW.
  4616. * b'15 - sw_intr_mode:
  4617. * This configuration shall be static.
  4618. * Only programmed at power up.
  4619. * 0: generate pulse style sw interrupts
  4620. * 1: generate level style sw interrupts
  4621. * b'16:31 - intr_timer_th:
  4622. * The timer init value when timer is idle or is
  4623. * initialized to start downcounting.
  4624. * In 8us units (to cover a range of 0 to 524 ms)
  4625. * dword12 - b'0:15 - intr_low_threshold:
  4626. * Used only by Consumer ring to generate ring_sw_int_p.
  4627. * Ring entries low threshold water mark, that is used
  4628. * in combination with the interrupt timer as well as
  4629. * the the clearing of the level interrupt.
  4630. * b'16:18 - prefetch_timer_cfg:
  4631. * Used only by Consumer ring to set timer mode to
  4632. * support Application prefetch handling.
  4633. * The external tail offset/pointer will be updated
  4634. * at following intervals:
  4635. * 3'b000: (Prefetch feature disabled; used only for debug)
  4636. * 3'b001: 1 usec
  4637. * 3'b010: 4 usec
  4638. * 3'b011: 8 usec (default)
  4639. * 3'b100: 16 usec
  4640. * Others: Reserverd
  4641. * b'19 - response_required:
  4642. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4643. * b'20 - ipa_drop_flag:
  4644. Indicates that host will config ipa drop threshold percentage
  4645. * b'21:31 - reserved: reserved for future use
  4646. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4647. * b'8:15 - ipa drop high threshold percentage:
  4648. * b'16:31 - Reserved
  4649. */
  4650. PREPACK struct htt_sring_setup_t {
  4651. A_UINT32 msg_type: 8,
  4652. pdev_id: 8,
  4653. ring_id: 8,
  4654. ring_type: 8;
  4655. A_UINT32 ring_base_addr_lo;
  4656. A_UINT32 ring_base_addr_hi;
  4657. A_UINT32 ring_size: 16,
  4658. ring_entry_size: 8,
  4659. ring_misc_cfg_flag: 8;
  4660. A_UINT32 ring_head_offset32_remote_addr_lo;
  4661. A_UINT32 ring_head_offset32_remote_addr_hi;
  4662. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4663. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4664. A_UINT32 ring_msi_addr_lo;
  4665. A_UINT32 ring_msi_addr_hi;
  4666. A_UINT32 ring_msi_data;
  4667. A_UINT32 intr_batch_counter_th: 15,
  4668. sw_intr_mode: 1,
  4669. intr_timer_th: 16;
  4670. A_UINT32 intr_low_threshold: 16,
  4671. prefetch_timer_cfg: 3,
  4672. response_required: 1,
  4673. ipa_drop_flag: 1,
  4674. reserved1: 11;
  4675. A_UINT32 ipa_drop_low_threshold: 8,
  4676. ipa_drop_high_threshold: 8,
  4677. reserved: 16;
  4678. } POSTPACK;
  4679. enum htt_srng_ring_type {
  4680. HTT_HW_TO_SW_RING = 0,
  4681. HTT_SW_TO_HW_RING,
  4682. HTT_SW_TO_SW_RING,
  4683. /* Insert new ring types above this line */
  4684. };
  4685. enum htt_srng_ring_id {
  4686. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4687. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4688. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4689. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4690. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4691. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4692. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4693. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4694. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4695. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4696. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4697. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4698. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4699. /* Add Other SRING which can't be directly configured by host software above this line */
  4700. };
  4701. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4702. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4703. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4704. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4705. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4706. HTT_SRING_SETUP_PDEV_ID_S)
  4707. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4708. do { \
  4709. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4710. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4711. } while (0)
  4712. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4713. #define HTT_SRING_SETUP_RING_ID_S 16
  4714. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4715. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4716. HTT_SRING_SETUP_RING_ID_S)
  4717. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4718. do { \
  4719. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4720. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4721. } while (0)
  4722. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4723. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4724. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4725. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4726. HTT_SRING_SETUP_RING_TYPE_S)
  4727. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4728. do { \
  4729. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4730. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4731. } while (0)
  4732. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4733. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4734. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4735. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4736. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4737. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4738. do { \
  4739. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4740. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4741. } while (0)
  4742. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4743. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4744. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4745. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4746. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4747. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4748. do { \
  4749. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4750. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4751. } while (0)
  4752. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4753. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4754. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4755. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4756. HTT_SRING_SETUP_RING_SIZE_S)
  4757. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4758. do { \
  4759. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4760. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4761. } while (0)
  4762. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4763. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4764. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4765. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4766. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4767. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4768. do { \
  4769. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4770. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4771. } while (0)
  4772. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4773. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4774. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4775. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4776. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4777. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4778. do { \
  4779. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4780. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4781. } while (0)
  4782. /* This control bit is applicable to only Producer, which updates Ring ID field
  4783. * of each descriptor before pushing into the ring.
  4784. * 0: updates ring_id(default)
  4785. * 1: ring_id updating disabled */
  4786. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4787. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4788. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4789. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4790. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4791. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4792. do { \
  4793. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4794. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4795. } while (0)
  4796. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4797. * of each descriptor before pushing into the ring.
  4798. * 0: updates Loopcnt(default)
  4799. * 1: Loopcnt updating disabled */
  4800. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4801. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4802. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4803. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4804. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4805. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4806. do { \
  4807. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4808. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4809. } while (0)
  4810. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4811. * into security_id port of GXI/AXI. */
  4812. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4813. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4814. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4815. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4816. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4817. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4818. do { \
  4819. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4820. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4821. } while (0)
  4822. /* During MSI write operation, SRNG drives value of this register bit into
  4823. * swap bit of GXI/AXI. */
  4824. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4825. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4826. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4827. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4828. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4829. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4830. do { \
  4831. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4832. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4833. } while (0)
  4834. /* During Pointer write operation, SRNG drives value of this register bit into
  4835. * swap bit of GXI/AXI. */
  4836. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4837. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4838. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4839. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4840. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4841. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4842. do { \
  4843. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4844. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4845. } while (0)
  4846. /* During any data or TLV write operation, SRNG drives value of this register
  4847. * bit into swap bit of GXI/AXI. */
  4848. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4849. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4850. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4851. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4852. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4853. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4854. do { \
  4855. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4856. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4857. } while (0)
  4858. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4859. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4860. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4861. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4862. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4863. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4864. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4865. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4866. do { \
  4867. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4868. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4869. } while (0)
  4870. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4871. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4872. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4873. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4874. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4875. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4876. do { \
  4877. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4878. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4879. } while (0)
  4880. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4881. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4882. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4883. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4884. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4885. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4886. do { \
  4887. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4888. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4889. } while (0)
  4890. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4891. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4892. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4893. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4894. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4895. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4896. do { \
  4897. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4898. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4899. } while (0)
  4900. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4901. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4902. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4903. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4904. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4905. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4906. do { \
  4907. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4908. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4909. } while (0)
  4910. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4911. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4912. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4913. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4914. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4915. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4916. do { \
  4917. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4918. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4919. } while (0)
  4920. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4921. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4922. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4923. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4924. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4925. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4926. do { \
  4927. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4928. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4929. } while (0)
  4930. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4931. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4932. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4933. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4934. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4935. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4936. do { \
  4937. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4938. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4939. } while (0)
  4940. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4941. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4942. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4943. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4944. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4945. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4946. do { \
  4947. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4948. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4949. } while (0)
  4950. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4951. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4952. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4953. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4954. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4955. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4956. do { \
  4957. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4958. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4959. } while (0)
  4960. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4961. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4962. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4963. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4964. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4965. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4966. do { \
  4967. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4968. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4969. } while (0)
  4970. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4971. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4972. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4973. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4974. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4975. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4976. do { \
  4977. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4978. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4979. } while (0)
  4980. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4981. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4982. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4983. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4984. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4985. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4986. do { \
  4987. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4988. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4989. } while (0)
  4990. /**
  4991. * @brief host -> target RX ring selection config message
  4992. *
  4993. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4994. *
  4995. * @details
  4996. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4997. * configure RXDMA rings.
  4998. * The configuration is per ring based and includes both packet subtypes
  4999. * and PPDU/MPDU TLVs.
  5000. *
  5001. * The message would appear as follows:
  5002. *
  5003. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  5004. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  5005. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5006. * |-------------------------------------------------------------------|
  5007. * | rsvd2 | ring_buffer_size |
  5008. * |-------------------------------------------------------------------|
  5009. * | packet_type_enable_flags_0 |
  5010. * |-------------------------------------------------------------------|
  5011. * | packet_type_enable_flags_1 |
  5012. * |-------------------------------------------------------------------|
  5013. * | packet_type_enable_flags_2 |
  5014. * |-------------------------------------------------------------------|
  5015. * | packet_type_enable_flags_3 |
  5016. * |-------------------------------------------------------------------|
  5017. * | tlv_filter_in_flags |
  5018. * |-------------------------------------------------------------------|
  5019. * | rx_header_offset | rx_packet_offset |
  5020. * |-------------------------------------------------------------------|
  5021. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5022. * |-------------------------------------------------------------------|
  5023. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5024. * |-------------------------------------------------------------------|
  5025. * | rsvd3 | rx_attention_offset |
  5026. * |-------------------------------------------------------------------|
  5027. * | rsvd4 | mo| fp| rx_drop_threshold |
  5028. * | |ndp|ndp| |
  5029. * |-------------------------------------------------------------------|
  5030. * Where:
  5031. * PS = pkt_swap
  5032. * SS = status_swap
  5033. * OV = rx_offsets_valid
  5034. * DT = drop_thresh_valid
  5035. * The message is interpreted as follows:
  5036. * dword0 - b'0:7 - msg_type: This will be set to
  5037. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5038. * b'8:15 - pdev_id:
  5039. * 0 (for rings at SOC/UMAC level),
  5040. * 1/2/3 mac id (for rings at LMAC level)
  5041. * b'16:23 - ring_id : Identify the ring to configure.
  5042. * More details can be got from enum htt_srng_ring_id
  5043. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5044. * BUF_RING_CFG_0 defs within HW .h files,
  5045. * e.g. wmac_top_reg_seq_hwioreg.h
  5046. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5047. * BUF_RING_CFG_0 defs within HW .h files,
  5048. * e.g. wmac_top_reg_seq_hwioreg.h
  5049. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5050. * configuration fields are valid
  5051. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5052. * rx_drop_threshold field is valid
  5053. * b'28 - rx_mon_global_en: Enable/Disable global register
  5054. 8 configuration in Rx monitor module.
  5055. * b'29:31 - rsvd1: reserved for future use
  5056. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5057. * in byte units.
  5058. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5059. * b'16:18 - config_length_mgmt (MGMT):
  5060. * Represents the length of mpdu bytes for mgmt pkt.
  5061. * valid values:
  5062. * 001 - 64bytes
  5063. * 010 - 128bytes
  5064. * 100 - 256bytes
  5065. * 111 - Full mpdu bytes
  5066. * b'19:21 - config_length_ctrl (CTRL):
  5067. * Represents the length of mpdu bytes for ctrl pkt.
  5068. * valid values:
  5069. * 001 - 64bytes
  5070. * 010 - 128bytes
  5071. * 100 - 256bytes
  5072. * 111 - Full mpdu bytes
  5073. * b'22:24 - config_length_data (DATA):
  5074. * Represents the length of mpdu bytes for data pkt.
  5075. * valid values:
  5076. * 001 - 64bytes
  5077. * 010 - 128bytes
  5078. * 100 - 256bytes
  5079. * 111 - Full mpdu bytes
  5080. * b'25:31 - rsvd2: Reserved for future use
  5081. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5082. * Enable MGMT packet from 0b0000 to 0b1001
  5083. * bits from low to high: FP, MD, MO - 3 bits
  5084. * FP: Filter_Pass
  5085. * MD: Monitor_Direct
  5086. * MO: Monitor_Other
  5087. * 10 mgmt subtypes * 3 bits -> 30 bits
  5088. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5089. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5090. * Enable MGMT packet from 0b1010 to 0b1111
  5091. * bits from low to high: FP, MD, MO - 3 bits
  5092. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5093. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5094. * Enable CTRL packet from 0b0000 to 0b1001
  5095. * bits from low to high: FP, MD, MO - 3 bits
  5096. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5097. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5098. * Enable CTRL packet from 0b1010 to 0b1111,
  5099. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5100. * bits from low to high: FP, MD, MO - 3 bits
  5101. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5102. * dword6 - b'0:31 - tlv_filter_in_flags:
  5103. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5104. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5105. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5106. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5107. * A value of 0 will be considered as ignore this config.
  5108. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5109. * e.g. wmac_top_reg_seq_hwioreg.h
  5110. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5111. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5112. * A value of 0 will be considered as ignore this config.
  5113. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5114. * e.g. wmac_top_reg_seq_hwioreg.h
  5115. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5116. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5117. * A value of 0 will be considered as ignore this config.
  5118. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5119. * e.g. wmac_top_reg_seq_hwioreg.h
  5120. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5121. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5122. * A value of 0 will be considered as ignore this config.
  5123. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5124. * e.g. wmac_top_reg_seq_hwioreg.h
  5125. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5126. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5127. * A value of 0 will be considered as ignore this config.
  5128. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5129. * e.g. wmac_top_reg_seq_hwioreg.h
  5130. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5131. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5132. * A value of 0 will be considered as ignore this config.
  5133. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5134. * e.g. wmac_top_reg_seq_hwioreg.h
  5135. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5136. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5137. * A value of 0 will be considered as ignore this config.
  5138. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5139. * e.g. wmac_top_reg_seq_hwioreg.h
  5140. * - b'16:31 - rsvd3 for future use
  5141. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5142. * to source rings. Consumer drops packets if the available
  5143. * words in the ring falls below the configured threshold
  5144. * value.
  5145. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5146. * by host. 1 -> subscribed
  5147. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5148. * by host. 1 -> subscribed
  5149. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5150. * subscribed by host. 1 -> subscribed
  5151. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5152. * selection for the FP PHY ERR status tlv.
  5153. * 0 - wbm2rxdma_buf_source_ring
  5154. * 1 - fw2rxdma_buf_source_ring
  5155. * 2 - sw2rxdma_buf_source_ring
  5156. * 3 - no_buffer_ring
  5157. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5158. * selection for the FP PHY ERR status tlv.
  5159. * 0 - rxdma_release_ring
  5160. * 1 - rxdma2fw_ring
  5161. * 2 - rxdma2sw_ring
  5162. * 3 - rxdma2reo_ring
  5163. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5164. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5165. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5166. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5167. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5168. * 0: MSDU level logging
  5169. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5170. * 0: MSDU level logging
  5171. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5172. * 0: MSDU level logging
  5173. * - b'23 - word_mask_compaction: enable/disable word mask for
  5174. * mpdu/msdu start/end tlvs
  5175. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5176. * manager override
  5177. * - b'25:28 - rbm_override_val: return buffer manager override value
  5178. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5179. * which have to be posted to host from phy.
  5180. * Corresponding to errors defined in
  5181. * phyrx_abort_request_reason enums 0 to 31.
  5182. * Refer to RXPCU register definition header files for the
  5183. * phyrx_abort_request_reason enum definition.
  5184. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5185. * errors which have to be posted to host from phy.
  5186. * Corresponding to errors defined in
  5187. * phyrx_abort_request_reason enums 32 to 63.
  5188. * Refer to RXPCU register definition header files for the
  5189. * phyrx_abort_request_reason enum definition.
  5190. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5191. * applicable if word mask enabled
  5192. * - b'16:31 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5193. * applicable if word mask enabled
  5194. * dword15- b'0:16 - rx_msdu_end_word_mask
  5195. b'17:31 - rsvd5
  5196. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5197. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5198. * buffer
  5199. * 1: RX_PKT TLV logging at specified offset for the
  5200. * subsequent buffer
  5201. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5202. */
  5203. PREPACK struct htt_rx_ring_selection_cfg_t {
  5204. A_UINT32 msg_type: 8,
  5205. pdev_id: 8,
  5206. ring_id: 8,
  5207. status_swap: 1,
  5208. pkt_swap: 1,
  5209. rx_offsets_valid: 1,
  5210. drop_thresh_valid: 1,
  5211. rx_mon_global_en: 1,
  5212. rsvd1: 3;
  5213. A_UINT32 ring_buffer_size: 16,
  5214. config_length_mgmt:3,
  5215. config_length_ctrl:3,
  5216. config_length_data:3,
  5217. rsvd2: 7;
  5218. A_UINT32 packet_type_enable_flags_0;
  5219. A_UINT32 packet_type_enable_flags_1;
  5220. A_UINT32 packet_type_enable_flags_2;
  5221. A_UINT32 packet_type_enable_flags_3;
  5222. A_UINT32 tlv_filter_in_flags;
  5223. A_UINT32 rx_packet_offset: 16,
  5224. rx_header_offset: 16;
  5225. A_UINT32 rx_mpdu_end_offset: 16,
  5226. rx_mpdu_start_offset: 16;
  5227. A_UINT32 rx_msdu_end_offset: 16,
  5228. rx_msdu_start_offset: 16;
  5229. A_UINT32 rx_attn_offset: 16,
  5230. rsvd3: 16;
  5231. A_UINT32 rx_drop_threshold: 10,
  5232. fp_ndp: 1,
  5233. mo_ndp: 1,
  5234. fp_phy_err: 1,
  5235. fp_phy_err_buf_src: 2,
  5236. fp_phy_err_buf_dest: 2,
  5237. pkt_type_enable_msdu_or_mpdu_logging:3,
  5238. dma_mpdu_mgmt: 1,
  5239. dma_mpdu_ctrl: 1,
  5240. dma_mpdu_data: 1,
  5241. word_mask_compaction_enable:1,
  5242. rbm_override_enable: 1,
  5243. rbm_override_val: 4,
  5244. rsvd4: 3;
  5245. A_UINT32 phy_err_mask;
  5246. A_UINT32 phy_err_mask_cont;
  5247. A_UINT32 rx_mpdu_start_word_mask:16,
  5248. rx_mpdu_end_word_mask: 16;
  5249. A_UINT32 rx_msdu_end_word_mask: 17,
  5250. rsvd5: 15;
  5251. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5252. rx_pkt_tlv_offset: 15,
  5253. rsvd6: 16;
  5254. } POSTPACK;
  5255. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5256. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5257. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5258. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5259. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5260. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5261. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5262. do { \
  5263. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5264. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5265. } while (0)
  5266. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5267. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5268. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5269. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5270. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5271. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5272. do { \
  5273. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5274. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5275. } while (0)
  5276. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5277. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5278. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5279. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5280. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5281. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5282. do { \
  5283. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5284. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5285. } while (0)
  5286. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5287. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5288. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5289. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5290. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5291. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5292. do { \
  5293. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5294. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5295. } while (0)
  5296. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5297. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5298. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5299. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5300. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5301. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5302. do { \
  5303. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5304. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5305. } while (0)
  5306. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5307. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5308. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5309. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5310. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5311. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5312. do { \
  5313. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5314. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5315. } while (0)
  5316. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5317. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5318. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5319. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5320. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5321. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5322. do { \
  5323. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5324. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5325. } while (0)
  5326. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5327. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5328. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5329. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5330. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5331. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5332. do { \
  5333. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5334. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5335. } while (0)
  5336. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5337. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5338. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5339. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5340. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5341. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5342. do { \
  5343. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5344. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5345. } while (0)
  5346. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5347. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5348. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5349. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5350. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5351. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5352. do { \
  5353. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5354. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5355. } while (0)
  5356. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5357. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5358. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5359. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5360. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5361. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5362. do { \
  5363. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5364. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5365. } while (0)
  5366. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5367. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5368. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5369. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5370. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5371. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5372. do { \
  5373. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5374. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5375. } while (0)
  5376. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5377. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5378. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5379. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5380. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5381. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5382. do { \
  5383. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5384. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5385. } while (0)
  5386. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5387. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5388. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5389. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5390. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5391. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5392. do { \
  5393. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5394. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5395. } while (0)
  5396. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5397. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5398. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5399. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5400. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5401. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5402. do { \
  5403. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5404. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5405. } while (0)
  5406. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5407. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5408. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5409. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5410. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5411. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5412. do { \
  5413. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5414. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5415. } while (0)
  5416. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5417. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5418. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5419. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5420. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5421. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5422. do { \
  5423. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5424. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5425. } while (0)
  5426. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5427. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5428. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5429. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5430. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5431. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5432. do { \
  5433. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5434. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5435. } while (0)
  5436. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5437. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5438. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5439. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5440. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5441. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5442. do { \
  5443. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5444. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5445. } while (0)
  5446. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5447. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5448. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5449. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5450. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5451. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5452. do { \
  5453. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5454. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5455. } while (0)
  5456. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5457. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5458. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5459. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5460. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5461. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5462. do { \
  5463. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5464. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5465. } while (0)
  5466. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5467. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5468. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5469. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5470. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5471. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5472. do { \
  5473. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5474. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5475. } while (0)
  5476. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5477. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5478. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5479. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5480. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5481. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5482. do { \
  5483. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5484. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5485. } while (0)
  5486. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5487. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5488. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5489. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5490. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5491. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5492. do { \
  5493. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5494. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5495. } while (0)
  5496. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5497. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5498. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5499. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5500. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5501. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5502. do { \
  5503. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5504. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5505. } while (0)
  5506. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5507. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5508. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5509. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5510. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5511. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5512. do { \
  5513. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5514. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5515. } while (0)
  5516. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5517. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5518. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5519. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5520. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5521. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5522. do { \
  5523. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5524. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5525. } while (0)
  5526. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5527. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5528. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5529. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5530. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5531. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5532. do { \
  5533. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5534. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5535. } while (0)
  5536. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5537. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5538. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5539. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5540. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5541. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5542. do { \
  5543. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5544. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5545. } while (0)
  5546. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5547. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5548. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5549. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5550. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5551. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5552. do { \
  5553. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5554. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5555. } while (0)
  5556. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5557. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5558. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5559. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5560. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5561. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5562. do { \
  5563. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5564. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5565. } while (0)
  5566. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5567. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5568. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5569. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5570. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5571. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5572. do { \
  5573. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5574. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5575. } while (0)
  5576. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5577. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5578. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5579. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5580. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5581. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5582. do { \
  5583. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5584. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5585. } while (0)
  5586. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5587. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5588. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5589. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5590. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5591. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5592. do { \
  5593. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5594. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5595. } while (0)
  5596. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5597. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5598. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5599. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5600. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5601. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5602. do { \
  5603. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5604. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5605. } while (0)
  5606. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5607. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5608. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5609. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5610. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5611. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5612. do { \
  5613. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5614. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5615. } while (0)
  5616. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5617. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5618. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5619. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5620. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5621. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5622. do { \
  5623. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5624. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5625. } while (0)
  5626. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5627. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5628. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5629. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5630. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5631. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5632. do { \
  5633. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5634. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5635. } while (0)
  5636. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5637. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5638. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5639. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5640. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5641. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5642. do { \
  5643. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5644. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5645. } while (0)
  5646. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0xFFFF0000
  5647. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5648. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5649. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5650. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5651. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5652. do { \
  5653. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5654. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5655. } while (0)
  5656. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5657. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5658. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5659. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5660. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5661. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5662. do { \
  5663. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5664. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5665. } while (0)
  5666. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5667. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5668. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5669. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5670. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5671. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5672. do { \
  5673. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5674. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5675. } while (0)
  5676. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5677. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5678. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5679. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5680. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5681. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5682. do { \
  5683. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5684. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5685. } while (0)
  5686. /*
  5687. * Subtype based MGMT frames enable bits.
  5688. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5689. */
  5690. /* association request */
  5691. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5692. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5693. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5694. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5695. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5696. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5697. /* association response */
  5698. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5699. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5700. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5701. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5702. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5703. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5704. /* Reassociation request */
  5705. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5706. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5707. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5708. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5709. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5710. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5711. /* Reassociation response */
  5712. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5713. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5714. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5715. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5716. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5717. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5718. /* Probe request */
  5719. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5720. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5721. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5722. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5723. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5724. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5725. /* Probe response */
  5726. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5727. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5728. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5729. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5730. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5731. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5732. /* Timing Advertisement */
  5733. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5734. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5735. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5736. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5737. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5738. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5739. /* Reserved */
  5740. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5741. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5742. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5743. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5744. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5745. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5746. /* Beacon */
  5747. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5749. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5753. /* ATIM */
  5754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5760. /* Disassociation */
  5761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5767. /* Authentication */
  5768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5774. /* Deauthentication */
  5775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5781. /* Action */
  5782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5788. /* Action No Ack */
  5789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5795. /* Reserved */
  5796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5802. /*
  5803. * Subtype based CTRL frames enable bits.
  5804. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5805. */
  5806. /* Reserved */
  5807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5813. /* Reserved */
  5814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5820. /* Reserved */
  5821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5827. /* Reserved */
  5828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5834. /* Reserved */
  5835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5841. /* Reserved */
  5842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5848. /* Reserved */
  5849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5855. /* Control Wrapper */
  5856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5862. /* Block Ack Request */
  5863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5869. /* Block Ack*/
  5870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5876. /* PS-POLL */
  5877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5883. /* RTS */
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5890. /* CTS */
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5897. /* ACK */
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5904. /* CF-END */
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5911. /* CF-END + CF-ACK */
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5918. /* Multicast data */
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5925. /* Unicast data */
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5932. /* NULL data */
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5940. do { \
  5941. HTT_CHECK_SET_VAL(httsym, value); \
  5942. (word) |= (value) << httsym##_S; \
  5943. } while (0)
  5944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5945. (((word) & httsym##_M) >> httsym##_S)
  5946. #define htt_rx_ring_pkt_enable_subtype_set( \
  5947. word, flag, mode, type, subtype, val) \
  5948. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5949. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5950. #define htt_rx_ring_pkt_enable_subtype_get( \
  5951. word, flag, mode, type, subtype) \
  5952. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5953. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5954. /* Definition to filter in TLVs */
  5955. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5956. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5957. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5958. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5959. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5960. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5961. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5962. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5963. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5964. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5965. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5966. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5967. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5968. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5969. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5970. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5971. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5972. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5973. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5974. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5975. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5976. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5977. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5978. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5979. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5980. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5981. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5982. do { \
  5983. HTT_CHECK_SET_VAL(httsym, enable); \
  5984. (word) |= (enable) << httsym##_S; \
  5985. } while (0)
  5986. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5987. (((word) & httsym##_M) >> httsym##_S)
  5988. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5989. HTT_RX_RING_TLV_ENABLE_SET( \
  5990. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5991. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5992. HTT_RX_RING_TLV_ENABLE_GET( \
  5993. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5994. /**
  5995. * @brief host -> target TX monitor config message
  5996. *
  5997. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  5998. *
  5999. * @details
  6000. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6001. * configure RXDMA rings.
  6002. * The configuration is per ring based and includes both packet types
  6003. * and PPDU/MPDU TLVs.
  6004. *
  6005. * The message would appear as follows:
  6006. *
  6007. * |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|
  6008. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6009. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6010. * |-----------+--------+--------+-----+------------------------------------|
  6011. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6012. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6013. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6014. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6015. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6016. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6017. * |------------------------------------------------------------------------|
  6018. * | tlv_filter_mask_in0 |
  6019. * |------------------------------------------------------------------------|
  6020. * | tlv_filter_mask_in1 |
  6021. * |------------------------------------------------------------------------|
  6022. * | tlv_filter_mask_in2 |
  6023. * |------------------------------------------------------------------------|
  6024. * | tlv_filter_mask_in3 |
  6025. * |-----------------+-----------------+---------------------+--------------|
  6026. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6027. * |------------------------------------------------------------------------|
  6028. * | pcu_ppdu_setup_word_mask |
  6029. * |--------------------+--+--+--+-----+---------------------+--------------|
  6030. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6031. * |------------------------------------------------------------------------|
  6032. *
  6033. * Where:
  6034. * PS = pkt_swap
  6035. * SS = status_swap
  6036. * The message is interpreted as follows:
  6037. * dword0 - b'0:7 - msg_type: This will be set to
  6038. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6039. * b'8:15 - pdev_id:
  6040. * 0 (for rings at SOC level),
  6041. * 1/2/3 mac id (for rings at LMAC level)
  6042. * b'16:23 - ring_id : Identify the ring to configure.
  6043. * More details can be got from enum htt_srng_ring_id
  6044. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6045. * BUF_RING_CFG_0 defs within HW .h files,
  6046. * e.g. wmac_top_reg_seq_hwioreg.h
  6047. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6048. * BUF_RING_CFG_0 defs within HW .h files,
  6049. * e.g. wmac_top_reg_seq_hwioreg.h
  6050. * b'26 - tx_mon_global_en: Enable/Disable global register
  6051. * configuration in Tx monitor module.
  6052. * b'27:31 - rsvd1: reserved for future use
  6053. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6054. * in byte units.
  6055. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6056. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6057. * 64, 128, 256.
  6058. * If all 3 bits are set config length is > 256.
  6059. * if val is '0', then ignore this field.
  6060. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6061. * 64, 128, 256.
  6062. * If all 3 bits are set config length is > 256.
  6063. * if val is '0', then ignore this field.
  6064. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6065. * 64, 128, 256.
  6066. * If all 3 bits are set config length is > 256.
  6067. * If val is '0', then ignore this field.
  6068. * - b'25:31 - rsvd2: Reserved for future use
  6069. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6070. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6071. * If packet_type_enable_flags is '1' for MGMT type,
  6072. * monitor will ignore this bit and allow this TLV.
  6073. * If packet_type_enable_flags is '0' for MGMT type,
  6074. * monitor will use this bit to enable/disable logging
  6075. * of this TLV.
  6076. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6077. * If packet_type_enable_flags is '1' for CTRL type,
  6078. * monitor will ignore this bit and allow this TLV.
  6079. * If packet_type_enable_flags is '0' for CTRL type,
  6080. * monitor will use this bit to enable/disable logging
  6081. * of this TLV.
  6082. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6083. * If packet_type_enable_flags is '1' for DATA type,
  6084. * monitor will ignore this bit and allow this TLV.
  6085. * If packet_type_enable_flags is '0' for DATA type,
  6086. * monitor will use this bit to enable/disable logging
  6087. * of this TLV.
  6088. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6089. * If packet_type_enable_flags is '1' for MGMT type,
  6090. * monitor will ignore this bit and allow this TLV.
  6091. * If packet_type_enable_flags is '0' for MGMT type,
  6092. * monitor will use this bit to enable/disable logging
  6093. * of this TLV.
  6094. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6095. * If packet_type_enable_flags is '1' for CTRL type,
  6096. * monitor will ignore this bit and allow this TLV.
  6097. * If packet_type_enable_flags is '0' for CTRL type,
  6098. * monitor will use this bit to enable/disable logging
  6099. * of this TLV.
  6100. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6101. * If packet_type_enable_flags is '1' for DATA type,
  6102. * monitor will ignore this bit and allow this TLV.
  6103. * If packet_type_enable_flags is '0' for DATA type,
  6104. * monitor will use this bit to enable/disable logging
  6105. * of this TLV.
  6106. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6107. * If packet_type_enable_flags is '1' for MGMT type,
  6108. * monitor will ignore this bit and allow this TLV.
  6109. * If packet_type_enable_flags is '0' for MGMT type,
  6110. * monitor will use this bit to enable/disable logging
  6111. * of this TLV.
  6112. * If filter_in_TX_MPDU_START = 1 it is recommended
  6113. * to set this bit.
  6114. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6115. * If packet_type_enable_flags is '1' for CTRL type,
  6116. * monitor will ignore this bit and allow this TLV.
  6117. * If packet_type_enable_flags is '0' for CTRL type,
  6118. * monitor will use this bit to enable/disable logging
  6119. * of this TLV.
  6120. * If filter_in_TX_MPDU_START = 1 it is recommended
  6121. * to set this bit.
  6122. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6123. * If packet_type_enable_flags is '1' for DATA type,
  6124. * monitor will ignore this bit and allow this TLV.
  6125. * If packet_type_enable_flags is '0' for DATA type,
  6126. * monitor will use this bit to enable/disable logging
  6127. * of this TLV.
  6128. * If filter_in_TX_MPDU_START = 1 it is recommended
  6129. * to set this bit.
  6130. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6131. * If packet_type_enable_flags is '1' for MGMT type,
  6132. * monitor will ignore this bit and allow this TLV.
  6133. * If packet_type_enable_flags is '0' for MGMT type,
  6134. * monitor will use this bit to enable/disable logging
  6135. * of this TLV.
  6136. * If filter_in_TX_MSDU_START = 1 it is recommended
  6137. * to set this bit.
  6138. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6139. * If packet_type_enable_flags is '1' for CTRL type,
  6140. * monitor will ignore this bit and allow this TLV.
  6141. * If packet_type_enable_flags is '0' for CTRL type,
  6142. * monitor will use this bit to enable/disable logging
  6143. * of this TLV.
  6144. * If filter_in_TX_MSDU_START = 1 it is recommended
  6145. * to set this bit.
  6146. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6147. * If packet_type_enable_flags is '1' for DATA type,
  6148. * monitor will ignore this bit and allow this TLV.
  6149. * If packet_type_enable_flags is '0' for DATA type,
  6150. * monitor will use this bit to enable/disable logging
  6151. * of this TLV.
  6152. * If filter_in_TX_MSDU_START = 1 it is recommended
  6153. * to set this bit.
  6154. * b'15:31 - rsvd3: Reserved for future use
  6155. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6156. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6157. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6158. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6159. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6160. * - b'8:15 - tx_peer_entry_word_mask:
  6161. * - b'16:23 - tx_queue_ext_word_mask:
  6162. * - b'24:31 - tx_msdu_start_word_mask:
  6163. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6164. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6165. * - b'8:15 - rxpcu_user_setup_word_mask:
  6166. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6167. * MGMT, CTRL, DATA
  6168. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6169. * 0 -> MSDU level logging is enabled
  6170. * (valid only if bit is set in
  6171. * pkt_type_enable_msdu_or_mpdu_logging)
  6172. * 1 -> MPDU level logging is enabled
  6173. * (valid only if bit is set in
  6174. * pkt_type_enable_msdu_or_mpdu_logging)
  6175. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6176. * 0 -> MSDU level logging is enabled
  6177. * (valid only if bit is set in
  6178. * pkt_type_enable_msdu_or_mpdu_logging)
  6179. * 1 -> MPDU level logging is enabled
  6180. * (valid only if bit is set in
  6181. * pkt_type_enable_msdu_or_mpdu_logging)
  6182. * - b'21 - dma_mpdu_data(D) : For DATA
  6183. * 0 -> MSDU level logging is enabled
  6184. * (valid only if bit is set in
  6185. * pkt_type_enable_msdu_or_mpdu_logging)
  6186. * 1 -> MPDU level logging is enabled
  6187. * (valid only if bit is set in
  6188. * pkt_type_enable_msdu_or_mpdu_logging)
  6189. * - b'22:31 - rsvd4 for future use
  6190. */
  6191. PREPACK struct htt_tx_monitor_cfg_t {
  6192. A_UINT32 msg_type: 8,
  6193. pdev_id: 8,
  6194. ring_id: 8,
  6195. status_swap: 1,
  6196. pkt_swap: 1,
  6197. tx_mon_global_en: 1,
  6198. rsvd1: 5;
  6199. A_UINT32 ring_buffer_size: 16,
  6200. config_length_mgmt: 3,
  6201. config_length_ctrl: 3,
  6202. config_length_data: 3,
  6203. rsvd2: 7;
  6204. A_UINT32 pkt_type_enable_flags: 3,
  6205. filter_in_tx_mpdu_start_mgmt: 1,
  6206. filter_in_tx_mpdu_start_ctrl: 1,
  6207. filter_in_tx_mpdu_start_data: 1,
  6208. filter_in_tx_msdu_start_mgmt: 1,
  6209. filter_in_tx_msdu_start_ctrl: 1,
  6210. filter_in_tx_msdu_start_data: 1,
  6211. filter_in_tx_mpdu_end_mgmt: 1,
  6212. filter_in_tx_mpdu_end_ctrl: 1,
  6213. filter_in_tx_mpdu_end_data: 1,
  6214. filter_in_tx_msdu_end_mgmt: 1,
  6215. filter_in_tx_msdu_end_ctrl: 1,
  6216. filter_in_tx_msdu_end_data: 1,
  6217. rsvd3: 17;
  6218. A_UINT32 tlv_filter_mask_in0;
  6219. A_UINT32 tlv_filter_mask_in1;
  6220. A_UINT32 tlv_filter_mask_in2;
  6221. A_UINT32 tlv_filter_mask_in3;
  6222. A_UINT32 tx_fes_setup_word_mask: 8,
  6223. tx_peer_entry_word_mask: 8,
  6224. tx_queue_ext_word_mask: 8,
  6225. tx_msdu_start_word_mask: 8;
  6226. A_UINT32 pcu_ppdu_setup_word_mask;
  6227. A_UINT32 tx_mpdu_start_word_mask: 8,
  6228. rxpcu_user_setup_word_mask: 8,
  6229. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6230. dma_mpdu_mgmt: 1,
  6231. dma_mpdu_ctrl: 1,
  6232. dma_mpdu_data: 1,
  6233. rsvd4: 10;
  6234. } POSTPACK;
  6235. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6236. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6237. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6238. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6239. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6240. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6241. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6242. do { \
  6243. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6244. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6245. } while (0)
  6246. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6247. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6248. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6249. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6250. HTT_TX_MONITOR_CFG_RING_ID_S)
  6251. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6252. do { \
  6253. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6254. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6255. } while (0)
  6256. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6257. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6258. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6259. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6260. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6261. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6262. do { \
  6263. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6264. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6265. } while (0)
  6266. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6267. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6268. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6269. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6270. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6271. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6272. do { \
  6273. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6274. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6275. } while (0)
  6276. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6277. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6278. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6279. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6280. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6281. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6282. do { \
  6283. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6284. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6285. } while (0)
  6286. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6287. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6288. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6289. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6290. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6291. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6292. do { \
  6293. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6294. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6295. } while (0)
  6296. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6297. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6298. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6299. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6300. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6301. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6302. do { \
  6303. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6304. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6305. } while (0)
  6306. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6307. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6308. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6309. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6310. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6311. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6312. do { \
  6313. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6314. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6315. } while (0)
  6316. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6317. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6318. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6319. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6320. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6321. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6322. do { \
  6323. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6324. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6325. } while (0)
  6326. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6327. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6328. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6329. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6330. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6331. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6332. do { \
  6333. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6334. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6335. } while (0)
  6336. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6337. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6338. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6339. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6340. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6341. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6342. do { \
  6343. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6344. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6345. } while (0)
  6346. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6347. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6348. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6349. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6350. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6351. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6352. do { \
  6353. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6354. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6355. } while (0)
  6356. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6357. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6358. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6359. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6360. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6361. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6362. do { \
  6363. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6364. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6365. } while (0)
  6366. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6367. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6368. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6369. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6370. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6371. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6372. do { \
  6373. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6374. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6375. } while (0)
  6376. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6377. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6378. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6379. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6380. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6381. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6382. do { \
  6383. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6384. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6385. } while (0)
  6386. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6387. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6388. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6389. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6390. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6391. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6392. do { \
  6393. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6394. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6395. } while (0)
  6396. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6397. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6398. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6399. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6400. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6401. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6402. do { \
  6403. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6404. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6405. } while (0)
  6406. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6407. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6408. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6409. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6410. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6411. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6412. do { \
  6413. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6414. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6415. } while (0)
  6416. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6417. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6418. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6419. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6420. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6421. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6422. do { \
  6423. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6424. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6425. } while (0)
  6426. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6427. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6428. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6429. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6430. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6431. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6432. do { \
  6433. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6434. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6435. } while (0)
  6436. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6437. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6438. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6439. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6440. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6441. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6442. do { \
  6443. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6444. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6445. } while (0)
  6446. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6447. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6448. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6449. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6450. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6451. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6452. do { \
  6453. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6454. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6455. } while (0)
  6456. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6457. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6458. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6459. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6460. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6461. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6462. do { \
  6463. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6464. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6465. } while (0)
  6466. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6467. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6468. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6469. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6470. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6471. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6472. do { \
  6473. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6474. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6475. } while (0)
  6476. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6477. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6478. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6479. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6480. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6481. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6482. do { \
  6483. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6484. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6485. } while (0)
  6486. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6487. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6488. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6489. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6490. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6491. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6492. do { \
  6493. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6494. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6495. } while (0)
  6496. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6497. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6498. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6499. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6500. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6501. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6502. do { \
  6503. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6504. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6505. } while (0)
  6506. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6507. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6508. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6509. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6510. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6511. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6512. do { \
  6513. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6514. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6515. } while (0)
  6516. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6517. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6518. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6519. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6520. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6521. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6522. do { \
  6523. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6524. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6525. } while (0)
  6526. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6527. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6528. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6529. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6530. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6531. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6532. do { \
  6533. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6534. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6535. } while (0)
  6536. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6537. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6538. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6539. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6540. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6541. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6542. do { \
  6543. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6544. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6545. } while (0)
  6546. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6547. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6548. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6549. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6550. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6551. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6552. do { \
  6553. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6554. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6555. } while (0)
  6556. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6557. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6558. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6559. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6560. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6561. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6562. do { \
  6563. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6564. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6565. } while (0)
  6566. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6567. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6568. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6569. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6570. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6571. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6572. do { \
  6573. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6574. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6575. } while (0)
  6576. /*
  6577. * pkt_type_enable_flags
  6578. */
  6579. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6580. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6581. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6582. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6583. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6584. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6585. /*
  6586. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6587. */
  6588. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6589. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6590. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6591. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6592. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6593. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6594. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6595. do { \
  6596. HTT_CHECK_SET_VAL(httsym, value); \
  6597. (word) |= (value) << httsym##_S; \
  6598. } while (0)
  6599. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6600. (((word) & httsym##_M) >> httsym##_S)
  6601. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6602. * type -> MGMT, CTRL, DATA*/
  6603. #define htt_tx_ring_pkt_type_set( \
  6604. word, mode, type, val) \
  6605. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6606. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6607. #define htt_tx_ring_pkt_type_get( \
  6608. word, mode, type) \
  6609. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6610. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6611. /* Definition to filter in TLVs */
  6612. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6613. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6614. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6615. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6616. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6617. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6618. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6619. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6620. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6621. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6622. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6623. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6624. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6625. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6626. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6627. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6628. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6629. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6630. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6631. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6632. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6633. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6634. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6635. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6636. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6637. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6638. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6639. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6640. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6641. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6642. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6643. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6644. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6645. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6646. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6647. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6648. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6649. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6650. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6651. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6652. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6653. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6654. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6655. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6656. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6657. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6658. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6659. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6660. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6661. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6662. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6663. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6664. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6665. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6666. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6667. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6668. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6669. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6670. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6671. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6672. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6673. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6674. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6675. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6676. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6677. do { \
  6678. HTT_CHECK_SET_VAL(httsym, enable); \
  6679. (word) |= (enable) << httsym##_S; \
  6680. } while (0)
  6681. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6682. (((word) & httsym##_M) >> httsym##_S)
  6683. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6684. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6685. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6686. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6687. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6688. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6689. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6690. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6691. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6692. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6693. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6694. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6695. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6696. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6697. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6698. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6699. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6700. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6701. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6702. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6703. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6704. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6705. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6706. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6707. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6708. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6709. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6710. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6711. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6712. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6713. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6714. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6715. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6716. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6717. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6718. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6719. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6720. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6721. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6722. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6723. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6724. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6725. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6726. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6727. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6728. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6729. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6730. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6731. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6732. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6733. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6734. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6735. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6736. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6737. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6738. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6739. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6740. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6741. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6742. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6743. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6744. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6745. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6746. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6747. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6748. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6749. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6753. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6754. do { \
  6755. HTT_CHECK_SET_VAL(httsym, enable); \
  6756. (word) |= (enable) << httsym##_S; \
  6757. } while (0)
  6758. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6759. (((word) & httsym##_M) >> httsym##_S)
  6760. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6761. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6762. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6763. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6764. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6765. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6790. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6791. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6792. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6793. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6794. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6795. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6796. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6797. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6798. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6799. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6800. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6801. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6802. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6803. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6804. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6805. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6806. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6807. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6808. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6809. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6810. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6811. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6812. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6813. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6814. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6815. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6816. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6817. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6818. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6819. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6820. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6821. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6822. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6823. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6824. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6825. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6826. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6827. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6828. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6829. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6830. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6831. do { \
  6832. HTT_CHECK_SET_VAL(httsym, enable); \
  6833. (word) |= (enable) << httsym##_S; \
  6834. } while (0)
  6835. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6836. (((word) & httsym##_M) >> httsym##_S)
  6837. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6838. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6839. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6840. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6841. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6842. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6861. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6865. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6866. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6867. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6868. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6869. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6870. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6871. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6872. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6873. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6874. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6875. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6876. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6877. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6878. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  6879. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  6880. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  6881. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  6882. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  6883. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  6884. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  6885. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  6886. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  6887. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_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_IN3_GET(word, httsym) \
  6893. (((word) & httsym##_M) >> httsym##_S)
  6894. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  6895. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  6896. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  6897. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  6898. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  6899. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  6900. /**
  6901. * @brief host --> target Receive Flow Steering configuration message definition
  6902. *
  6903. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  6904. *
  6905. * host --> target Receive Flow Steering configuration message definition.
  6906. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6907. * The reason for this is we want RFS to be configured and ready before MAC
  6908. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6909. *
  6910. * |31 24|23 16|15 9|8|7 0|
  6911. * |----------------+----------------+----------------+----------------|
  6912. * | reserved |E| msg type |
  6913. * |-------------------------------------------------------------------|
  6914. * Where E = RFS enable flag
  6915. *
  6916. * The RFS_CONFIG message consists of a single 4-byte word.
  6917. *
  6918. * Header fields:
  6919. * - MSG_TYPE
  6920. * Bits 7:0
  6921. * Purpose: identifies this as a RFS config msg
  6922. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  6923. * - RFS_CONFIG
  6924. * Bit 8
  6925. * Purpose: Tells target whether to enable (1) or disable (0)
  6926. * flow steering feature when sending rx indication messages to host
  6927. */
  6928. #define HTT_H2T_RFS_CONFIG_M 0x100
  6929. #define HTT_H2T_RFS_CONFIG_S 8
  6930. #define HTT_RX_RFS_CONFIG_GET(_var) \
  6931. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  6932. HTT_H2T_RFS_CONFIG_S)
  6933. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  6934. do { \
  6935. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  6936. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  6937. } while (0)
  6938. #define HTT_RFS_CFG_REQ_BYTES 4
  6939. /**
  6940. * @brief host -> target FW extended statistics retrieve
  6941. *
  6942. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  6943. *
  6944. * @details
  6945. * The following field definitions describe the format of the HTT host
  6946. * to target FW extended stats retrieve message.
  6947. * The message specifies the type of stats the host wants to retrieve.
  6948. *
  6949. * |31 24|23 16|15 8|7 0|
  6950. * |-----------------------------------------------------------|
  6951. * | reserved | stats type | pdev_mask | msg type |
  6952. * |-----------------------------------------------------------|
  6953. * | config param [0] |
  6954. * |-----------------------------------------------------------|
  6955. * | config param [1] |
  6956. * |-----------------------------------------------------------|
  6957. * | config param [2] |
  6958. * |-----------------------------------------------------------|
  6959. * | config param [3] |
  6960. * |-----------------------------------------------------------|
  6961. * | reserved |
  6962. * |-----------------------------------------------------------|
  6963. * | cookie LSBs |
  6964. * |-----------------------------------------------------------|
  6965. * | cookie MSBs |
  6966. * |-----------------------------------------------------------|
  6967. * Header fields:
  6968. * - MSG_TYPE
  6969. * Bits 7:0
  6970. * Purpose: identifies this is a extended stats upload request message
  6971. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  6972. * - PDEV_MASK
  6973. * Bits 8:15
  6974. * Purpose: identifies the mask of PDEVs to retrieve stats from
  6975. * Value: This is a overloaded field, refer to usage and interpretation of
  6976. * PDEV in interface document.
  6977. * Bit 8 : Reserved for SOC stats
  6978. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6979. * Indicates MACID_MASK in DBS
  6980. * - STATS_TYPE
  6981. * Bits 23:16
  6982. * Purpose: identifies which FW statistics to upload
  6983. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  6984. * - Reserved
  6985. * Bits 31:24
  6986. * - CONFIG_PARAM [0]
  6987. * Bits 31:0
  6988. * Purpose: give an opaque configuration value to the specified stats type
  6989. * Value: stats-type specific configuration value
  6990. * Refer to htt_stats.h for interpretation for each stats sub_type
  6991. * - CONFIG_PARAM [1]
  6992. * Bits 31:0
  6993. * Purpose: give an opaque configuration value to the specified stats type
  6994. * Value: stats-type specific configuration value
  6995. * Refer to htt_stats.h for interpretation for each stats sub_type
  6996. * - CONFIG_PARAM [2]
  6997. * Bits 31:0
  6998. * Purpose: give an opaque configuration value to the specified stats type
  6999. * Value: stats-type specific configuration value
  7000. * Refer to htt_stats.h for interpretation for each stats sub_type
  7001. * - CONFIG_PARAM [3]
  7002. * Bits 31:0
  7003. * Purpose: give an opaque configuration value to the specified stats type
  7004. * Value: stats-type specific configuration value
  7005. * Refer to htt_stats.h for interpretation for each stats sub_type
  7006. * - Reserved [31:0] for future use.
  7007. * - COOKIE_LSBS
  7008. * Bits 31:0
  7009. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7010. * message with its preceding host->target stats request message.
  7011. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7012. * - COOKIE_MSBS
  7013. * Bits 31:0
  7014. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7015. * message with its preceding host->target stats request message.
  7016. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7017. */
  7018. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7019. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7020. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7021. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7022. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7023. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7024. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7025. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7026. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7027. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7028. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7029. do { \
  7030. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7031. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7032. } while (0)
  7033. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7034. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7035. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7036. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7037. do { \
  7038. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7039. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7040. } while (0)
  7041. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7042. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7043. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7044. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7045. do { \
  7046. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7047. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7048. } while (0)
  7049. /**
  7050. * @brief host -> target FW PPDU_STATS request message
  7051. *
  7052. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7053. *
  7054. * @details
  7055. * The following field definitions describe the format of the HTT host
  7056. * to target FW for PPDU_STATS_CFG msg.
  7057. * The message allows the host to configure the PPDU_STATS_IND messages
  7058. * produced by the target.
  7059. *
  7060. * |31 24|23 16|15 8|7 0|
  7061. * |-----------------------------------------------------------|
  7062. * | REQ bit mask | pdev_mask | msg type |
  7063. * |-----------------------------------------------------------|
  7064. * Header fields:
  7065. * - MSG_TYPE
  7066. * Bits 7:0
  7067. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7068. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7069. * - PDEV_MASK
  7070. * Bits 8:15
  7071. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7072. * Value: This is a overloaded field, refer to usage and interpretation of
  7073. * PDEV in interface document.
  7074. * Bit 8 : Reserved for SOC stats
  7075. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7076. * Indicates MACID_MASK in DBS
  7077. * - REQ_TLV_BIT_MASK
  7078. * Bits 16:31
  7079. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7080. * needs to be included in the target's PPDU_STATS_IND messages.
  7081. * Value: refer htt_ppdu_stats_tlv_tag_t
  7082. *
  7083. */
  7084. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7085. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7086. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7087. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7088. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7089. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7090. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7091. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7092. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7093. do { \
  7094. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7095. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7096. } while (0)
  7097. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7098. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7099. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7100. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7101. do { \
  7102. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7103. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7104. } while (0)
  7105. /**
  7106. * @brief Host-->target HTT RX FSE setup message
  7107. *
  7108. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7109. *
  7110. * @details
  7111. * Through this message, the host will provide details of the flow tables
  7112. * in host DDR along with hash keys.
  7113. * This message can be sent per SOC or per PDEV, which is differentiated
  7114. * by pdev id values.
  7115. * The host will allocate flow search table and sends table size,
  7116. * physical DMA address of flow table, and hash keys to firmware to
  7117. * program into the RXOLE FSE HW block.
  7118. *
  7119. * The following field definitions describe the format of the RX FSE setup
  7120. * message sent from the host to target
  7121. *
  7122. * Header fields:
  7123. * dword0 - b'7:0 - msg_type: This will be set to
  7124. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7125. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7126. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7127. * pdev's LMAC ring.
  7128. * b'31:16 - reserved : Reserved for future use
  7129. * dword1 - b'19:0 - number of records: This field indicates the number of
  7130. * entries in the flow table. For example: 8k number of
  7131. * records is equivalent to
  7132. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7133. * b'27:20 - max search: This field specifies the skid length to FSE
  7134. * parser HW module whenever match is not found at the
  7135. * exact index pointed by hash.
  7136. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7137. * Refer htt_ip_da_sa_prefix below for more details.
  7138. * b'31:30 - reserved: Reserved for future use
  7139. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7140. * table allocated by host in DDR
  7141. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7142. * table allocated by host in DDR
  7143. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7144. * entry hashing
  7145. *
  7146. *
  7147. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7148. * |---------------------------------------------------------------|
  7149. * | reserved | pdev_id | MSG_TYPE |
  7150. * |---------------------------------------------------------------|
  7151. * |resvd|IPDSA| max_search | Number of records |
  7152. * |---------------------------------------------------------------|
  7153. * | base address lo |
  7154. * |---------------------------------------------------------------|
  7155. * | base address high |
  7156. * |---------------------------------------------------------------|
  7157. * | toeplitz key 31_0 |
  7158. * |---------------------------------------------------------------|
  7159. * | toeplitz key 63_32 |
  7160. * |---------------------------------------------------------------|
  7161. * | toeplitz key 95_64 |
  7162. * |---------------------------------------------------------------|
  7163. * | toeplitz key 127_96 |
  7164. * |---------------------------------------------------------------|
  7165. * | toeplitz key 159_128 |
  7166. * |---------------------------------------------------------------|
  7167. * | toeplitz key 191_160 |
  7168. * |---------------------------------------------------------------|
  7169. * | toeplitz key 223_192 |
  7170. * |---------------------------------------------------------------|
  7171. * | toeplitz key 255_224 |
  7172. * |---------------------------------------------------------------|
  7173. * | toeplitz key 287_256 |
  7174. * |---------------------------------------------------------------|
  7175. * | reserved | toeplitz key 314_288(26:0 bits) |
  7176. * |---------------------------------------------------------------|
  7177. * where:
  7178. * IPDSA = ip_da_sa
  7179. */
  7180. /**
  7181. * @brief: htt_ip_da_sa_prefix
  7182. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7183. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7184. * documentation per RFC3849
  7185. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7186. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7187. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7188. */
  7189. enum htt_ip_da_sa_prefix {
  7190. HTT_RX_IPV6_20010db8,
  7191. HTT_RX_IPV4_MAPPED_IPV6,
  7192. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7193. HTT_RX_IPV6_64FF9B,
  7194. };
  7195. /**
  7196. * @brief Host-->target HTT RX FISA configure and enable
  7197. *
  7198. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7199. *
  7200. * @details
  7201. * The host will send this command down to configure and enable the FISA
  7202. * operational params.
  7203. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7204. * register.
  7205. * Should configure both the MACs.
  7206. *
  7207. * dword0 - b'7:0 - msg_type:
  7208. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7209. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7210. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7211. * pdev's LMAC ring.
  7212. * b'31:16 - reserved : Reserved for future use
  7213. *
  7214. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7215. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7216. * packets. 1 flow search will be skipped
  7217. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7218. * tcp,udp packets
  7219. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7220. * calculation
  7221. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7222. * calculation
  7223. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7224. * calculation
  7225. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7226. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7227. * length
  7228. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7229. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7230. * length
  7231. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7232. * num jump
  7233. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7234. * num jump
  7235. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7236. * data type switch has happend for MPDU Sequence num jump
  7237. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7238. * for MPDU Sequence num jump
  7239. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7240. * for decrypt errors
  7241. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7242. * while aggregating a msdu
  7243. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7244. * The aggregation is done until (number of MSDUs aggregated
  7245. * < LIMIT + 1)
  7246. * b'31:18 - Reserved
  7247. *
  7248. * fisa_control_value - 32bit value FW can write to register
  7249. *
  7250. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7251. * Threshold value for FISA timeout (units are microseconds).
  7252. * When the global timestamp exceeds this threshold, FISA
  7253. * aggregation will be restarted.
  7254. * A value of 0 means timeout is disabled.
  7255. * Compare the threshold register with timestamp field in
  7256. * flow entry to generate timeout for the flow.
  7257. *
  7258. * |31 18 |17 16|15 8|7 0|
  7259. * |-------------------------------------------------------------|
  7260. * | reserved | pdev_mask | msg type |
  7261. * |-------------------------------------------------------------|
  7262. * | reserved | FISA_CTRL |
  7263. * |-------------------------------------------------------------|
  7264. * | FISA_TIMEOUT_THRESH |
  7265. * |-------------------------------------------------------------|
  7266. */
  7267. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7268. A_UINT32 msg_type:8,
  7269. pdev_id:8,
  7270. reserved0:16;
  7271. /**
  7272. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7273. * [17:0]
  7274. */
  7275. union {
  7276. /*
  7277. * fisa_control_bits structure is deprecated.
  7278. * Please use fisa_control_bits_v2 going forward.
  7279. */
  7280. struct {
  7281. A_UINT32 fisa_enable: 1,
  7282. ipsec_skip_search: 1,
  7283. nontcp_skip_search: 1,
  7284. add_ipv4_fixed_hdr_len: 1,
  7285. add_ipv6_fixed_hdr_len: 1,
  7286. add_tcp_fixed_hdr_len: 1,
  7287. add_udp_hdr_len: 1,
  7288. chksum_cum_ip_len_en: 1,
  7289. disable_tid_check: 1,
  7290. disable_ta_check: 1,
  7291. disable_qos_check: 1,
  7292. disable_raw_check: 1,
  7293. disable_decrypt_err_check: 1,
  7294. disable_msdu_drop_check: 1,
  7295. fisa_aggr_limit: 4,
  7296. reserved: 14;
  7297. } fisa_control_bits;
  7298. struct {
  7299. A_UINT32 fisa_enable: 1,
  7300. fisa_aggr_limit: 4,
  7301. reserved: 27;
  7302. } fisa_control_bits_v2;
  7303. A_UINT32 fisa_control_value;
  7304. } u_fisa_control;
  7305. /**
  7306. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7307. * timeout threshold for aggregation. Unit in usec.
  7308. * [31:0]
  7309. */
  7310. A_UINT32 fisa_timeout_threshold;
  7311. } POSTPACK;
  7312. /* DWord 0: pdev-ID */
  7313. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7314. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7315. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7316. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7317. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7318. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7319. do { \
  7320. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7321. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7322. } while (0)
  7323. /* Dword 1: fisa_control_value fisa config */
  7324. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7325. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7326. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7327. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7328. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7329. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7330. do { \
  7331. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7332. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7333. } while (0)
  7334. /* Dword 1: fisa_control_value ipsec_skip_search */
  7335. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7336. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7337. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7338. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7339. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7340. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7341. do { \
  7342. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7343. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7344. } while (0)
  7345. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7346. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7347. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7348. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7349. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7350. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7351. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7352. do { \
  7353. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7354. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7355. } while (0)
  7356. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7357. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7358. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7359. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7360. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7361. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7362. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7363. do { \
  7364. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7365. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7366. } while (0)
  7367. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7368. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7369. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7370. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7371. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7372. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7373. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7374. do { \
  7375. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7376. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7377. } while (0)
  7378. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7379. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7380. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7381. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7382. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7383. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7384. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7385. do { \
  7386. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7387. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7388. } while (0)
  7389. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7390. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7391. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7392. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7393. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7394. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7395. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7396. do { \
  7397. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7398. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7399. } while (0)
  7400. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7401. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7402. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7403. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7404. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7405. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7406. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7407. do { \
  7408. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7409. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7410. } while (0)
  7411. /* Dword 1: fisa_control_value disable_tid_check */
  7412. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7413. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7414. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7415. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7416. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7417. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7418. do { \
  7419. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7420. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7421. } while (0)
  7422. /* Dword 1: fisa_control_value disable_ta_check */
  7423. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7424. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7425. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7426. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7427. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7428. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7429. do { \
  7430. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7431. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7432. } while (0)
  7433. /* Dword 1: fisa_control_value disable_qos_check */
  7434. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7435. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7436. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7437. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7438. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7439. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7440. do { \
  7441. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7442. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7443. } while (0)
  7444. /* Dword 1: fisa_control_value disable_raw_check */
  7445. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7446. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7447. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7448. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7449. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7450. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7451. do { \
  7452. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7453. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7454. } while (0)
  7455. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7456. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7457. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7458. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7459. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7460. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7461. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7462. do { \
  7463. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7464. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7465. } while (0)
  7466. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7467. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7468. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7469. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7470. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7471. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7472. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7473. do { \
  7474. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7475. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7476. } while (0)
  7477. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7478. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7479. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7480. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7481. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7482. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7483. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7484. do { \
  7485. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7486. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7487. } while (0)
  7488. /* Dword 1: fisa_control_value fisa config */
  7489. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7490. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7491. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7492. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7493. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7494. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7495. do { \
  7496. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7497. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7498. } while (0)
  7499. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7500. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7501. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7502. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7503. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7504. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7505. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7506. do { \
  7507. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7508. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7509. } while (0)
  7510. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7511. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7512. pdev_id:8,
  7513. reserved0:16;
  7514. A_UINT32 num_records:20,
  7515. max_search:8,
  7516. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7517. reserved1:2;
  7518. A_UINT32 base_addr_lo;
  7519. A_UINT32 base_addr_hi;
  7520. A_UINT32 toeplitz31_0;
  7521. A_UINT32 toeplitz63_32;
  7522. A_UINT32 toeplitz95_64;
  7523. A_UINT32 toeplitz127_96;
  7524. A_UINT32 toeplitz159_128;
  7525. A_UINT32 toeplitz191_160;
  7526. A_UINT32 toeplitz223_192;
  7527. A_UINT32 toeplitz255_224;
  7528. A_UINT32 toeplitz287_256;
  7529. A_UINT32 toeplitz314_288:27,
  7530. reserved2:5;
  7531. } POSTPACK;
  7532. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7533. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7534. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7535. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7536. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7537. /* DWORD 0: Pdev ID */
  7538. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7539. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7540. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7541. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7542. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7543. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7544. do { \
  7545. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7546. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7547. } while (0)
  7548. /* DWORD 1:num of records */
  7549. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7550. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7551. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7552. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7553. HTT_RX_FSE_SETUP_NUM_REC_S)
  7554. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7555. do { \
  7556. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7557. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7558. } while (0)
  7559. /* DWORD 1:max_search */
  7560. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7561. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7562. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7563. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7564. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7565. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7566. do { \
  7567. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7568. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7569. } while (0)
  7570. /* DWORD 1:ip_da_sa prefix */
  7571. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7572. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7573. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7574. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7575. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7576. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7577. do { \
  7578. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7579. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7580. } while (0)
  7581. /* DWORD 2: Base Address LO */
  7582. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7583. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7584. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7585. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7586. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7587. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7588. do { \
  7589. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7590. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7591. } while (0)
  7592. /* DWORD 3: Base Address High */
  7593. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7594. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7595. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7596. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7597. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7598. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7599. do { \
  7600. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7601. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7602. } while (0)
  7603. /* DWORD 4-12: Hash Value */
  7604. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7605. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7606. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7607. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7608. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7609. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7610. do { \
  7611. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7612. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7613. } while (0)
  7614. /* DWORD 13: Hash Value 314:288 bits */
  7615. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7616. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7617. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7618. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7619. do { \
  7620. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7621. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7622. } while (0)
  7623. /**
  7624. * @brief Host-->target HTT RX FSE operation message
  7625. *
  7626. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7627. *
  7628. * @details
  7629. * The host will send this Flow Search Engine (FSE) operation message for
  7630. * every flow add/delete operation.
  7631. * The FSE operation includes FSE full cache invalidation or individual entry
  7632. * invalidation.
  7633. * This message can be sent per SOC or per PDEV which is differentiated
  7634. * by pdev id values.
  7635. *
  7636. * |31 16|15 8|7 1|0|
  7637. * |-------------------------------------------------------------|
  7638. * | reserved | pdev_id | MSG_TYPE |
  7639. * |-------------------------------------------------------------|
  7640. * | reserved | operation |I|
  7641. * |-------------------------------------------------------------|
  7642. * | ip_src_addr_31_0 |
  7643. * |-------------------------------------------------------------|
  7644. * | ip_src_addr_63_32 |
  7645. * |-------------------------------------------------------------|
  7646. * | ip_src_addr_95_64 |
  7647. * |-------------------------------------------------------------|
  7648. * | ip_src_addr_127_96 |
  7649. * |-------------------------------------------------------------|
  7650. * | ip_dst_addr_31_0 |
  7651. * |-------------------------------------------------------------|
  7652. * | ip_dst_addr_63_32 |
  7653. * |-------------------------------------------------------------|
  7654. * | ip_dst_addr_95_64 |
  7655. * |-------------------------------------------------------------|
  7656. * | ip_dst_addr_127_96 |
  7657. * |-------------------------------------------------------------|
  7658. * | l4_dst_port | l4_src_port |
  7659. * | (32-bit SPI incase of IPsec) |
  7660. * |-------------------------------------------------------------|
  7661. * | reserved | l4_proto |
  7662. * |-------------------------------------------------------------|
  7663. *
  7664. * where I is 1-bit ipsec_valid.
  7665. *
  7666. * The following field definitions describe the format of the RX FSE operation
  7667. * message sent from the host to target for every add/delete flow entry to flow
  7668. * table.
  7669. *
  7670. * Header fields:
  7671. * dword0 - b'7:0 - msg_type: This will be set to
  7672. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7673. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7674. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7675. * specified pdev's LMAC ring.
  7676. * b'31:16 - reserved : Reserved for future use
  7677. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7678. * (Internet Protocol Security).
  7679. * IPsec describes the framework for providing security at
  7680. * IP layer. IPsec is defined for both versions of IP:
  7681. * IPV4 and IPV6.
  7682. * Please refer to htt_rx_flow_proto enumeration below for
  7683. * more info.
  7684. * ipsec_valid = 1 for IPSEC packets
  7685. * ipsec_valid = 0 for IP Packets
  7686. * b'7:1 - operation: This indicates types of FSE operation.
  7687. * Refer to htt_rx_fse_operation enumeration:
  7688. * 0 - No Cache Invalidation required
  7689. * 1 - Cache invalidate only one entry given by IP
  7690. * src/dest address at DWORD[2:9]
  7691. * 2 - Complete FSE Cache Invalidation
  7692. * 3 - FSE Disable
  7693. * 4 - FSE Enable
  7694. * b'31:8 - reserved: Reserved for future use
  7695. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7696. * for per flow addition/deletion
  7697. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7698. * and the subsequent 3 A_UINT32 will be padding bytes.
  7699. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7700. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7701. * from 0 to 65535 but only 0 to 1023 are designated as
  7702. * well-known ports. Refer to [RFC1700] for more details.
  7703. * This field is valid only if
  7704. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7705. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7706. * range from 0 to 65535 but only 0 to 1023 are designated
  7707. * as well-known ports. Refer to [RFC1700] for more details.
  7708. * This field is valid only if
  7709. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7710. * - SPI (31:0): Security Parameters Index is an
  7711. * identification tag added to the header while using IPsec
  7712. * for tunneling the IP traffici.
  7713. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7714. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7715. * Assigned Internet Protocol Numbers.
  7716. * l4_proto numbers for standard protocol like UDP/TCP
  7717. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7718. * l4_proto = 17 for UDP etc.
  7719. * b'31:8 - reserved: Reserved for future use.
  7720. *
  7721. */
  7722. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7723. A_UINT32 msg_type:8,
  7724. pdev_id:8,
  7725. reserved0:16;
  7726. A_UINT32 ipsec_valid:1,
  7727. operation:7,
  7728. reserved1:24;
  7729. A_UINT32 ip_src_addr_31_0;
  7730. A_UINT32 ip_src_addr_63_32;
  7731. A_UINT32 ip_src_addr_95_64;
  7732. A_UINT32 ip_src_addr_127_96;
  7733. A_UINT32 ip_dest_addr_31_0;
  7734. A_UINT32 ip_dest_addr_63_32;
  7735. A_UINT32 ip_dest_addr_95_64;
  7736. A_UINT32 ip_dest_addr_127_96;
  7737. union {
  7738. A_UINT32 spi;
  7739. struct {
  7740. A_UINT32 l4_src_port:16,
  7741. l4_dest_port:16;
  7742. } ip;
  7743. } u;
  7744. A_UINT32 l4_proto:8,
  7745. reserved:24;
  7746. } POSTPACK;
  7747. /**
  7748. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7749. *
  7750. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7751. *
  7752. * @details
  7753. * The host will send this Full monitor mode register configuration message.
  7754. * This message can be sent per SOC or per PDEV which is differentiated
  7755. * by pdev id values.
  7756. *
  7757. * |31 16|15 11|10 8|7 3|2|1|0|
  7758. * |-------------------------------------------------------------|
  7759. * | reserved | pdev_id | MSG_TYPE |
  7760. * |-------------------------------------------------------------|
  7761. * | reserved |Release Ring |N|Z|E|
  7762. * |-------------------------------------------------------------|
  7763. *
  7764. * where E is 1-bit full monitor mode enable/disable.
  7765. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7766. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7767. *
  7768. * The following field definitions describe the format of the full monitor
  7769. * mode configuration message sent from the host to target for each pdev.
  7770. *
  7771. * Header fields:
  7772. * dword0 - b'7:0 - msg_type: This will be set to
  7773. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7774. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7775. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7776. * specified pdev's LMAC ring.
  7777. * b'31:16 - reserved : Reserved for future use.
  7778. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7779. * monitor mode rxdma register is to be enabled or disabled.
  7780. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7781. * additional descriptors at ppdu end for zero mpdus
  7782. * enabled or disabled.
  7783. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7784. * additional descriptors at ppdu end for non zero mpdus
  7785. * enabled or disabled.
  7786. * b'10:3 - release_ring: This indicates the destination ring
  7787. * selection for the descriptor at the end of PPDU
  7788. * 0 - REO ring select
  7789. * 1 - FW ring select
  7790. * 2 - SW ring select
  7791. * 3 - Release ring select
  7792. * Refer to htt_rx_full_mon_release_ring.
  7793. * b'31:11 - reserved for future use
  7794. */
  7795. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  7796. A_UINT32 msg_type:8,
  7797. pdev_id:8,
  7798. reserved0:16;
  7799. A_UINT32 full_monitor_mode_enable:1,
  7800. addnl_descs_zero_mpdus_end:1,
  7801. addnl_descs_non_zero_mpdus_end:1,
  7802. release_ring:8,
  7803. reserved1:21;
  7804. } POSTPACK;
  7805. /**
  7806. * Enumeration for full monitor mode destination ring select
  7807. * 0 - REO destination ring select
  7808. * 1 - FW destination ring select
  7809. * 2 - SW destination ring select
  7810. * 3 - Release destination ring select
  7811. */
  7812. enum htt_rx_full_mon_release_ring {
  7813. HTT_RX_MON_RING_REO,
  7814. HTT_RX_MON_RING_FW,
  7815. HTT_RX_MON_RING_SW,
  7816. HTT_RX_MON_RING_RELEASE,
  7817. };
  7818. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  7819. /* DWORD 0: Pdev ID */
  7820. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  7821. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  7822. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  7823. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  7824. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  7825. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  7826. do { \
  7827. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  7828. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  7829. } while (0)
  7830. /* DWORD 1:ENABLE */
  7831. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  7832. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  7833. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  7834. do { \
  7835. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  7836. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  7837. } while (0)
  7838. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  7839. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  7840. /* DWORD 1:ZERO_MPDU */
  7841. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  7842. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  7843. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  7844. do { \
  7845. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  7846. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  7847. } while (0)
  7848. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  7849. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  7850. /* DWORD 1:NON_ZERO_MPDU */
  7851. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  7852. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  7853. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  7854. do { \
  7855. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  7856. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  7857. } while (0)
  7858. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  7859. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  7860. /* DWORD 1:RELEASE_RINGS */
  7861. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  7862. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  7863. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  7864. do { \
  7865. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  7866. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  7867. } while (0)
  7868. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  7869. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  7870. /**
  7871. * Enumeration for IP Protocol or IPSEC Protocol
  7872. * IPsec describes the framework for providing security at IP layer.
  7873. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  7874. */
  7875. enum htt_rx_flow_proto {
  7876. HTT_RX_FLOW_IP_PROTO,
  7877. HTT_RX_FLOW_IPSEC_PROTO,
  7878. };
  7879. /**
  7880. * Enumeration for FSE Cache Invalidation
  7881. * 0 - No Cache Invalidation required
  7882. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  7883. * 2 - Complete FSE Cache Invalidation
  7884. * 3 - FSE Disable
  7885. * 4 - FSE Enable
  7886. */
  7887. enum htt_rx_fse_operation {
  7888. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  7889. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  7890. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  7891. HTT_RX_FSE_DISABLE,
  7892. HTT_RX_FSE_ENABLE,
  7893. };
  7894. /* DWORD 0: Pdev ID */
  7895. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  7896. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  7897. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  7898. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  7899. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  7900. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  7901. do { \
  7902. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  7903. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  7904. } while (0)
  7905. /* DWORD 1:IP PROTO or IPSEC */
  7906. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  7907. #define HTT_RX_FSE_IPSEC_VALID_S 0
  7908. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  7909. do { \
  7910. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  7911. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  7912. } while (0)
  7913. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  7914. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  7915. /* DWORD 1:FSE Operation */
  7916. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  7917. #define HTT_RX_FSE_OPERATION_S 1
  7918. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  7919. do { \
  7920. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  7921. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  7922. } while (0)
  7923. #define HTT_RX_FSE_OPERATION_GET(word) \
  7924. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  7925. /* DWORD 2-9:IP Address */
  7926. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  7927. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  7928. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  7929. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  7930. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  7931. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  7932. do { \
  7933. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  7934. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  7935. } while (0)
  7936. /* DWORD 10:Source Port Number */
  7937. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  7938. #define HTT_RX_FSE_SOURCEPORT_S 0
  7939. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  7940. do { \
  7941. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  7942. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  7943. } while (0)
  7944. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  7945. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  7946. /* DWORD 11:Destination Port Number */
  7947. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  7948. #define HTT_RX_FSE_DESTPORT_S 16
  7949. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  7950. do { \
  7951. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  7952. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  7953. } while (0)
  7954. #define HTT_RX_FSE_DESTPORT_GET(word) \
  7955. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  7956. /* DWORD 10-11:SPI (In case of IPSEC) */
  7957. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  7958. #define HTT_RX_FSE_OPERATION_SPI_S 0
  7959. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  7960. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  7961. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  7962. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  7963. do { \
  7964. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  7965. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  7966. } while (0)
  7967. /* DWORD 12:L4 PROTO */
  7968. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  7969. #define HTT_RX_FSE_L4_PROTO_S 0
  7970. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  7971. do { \
  7972. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  7973. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  7974. } while (0)
  7975. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  7976. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  7977. /**
  7978. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  7979. *
  7980. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  7981. *
  7982. * |31 24|23 |15 8|7 2|1|0|
  7983. * |----------------+----------------+----------------+----------------|
  7984. * | reserved | pdev_id | msg_type |
  7985. * |---------------------------------+----------------+----------------|
  7986. * | reserved |E|F|
  7987. * |---------------------------------+----------------+----------------|
  7988. * Where E = Configure the target to provide the 3-tuple hash value in
  7989. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  7990. * F = Configure the target to provide the 3-tuple hash value in
  7991. * flow_id_toeplitz field of rx_msdu_start tlv
  7992. *
  7993. * The following field definitions describe the format of the 3 tuple hash value
  7994. * message sent from the host to target as part of initialization sequence.
  7995. *
  7996. * Header fields:
  7997. * dword0 - b'7:0 - msg_type: This will be set to
  7998. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  7999. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8000. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8001. * specified pdev's LMAC ring.
  8002. * b'31:16 - reserved : Reserved for future use
  8003. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8004. * b'1 - toeplitz_hash_2_or_4_field_enable
  8005. * b'31:2 - reserved : Reserved for future use
  8006. * ---------+------+----------------------------------------------------------
  8007. * bit1 | bit0 | Functionality
  8008. * ---------+------+----------------------------------------------------------
  8009. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8010. * | | in flow_id_toeplitz field
  8011. * ---------+------+----------------------------------------------------------
  8012. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8013. * | | in toeplitz_hash_2_or_4 field
  8014. * ---------+------+----------------------------------------------------------
  8015. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8016. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8017. * ---------+------+----------------------------------------------------------
  8018. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8019. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8020. * | | toeplitz_hash_2_or_4 field
  8021. *----------------------------------------------------------------------------
  8022. */
  8023. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8024. A_UINT32 msg_type :8,
  8025. pdev_id :8,
  8026. reserved0 :16;
  8027. A_UINT32 flow_id_toeplitz_field_enable :1,
  8028. toeplitz_hash_2_or_4_field_enable :1,
  8029. reserved1 :30;
  8030. } POSTPACK;
  8031. /* DWORD0 : pdev_id configuration Macros */
  8032. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8033. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8034. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8035. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8036. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8037. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8038. do { \
  8039. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8040. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8041. } while (0)
  8042. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8043. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8044. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8045. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8046. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8047. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8048. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8049. do { \
  8050. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8051. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8052. } while (0)
  8053. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8054. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8055. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8056. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8057. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8058. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8059. do { \
  8060. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8061. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8062. } while (0)
  8063. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8064. /**
  8065. * @brief host --> target Host PA Address Size
  8066. *
  8067. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8068. *
  8069. * @details
  8070. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8071. * provide the physical start address and size of each of the memory
  8072. * areas within host DDR that the target FW may need to access.
  8073. *
  8074. * For example, the host can use this message to allow the target FW
  8075. * to set up access to the host's pools of TQM link descriptors.
  8076. * The message would appear as follows:
  8077. *
  8078. * |31 24|23 16|15 8|7 0|
  8079. * |----------------+----------------+----------------+----------------|
  8080. * | reserved | num_entries | msg_type |
  8081. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8082. * | mem area 0 size |
  8083. * |----------------+----------------+----------------+----------------|
  8084. * | mem area 0 physical_address_lo |
  8085. * |----------------+----------------+----------------+----------------|
  8086. * | mem area 0 physical_address_hi |
  8087. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8088. * | mem area 1 size |
  8089. * |----------------+----------------+----------------+----------------|
  8090. * | mem area 1 physical_address_lo |
  8091. * |----------------+----------------+----------------+----------------|
  8092. * | mem area 1 physical_address_hi |
  8093. * |----------------+----------------+----------------+----------------|
  8094. * ...
  8095. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8096. * | mem area N size |
  8097. * |----------------+----------------+----------------+----------------|
  8098. * | mem area N physical_address_lo |
  8099. * |----------------+----------------+----------------+----------------|
  8100. * | mem area N physical_address_hi |
  8101. * |----------------+----------------+----------------+----------------|
  8102. *
  8103. * The message is interpreted as follows:
  8104. * dword0 - b'0:7 - msg_type: This will be set to
  8105. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8106. * b'8:15 - number_entries: Indicated the number of host memory
  8107. * areas specified within the remainder of the message
  8108. * b'16:31 - reserved.
  8109. * dword1 - b'0:31 - memory area 0 size in bytes
  8110. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8111. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8112. * and similar for memory area 1 through memory area N.
  8113. */
  8114. PREPACK struct htt_h2t_host_paddr_size {
  8115. A_UINT32 msg_type: 8,
  8116. num_entries: 8,
  8117. reserved: 16;
  8118. } POSTPACK;
  8119. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8120. A_UINT32 size;
  8121. A_UINT32 physical_address_lo;
  8122. A_UINT32 physical_address_hi;
  8123. } POSTPACK;
  8124. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8125. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8126. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8127. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8128. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8129. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8130. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8131. do { \
  8132. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8133. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8134. } while (0)
  8135. /**
  8136. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8137. *
  8138. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8139. *
  8140. * @details
  8141. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8142. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8143. *
  8144. * The message would appear as follows:
  8145. *
  8146. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8147. * |---------------------------------+---+---+----------+-+-----------|
  8148. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8149. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8150. *
  8151. *
  8152. * The message is interpreted as follows:
  8153. * dword0 - b'0:7 - msg_type: This will be set to
  8154. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8155. * b'8 - override bit to drive MSDUs to PPE ring
  8156. * b'9:13 - REO destination ring indication
  8157. * b'14 - Multi buffer msdu override enable bit
  8158. * b'15 - Intra BSS override
  8159. * b'16 - Decap raw override
  8160. * b'17 - Decap Native wifi override
  8161. * b'18 - IP frag override
  8162. * b'19:31 - reserved
  8163. */
  8164. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8165. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8166. override: 1,
  8167. reo_destination_indication: 5,
  8168. multi_buffer_msdu_override_en: 1,
  8169. intra_bss_override: 1,
  8170. decap_raw_override: 1,
  8171. decap_nwifi_override: 1,
  8172. ip_frag_override: 1,
  8173. reserved: 13;
  8174. } POSTPACK;
  8175. /* DWORD 0: Override */
  8176. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8177. #define HTT_PPE_CFG_OVERRIDE_S 8
  8178. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8179. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8180. HTT_PPE_CFG_OVERRIDE_S)
  8181. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8182. do { \
  8183. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8184. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8185. } while (0)
  8186. /* DWORD 0: REO Destination Indication*/
  8187. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8188. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8189. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8190. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8191. HTT_PPE_CFG_REO_DEST_IND_S)
  8192. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8193. do { \
  8194. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8195. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8196. } while (0)
  8197. /* DWORD 0: Multi buffer MSDU override */
  8198. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8199. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8200. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8201. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8202. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8203. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8204. do { \
  8205. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8206. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8207. } while (0)
  8208. /* DWORD 0: Intra BSS override */
  8209. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8210. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8211. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8212. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8213. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8214. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8215. do { \
  8216. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8217. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8218. } while (0)
  8219. /* DWORD 0: Decap RAW override */
  8220. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8221. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8222. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8223. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8224. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8225. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8226. do { \
  8227. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8228. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8229. } while (0)
  8230. /* DWORD 0: Decap NWIFI override */
  8231. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8232. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8233. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8234. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8235. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8236. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8237. do { \
  8238. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8239. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8240. } while (0)
  8241. /* DWORD 0: IP frag override */
  8242. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8243. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8244. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8245. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8246. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8247. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8248. do { \
  8249. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8250. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8251. } while (0)
  8252. /*
  8253. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8254. *
  8255. * @details
  8256. * The following field definitions describe the format of the HTT host
  8257. * to target FW VDEV TX RX stats retrieve message.
  8258. * The message specifies the type of stats the host wants to retrieve.
  8259. *
  8260. * |31 27|26 25|24 17|16|15 8|7 0|
  8261. * |-----------------------------------------------------------|
  8262. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8263. * |-----------------------------------------------------------|
  8264. * | vdev_id lower bitmask |
  8265. * |-----------------------------------------------------------|
  8266. * | vdev_id upper bitmask |
  8267. * |-----------------------------------------------------------|
  8268. * Header fields:
  8269. * Where:
  8270. * dword0 - b'7:0 - msg_type: This will be set to
  8271. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8272. * b'15:8 - pdev id
  8273. * b'16(E) - Enable/Disable the vdev HW stats
  8274. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8275. * b'25:26(R) - Reset stats bits
  8276. * 0: don't reset stats
  8277. * 1: reset stats once
  8278. * 2: reset stats at the start of each periodic interval
  8279. * b'27:31 - reserved for future use
  8280. * dword1 - b'0:31 - vdev_id lower bitmask
  8281. * dword2 - b'0:31 - vdev_id upper bitmask
  8282. */
  8283. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8284. A_UINT32 msg_type :8,
  8285. pdev_id :8,
  8286. enable :1,
  8287. periodic_interval :8,
  8288. reset_stats_bits :2,
  8289. reserved0 :5;
  8290. A_UINT32 vdev_id_lower_bitmask;
  8291. A_UINT32 vdev_id_upper_bitmask;
  8292. } POSTPACK;
  8293. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8294. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8295. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8296. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8297. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8298. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8299. do { \
  8300. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8301. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8302. } while (0)
  8303. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8304. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8305. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8306. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8307. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8308. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8309. do { \
  8310. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8311. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8312. } while (0)
  8313. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8314. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8315. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8316. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8317. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8318. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8319. do { \
  8320. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8321. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8322. } while (0)
  8323. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8324. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8325. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8326. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8327. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8328. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8329. do { \
  8330. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8331. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8332. } while (0)
  8333. /*
  8334. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8335. *
  8336. * @details
  8337. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8338. * the default MSDU queues for one of the TIDs within the specified peer
  8339. * to the specified service class.
  8340. * The TID is indirectly specified - each service class is associated
  8341. * with a TID. All default MSDU queues for this peer-TID will be
  8342. * linked to the service class in question.
  8343. *
  8344. * |31 16|15 8|7 0|
  8345. * |------------------------------+--------------+--------------|
  8346. * | peer ID | svc class ID | msg type |
  8347. * |------------------------------------------------------------|
  8348. * Header fields:
  8349. * dword0 - b'7:0 - msg_type: This will be set to
  8350. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8351. * b'15:8 - service class ID
  8352. * b'31:16 - peer ID
  8353. */
  8354. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8355. A_UINT32 msg_type :8,
  8356. svc_class_id :8,
  8357. peer_id :16;
  8358. } POSTPACK;
  8359. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8360. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8361. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8362. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8363. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8364. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8365. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8366. do { \
  8367. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8368. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8369. } while (0)
  8370. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8371. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8372. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8373. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8374. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8375. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8376. do { \
  8377. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8378. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8379. } while (0)
  8380. /*
  8381. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8382. *
  8383. * @details
  8384. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8385. * remove the linkage of the specified peer-TID's MSDU queues to
  8386. * service classes.
  8387. *
  8388. * |31 16|15 8|7 0|
  8389. * |------------------------------+--------------+--------------|
  8390. * | peer ID | svc class ID | msg type |
  8391. * |------------------------------------------------------------|
  8392. * Header fields:
  8393. * dword0 - b'7:0 - msg_type: This will be set to
  8394. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8395. * b'15:8 - service class ID
  8396. * b'31:16 - peer ID
  8397. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8398. * value for peer ID indicates that the target should
  8399. * apply the UNMAP_REQ to all peers.
  8400. */
  8401. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8402. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8403. A_UINT32 msg_type :8,
  8404. svc_class_id :8,
  8405. peer_id :16;
  8406. } POSTPACK;
  8407. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8408. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8409. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8410. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8411. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8412. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8413. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8414. do { \
  8415. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8416. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8417. } while (0)
  8418. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8419. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8420. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8421. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8422. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8423. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8424. do { \
  8425. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8426. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8427. } while (0)
  8428. /*
  8429. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8430. *
  8431. * @details
  8432. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8433. * request the target to report what service class the default MSDU queues
  8434. * of the specified TIDs within the peer are linked to.
  8435. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8436. * to report what service class (if any) the default MSDU queues for
  8437. * each of the specified TIDs are linked to.
  8438. *
  8439. * |31 16|15 8|7 1| 0|
  8440. * |------------------------------+--------------+--------------|
  8441. * | peer ID | TID mask | msg type |
  8442. * |------------------------------------------------------------|
  8443. * | reserved |ETO|
  8444. * |------------------------------------------------------------|
  8445. * Header fields:
  8446. * dword0 - b'7:0 - msg_type: This will be set to
  8447. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8448. * b'15:8 - TID mask
  8449. * b'31:16 - peer ID
  8450. * dword1 - b'0 - "Existing Tids Only" flag
  8451. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8452. * message generated by this REQ will only show the
  8453. * mapping for TIDs that actually exist in the target's
  8454. * peer object.
  8455. * Any TIDs that are covered by a MAP_REQ but which
  8456. * do not actually exist will be shown as being
  8457. * unmapped (i.e. svc class ID 0xff).
  8458. * If this flag is cleared, the MAP_REPORT_CONF message
  8459. * will consider not only the mapping of TIDs currently
  8460. * existing in the peer, but also the mapping that will
  8461. * be applied for any TID objects created within this
  8462. * peer in the future.
  8463. * b'31:1 - reserved for future use
  8464. */
  8465. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8466. A_UINT32 msg_type :8,
  8467. tid_mask :8,
  8468. peer_id :16;
  8469. A_UINT32 existing_tids_only:1,
  8470. reserved :31;
  8471. } POSTPACK;
  8472. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8473. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8474. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8475. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8476. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8477. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8478. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8479. do { \
  8480. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8481. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8482. } while (0)
  8483. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8484. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8485. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8486. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8487. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8488. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8489. do { \
  8490. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8491. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8492. } while (0)
  8493. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8494. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8495. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8496. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8497. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8498. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8499. do { \
  8500. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8501. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8502. } while (0)
  8503. /*=== target -> host messages ===============================================*/
  8504. enum htt_t2h_msg_type {
  8505. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  8506. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  8507. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  8508. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  8509. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  8510. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  8511. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  8512. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  8513. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  8514. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  8515. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  8516. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  8517. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  8518. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  8519. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  8520. /* only used for HL, add HTT MSG for HTT CREDIT update */
  8521. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  8522. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  8523. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  8524. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  8525. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  8526. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  8527. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  8528. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  8529. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  8530. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  8531. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  8532. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  8533. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  8534. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  8535. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  8536. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  8537. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  8538. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  8539. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  8540. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  8541. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  8542. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  8543. /* TX_OFFLOAD_DELIVER_IND:
  8544. * Forward the target's locally-generated packets to the host,
  8545. * to provide to the monitor mode interface.
  8546. */
  8547. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  8548. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  8549. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  8550. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  8551. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  8552. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  8553. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  8554. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  8555. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  8556. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e,
  8557. HTT_T2H_MSG_TYPE_TEST,
  8558. /* keep this last */
  8559. HTT_T2H_NUM_MSGS
  8560. };
  8561. /*
  8562. * HTT target to host message type -
  8563. * stored in bits 7:0 of the first word of the message
  8564. */
  8565. #define HTT_T2H_MSG_TYPE_M 0xff
  8566. #define HTT_T2H_MSG_TYPE_S 0
  8567. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  8568. do { \
  8569. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  8570. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  8571. } while (0)
  8572. #define HTT_T2H_MSG_TYPE_GET(word) \
  8573. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  8574. /**
  8575. * @brief target -> host version number confirmation message definition
  8576. *
  8577. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  8578. *
  8579. * |31 24|23 16|15 8|7 0|
  8580. * |----------------+----------------+----------------+----------------|
  8581. * | reserved | major number | minor number | msg type |
  8582. * |-------------------------------------------------------------------|
  8583. * : option request TLV (optional) |
  8584. * :...................................................................:
  8585. *
  8586. * The VER_CONF message may consist of a single 4-byte word, or may be
  8587. * extended with TLVs that specify HTT options selected by the target.
  8588. * The following option TLVs may be appended to the VER_CONF message:
  8589. * - LL_BUS_ADDR_SIZE
  8590. * - HL_SUPPRESS_TX_COMPL_IND
  8591. * - MAX_TX_QUEUE_GROUPS
  8592. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  8593. * may be appended to the VER_CONF message (but only one TLV of each type).
  8594. *
  8595. * Header fields:
  8596. * - MSG_TYPE
  8597. * Bits 7:0
  8598. * Purpose: identifies this as a version number confirmation message
  8599. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  8600. * - VER_MINOR
  8601. * Bits 15:8
  8602. * Purpose: Specify the minor number of the HTT message library version
  8603. * in use by the target firmware.
  8604. * The minor number specifies the specific revision within a range
  8605. * of fundamentally compatible HTT message definition revisions.
  8606. * Compatible revisions involve adding new messages or perhaps
  8607. * adding new fields to existing messages, in a backwards-compatible
  8608. * manner.
  8609. * Incompatible revisions involve changing the message type values,
  8610. * or redefining existing messages.
  8611. * Value: minor number
  8612. * - VER_MAJOR
  8613. * Bits 15:8
  8614. * Purpose: Specify the major number of the HTT message library version
  8615. * in use by the target firmware.
  8616. * The major number specifies the family of minor revisions that are
  8617. * fundamentally compatible with each other, but not with prior or
  8618. * later families.
  8619. * Value: major number
  8620. */
  8621. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  8622. #define HTT_VER_CONF_MINOR_S 8
  8623. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  8624. #define HTT_VER_CONF_MAJOR_S 16
  8625. #define HTT_VER_CONF_MINOR_SET(word, value) \
  8626. do { \
  8627. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  8628. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  8629. } while (0)
  8630. #define HTT_VER_CONF_MINOR_GET(word) \
  8631. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  8632. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  8633. do { \
  8634. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  8635. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  8636. } while (0)
  8637. #define HTT_VER_CONF_MAJOR_GET(word) \
  8638. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  8639. #define HTT_VER_CONF_BYTES 4
  8640. /**
  8641. * @brief - target -> host HTT Rx In order indication message
  8642. *
  8643. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  8644. *
  8645. * @details
  8646. *
  8647. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  8648. * |----------------+-------------------+---------------------+---------------|
  8649. * | peer ID | P| F| O| ext TID | msg type |
  8650. * |--------------------------------------------------------------------------|
  8651. * | MSDU count | Reserved | vdev id |
  8652. * |--------------------------------------------------------------------------|
  8653. * | MSDU 0 bus address (bits 31:0) |
  8654. #if HTT_PADDR64
  8655. * | MSDU 0 bus address (bits 63:32) |
  8656. #endif
  8657. * |--------------------------------------------------------------------------|
  8658. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  8659. * |--------------------------------------------------------------------------|
  8660. * | MSDU 1 bus address (bits 31:0) |
  8661. #if HTT_PADDR64
  8662. * | MSDU 1 bus address (bits 63:32) |
  8663. #endif
  8664. * |--------------------------------------------------------------------------|
  8665. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  8666. * |--------------------------------------------------------------------------|
  8667. */
  8668. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  8669. *
  8670. * @details
  8671. * bits
  8672. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  8673. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8674. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  8675. * | | frag | | | | fail |chksum fail|
  8676. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8677. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  8678. */
  8679. struct htt_rx_in_ord_paddr_ind_hdr_t
  8680. {
  8681. A_UINT32 /* word 0 */
  8682. msg_type: 8,
  8683. ext_tid: 5,
  8684. offload: 1,
  8685. frag: 1,
  8686. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  8687. peer_id: 16;
  8688. A_UINT32 /* word 1 */
  8689. vap_id: 8,
  8690. /* NOTE:
  8691. * This reserved_1 field is not truly reserved - certain targets use
  8692. * this field internally to store debug information, and do not zero
  8693. * out the contents of the field before uploading the message to the
  8694. * host. Thus, any host-target communication supported by this field
  8695. * is limited to using values that are never used by the debug
  8696. * information stored by certain targets in the reserved_1 field.
  8697. * In particular, the targets in question don't use the value 0x3
  8698. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  8699. * so this previously-unused value within these bits is available to
  8700. * use as the host / target PKT_CAPTURE_MODE flag.
  8701. */
  8702. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  8703. /* if pkt_capture_mode == 0x3, host should
  8704. * send rx frames to monitor mode interface
  8705. */
  8706. msdu_cnt: 16;
  8707. };
  8708. struct htt_rx_in_ord_paddr_ind_msdu32_t
  8709. {
  8710. A_UINT32 dma_addr;
  8711. A_UINT32
  8712. length: 16,
  8713. fw_desc: 8,
  8714. msdu_info:8;
  8715. };
  8716. struct htt_rx_in_ord_paddr_ind_msdu64_t
  8717. {
  8718. A_UINT32 dma_addr_lo;
  8719. A_UINT32 dma_addr_hi;
  8720. A_UINT32
  8721. length: 16,
  8722. fw_desc: 8,
  8723. msdu_info:8;
  8724. };
  8725. #if HTT_PADDR64
  8726. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  8727. #else
  8728. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  8729. #endif
  8730. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  8731. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  8732. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  8733. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  8734. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  8735. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  8736. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  8737. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  8738. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  8739. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  8740. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  8741. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  8742. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  8743. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  8744. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  8745. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  8746. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  8747. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  8748. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  8749. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  8750. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  8751. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  8752. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  8753. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  8754. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  8755. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  8756. /* for systems using 64-bit format for bus addresses */
  8757. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  8758. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  8759. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  8760. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  8761. /* for systems using 32-bit format for bus addresses */
  8762. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  8763. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  8764. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  8765. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  8766. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  8767. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  8768. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  8769. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  8770. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  8771. do { \
  8772. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  8773. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  8774. } while (0)
  8775. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  8776. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  8777. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  8778. do { \
  8779. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  8780. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  8781. } while (0)
  8782. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  8783. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  8784. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  8785. do { \
  8786. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  8787. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  8788. } while (0)
  8789. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  8790. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  8791. /*
  8792. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  8793. * deliver the rx frames to the monitor mode interface.
  8794. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  8795. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  8796. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  8797. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  8798. */
  8799. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  8800. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  8801. do { \
  8802. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  8803. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  8804. } while (0)
  8805. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  8806. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  8807. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  8808. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  8809. do { \
  8810. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  8811. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  8812. } while (0)
  8813. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  8814. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  8815. /* for systems using 64-bit format for bus addresses */
  8816. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  8817. do { \
  8818. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  8819. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  8820. } while (0)
  8821. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  8822. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  8823. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  8824. do { \
  8825. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  8826. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  8827. } while (0)
  8828. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  8829. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  8830. /* for systems using 32-bit format for bus addresses */
  8831. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  8832. do { \
  8833. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  8834. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  8835. } while (0)
  8836. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  8837. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  8838. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  8839. do { \
  8840. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  8841. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  8842. } while (0)
  8843. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  8844. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  8845. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  8846. do { \
  8847. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  8848. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  8849. } while (0)
  8850. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  8851. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  8852. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  8853. do { \
  8854. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  8855. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  8856. } while (0)
  8857. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  8858. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  8859. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  8860. do { \
  8861. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  8862. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  8863. } while (0)
  8864. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  8865. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  8866. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  8867. do { \
  8868. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  8869. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  8870. } while (0)
  8871. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  8872. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  8873. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  8874. do { \
  8875. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  8876. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  8877. } while (0)
  8878. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  8879. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  8880. /* definitions used within target -> host rx indication message */
  8881. PREPACK struct htt_rx_ind_hdr_prefix_t
  8882. {
  8883. A_UINT32 /* word 0 */
  8884. msg_type: 8,
  8885. ext_tid: 5,
  8886. release_valid: 1,
  8887. flush_valid: 1,
  8888. reserved0: 1,
  8889. peer_id: 16;
  8890. A_UINT32 /* word 1 */
  8891. flush_start_seq_num: 6,
  8892. flush_end_seq_num: 6,
  8893. release_start_seq_num: 6,
  8894. release_end_seq_num: 6,
  8895. num_mpdu_ranges: 8;
  8896. } POSTPACK;
  8897. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  8898. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  8899. #define HTT_TGT_RSSI_INVALID 0x80
  8900. PREPACK struct htt_rx_ppdu_desc_t
  8901. {
  8902. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  8903. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  8904. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  8905. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  8906. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  8907. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  8908. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  8909. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  8910. A_UINT32 /* word 0 */
  8911. rssi_cmb: 8,
  8912. timestamp_submicrosec: 8,
  8913. phy_err_code: 8,
  8914. phy_err: 1,
  8915. legacy_rate: 4,
  8916. legacy_rate_sel: 1,
  8917. end_valid: 1,
  8918. start_valid: 1;
  8919. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  8920. union {
  8921. A_UINT32 /* word 1 */
  8922. rssi0_pri20: 8,
  8923. rssi0_ext20: 8,
  8924. rssi0_ext40: 8,
  8925. rssi0_ext80: 8;
  8926. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  8927. } u0;
  8928. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  8929. union {
  8930. A_UINT32 /* word 2 */
  8931. rssi1_pri20: 8,
  8932. rssi1_ext20: 8,
  8933. rssi1_ext40: 8,
  8934. rssi1_ext80: 8;
  8935. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  8936. } u1;
  8937. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  8938. union {
  8939. A_UINT32 /* word 3 */
  8940. rssi2_pri20: 8,
  8941. rssi2_ext20: 8,
  8942. rssi2_ext40: 8,
  8943. rssi2_ext80: 8;
  8944. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  8945. } u2;
  8946. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  8947. union {
  8948. A_UINT32 /* word 4 */
  8949. rssi3_pri20: 8,
  8950. rssi3_ext20: 8,
  8951. rssi3_ext40: 8,
  8952. rssi3_ext80: 8;
  8953. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  8954. } u3;
  8955. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  8956. A_UINT32 tsf32; /* word 5 */
  8957. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  8958. A_UINT32 timestamp_microsec; /* word 6 */
  8959. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  8960. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  8961. A_UINT32 /* word 7 */
  8962. vht_sig_a1: 24,
  8963. preamble_type: 8;
  8964. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  8965. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  8966. A_UINT32 /* word 8 */
  8967. vht_sig_a2: 24,
  8968. /* sa_ant_matrix
  8969. * For cases where a single rx chain has options to be connected to
  8970. * different rx antennas, show which rx antennas were in use during
  8971. * receipt of a given PPDU.
  8972. * This sa_ant_matrix provides a bitmask of the antennas used while
  8973. * receiving this frame.
  8974. */
  8975. sa_ant_matrix: 8;
  8976. } POSTPACK;
  8977. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  8978. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  8979. PREPACK struct htt_rx_ind_hdr_suffix_t
  8980. {
  8981. A_UINT32 /* word 0 */
  8982. fw_rx_desc_bytes: 16,
  8983. reserved0: 16;
  8984. } POSTPACK;
  8985. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  8986. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  8987. PREPACK struct htt_rx_ind_hdr_t
  8988. {
  8989. struct htt_rx_ind_hdr_prefix_t prefix;
  8990. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  8991. struct htt_rx_ind_hdr_suffix_t suffix;
  8992. } POSTPACK;
  8993. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  8994. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  8995. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  8996. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  8997. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  8998. /*
  8999. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9000. * the offset into the HTT rx indication message at which the
  9001. * FW rx PPDU descriptor resides
  9002. */
  9003. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9004. /*
  9005. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9006. * the offset into the HTT rx indication message at which the
  9007. * header suffix (FW rx MSDU byte count) resides
  9008. */
  9009. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9010. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9011. /*
  9012. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9013. * the offset into the HTT rx indication message at which the per-MSDU
  9014. * information starts
  9015. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9016. * per-MSDU information portion of the message. The per-MSDU info itself
  9017. * starts at byte 12.
  9018. */
  9019. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9020. /**
  9021. * @brief target -> host rx indication message definition
  9022. *
  9023. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9024. *
  9025. * @details
  9026. * The following field definitions describe the format of the rx indication
  9027. * message sent from the target to the host.
  9028. * The message consists of three major sections:
  9029. * 1. a fixed-length header
  9030. * 2. a variable-length list of firmware rx MSDU descriptors
  9031. * 3. one or more 4-octet MPDU range information elements
  9032. * The fixed length header itself has two sub-sections
  9033. * 1. the message meta-information, including identification of the
  9034. * sender and type of the received data, and a 4-octet flush/release IE
  9035. * 2. the firmware rx PPDU descriptor
  9036. *
  9037. * The format of the message is depicted below.
  9038. * in this depiction, the following abbreviations are used for information
  9039. * elements within the message:
  9040. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  9041. * elements associated with the PPDU start are valid.
  9042. * Specifically, the following fields are valid only if SV is set:
  9043. * RSSI (all variants), L, legacy rate, preamble type, service,
  9044. * VHT-SIG-A
  9045. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  9046. * elements associated with the PPDU end are valid.
  9047. * Specifically, the following fields are valid only if EV is set:
  9048. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  9049. * - L - Legacy rate selector - if legacy rates are used, this flag
  9050. * indicates whether the rate is from a CCK (L == 1) or OFDM
  9051. * (L == 0) PHY.
  9052. * - P - PHY error flag - boolean indication of whether the rx frame had
  9053. * a PHY error
  9054. *
  9055. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9056. * |----------------+-------------------+---------------------+---------------|
  9057. * | peer ID | |RV|FV| ext TID | msg type |
  9058. * |--------------------------------------------------------------------------|
  9059. * | num | release | release | flush | flush |
  9060. * | MPDU | end | start | end | start |
  9061. * | ranges | seq num | seq num | seq num | seq num |
  9062. * |==========================================================================|
  9063. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  9064. * |V|V| | rate | | | timestamp | RSSI |
  9065. * |--------------------------------------------------------------------------|
  9066. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  9067. * |--------------------------------------------------------------------------|
  9068. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  9069. * |--------------------------------------------------------------------------|
  9070. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  9071. * |--------------------------------------------------------------------------|
  9072. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  9073. * |--------------------------------------------------------------------------|
  9074. * | TSF LSBs |
  9075. * |--------------------------------------------------------------------------|
  9076. * | microsec timestamp |
  9077. * |--------------------------------------------------------------------------|
  9078. * | preamble type | HT-SIG / VHT-SIG-A1 |
  9079. * |--------------------------------------------------------------------------|
  9080. * | service | HT-SIG / VHT-SIG-A2 |
  9081. * |==========================================================================|
  9082. * | reserved | FW rx desc bytes |
  9083. * |--------------------------------------------------------------------------|
  9084. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  9085. * | desc B3 | desc B2 | desc B1 | desc B0 |
  9086. * |--------------------------------------------------------------------------|
  9087. * : : :
  9088. * |--------------------------------------------------------------------------|
  9089. * | alignment | MSDU Rx |
  9090. * | padding | desc Bn |
  9091. * |--------------------------------------------------------------------------|
  9092. * | reserved | MPDU range status | MPDU count |
  9093. * |--------------------------------------------------------------------------|
  9094. * : reserved : MPDU range status : MPDU count :
  9095. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  9096. *
  9097. * Header fields:
  9098. * - MSG_TYPE
  9099. * Bits 7:0
  9100. * Purpose: identifies this as an rx indication message
  9101. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  9102. * - EXT_TID
  9103. * Bits 12:8
  9104. * Purpose: identify the traffic ID of the rx data, including
  9105. * special "extended" TID values for multicast, broadcast, and
  9106. * non-QoS data frames
  9107. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9108. * - FLUSH_VALID (FV)
  9109. * Bit 13
  9110. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9111. * is valid
  9112. * Value:
  9113. * 1 -> flush IE is valid and needs to be processed
  9114. * 0 -> flush IE is not valid and should be ignored
  9115. * - REL_VALID (RV)
  9116. * Bit 13
  9117. * Purpose: indicate whether the release IE (start/end sequence numbers)
  9118. * is valid
  9119. * Value:
  9120. * 1 -> release IE is valid and needs to be processed
  9121. * 0 -> release IE is not valid and should be ignored
  9122. * - PEER_ID
  9123. * Bits 31:16
  9124. * Purpose: Identify, by ID, which peer sent the rx data
  9125. * Value: ID of the peer who sent the rx data
  9126. * - FLUSH_SEQ_NUM_START
  9127. * Bits 5:0
  9128. * Purpose: Indicate the start of a series of MPDUs to flush
  9129. * Not all MPDUs within this series are necessarily valid - the host
  9130. * must check each sequence number within this range to see if the
  9131. * corresponding MPDU is actually present.
  9132. * This field is only valid if the FV bit is set.
  9133. * Value:
  9134. * The sequence number for the first MPDUs to check to flush.
  9135. * The sequence number is masked by 0x3f.
  9136. * - FLUSH_SEQ_NUM_END
  9137. * Bits 11:6
  9138. * Purpose: Indicate the end of a series of MPDUs to flush
  9139. * Value:
  9140. * The sequence number one larger than the sequence number of the
  9141. * last MPDU to check to flush.
  9142. * The sequence number is masked by 0x3f.
  9143. * Not all MPDUs within this series are necessarily valid - the host
  9144. * must check each sequence number within this range to see if the
  9145. * corresponding MPDU is actually present.
  9146. * This field is only valid if the FV bit is set.
  9147. * - REL_SEQ_NUM_START
  9148. * Bits 17:12
  9149. * Purpose: Indicate the start of a series of MPDUs to release.
  9150. * All MPDUs within this series are present and valid - the host
  9151. * need not check each sequence number within this range to see if
  9152. * the corresponding MPDU is actually present.
  9153. * This field is only valid if the RV bit is set.
  9154. * Value:
  9155. * The sequence number for the first MPDUs to check to release.
  9156. * The sequence number is masked by 0x3f.
  9157. * - REL_SEQ_NUM_END
  9158. * Bits 23:18
  9159. * Purpose: Indicate the end of a series of MPDUs to release.
  9160. * Value:
  9161. * The sequence number one larger than the sequence number of the
  9162. * last MPDU to check to release.
  9163. * The sequence number is masked by 0x3f.
  9164. * All MPDUs within this series are present and valid - the host
  9165. * need not check each sequence number within this range to see if
  9166. * the corresponding MPDU is actually present.
  9167. * This field is only valid if the RV bit is set.
  9168. * - NUM_MPDU_RANGES
  9169. * Bits 31:24
  9170. * Purpose: Indicate how many ranges of MPDUs are present.
  9171. * Each MPDU range consists of a series of contiguous MPDUs within the
  9172. * rx frame sequence which all have the same MPDU status.
  9173. * Value: 1-63 (typically a small number, like 1-3)
  9174. *
  9175. * Rx PPDU descriptor fields:
  9176. * - RSSI_CMB
  9177. * Bits 7:0
  9178. * Purpose: Combined RSSI from all active rx chains, across the active
  9179. * bandwidth.
  9180. * Value: RSSI dB units w.r.t. noise floor
  9181. * - TIMESTAMP_SUBMICROSEC
  9182. * Bits 15:8
  9183. * Purpose: high-resolution timestamp
  9184. * Value:
  9185. * Sub-microsecond time of PPDU reception.
  9186. * This timestamp ranges from [0,MAC clock MHz).
  9187. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  9188. * to form a high-resolution, large range rx timestamp.
  9189. * - PHY_ERR_CODE
  9190. * Bits 23:16
  9191. * Purpose:
  9192. * If the rx frame processing resulted in a PHY error, indicate what
  9193. * type of rx PHY error occurred.
  9194. * Value:
  9195. * This field is valid if the "P" (PHY_ERR) flag is set.
  9196. * TBD: document/specify the values for this field
  9197. * - PHY_ERR
  9198. * Bit 24
  9199. * Purpose: indicate whether the rx PPDU had a PHY error
  9200. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  9201. * - LEGACY_RATE
  9202. * Bits 28:25
  9203. * Purpose:
  9204. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  9205. * specify which rate was used.
  9206. * Value:
  9207. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  9208. * flag.
  9209. * If LEGACY_RATE_SEL is 0:
  9210. * 0x8: OFDM 48 Mbps
  9211. * 0x9: OFDM 24 Mbps
  9212. * 0xA: OFDM 12 Mbps
  9213. * 0xB: OFDM 6 Mbps
  9214. * 0xC: OFDM 54 Mbps
  9215. * 0xD: OFDM 36 Mbps
  9216. * 0xE: OFDM 18 Mbps
  9217. * 0xF: OFDM 9 Mbps
  9218. * If LEGACY_RATE_SEL is 1:
  9219. * 0x8: CCK 11 Mbps long preamble
  9220. * 0x9: CCK 5.5 Mbps long preamble
  9221. * 0xA: CCK 2 Mbps long preamble
  9222. * 0xB: CCK 1 Mbps long preamble
  9223. * 0xC: CCK 11 Mbps short preamble
  9224. * 0xD: CCK 5.5 Mbps short preamble
  9225. * 0xE: CCK 2 Mbps short preamble
  9226. * - LEGACY_RATE_SEL
  9227. * Bit 29
  9228. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  9229. * Value:
  9230. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  9231. * used a legacy rate.
  9232. * 0 -> OFDM, 1 -> CCK
  9233. * - END_VALID
  9234. * Bit 30
  9235. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9236. * the start of the PPDU are valid. Specifically, the following
  9237. * fields are only valid if END_VALID is set:
  9238. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  9239. * TIMESTAMP_SUBMICROSEC
  9240. * Value:
  9241. * 0 -> rx PPDU desc end fields are not valid
  9242. * 1 -> rx PPDU desc end fields are valid
  9243. * - START_VALID
  9244. * Bit 31
  9245. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9246. * the end of the PPDU are valid. Specifically, the following
  9247. * fields are only valid if START_VALID is set:
  9248. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  9249. * VHT-SIG-A
  9250. * Value:
  9251. * 0 -> rx PPDU desc start fields are not valid
  9252. * 1 -> rx PPDU desc start fields are valid
  9253. * - RSSI0_PRI20
  9254. * Bits 7:0
  9255. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  9256. * Value: RSSI dB units w.r.t. noise floor
  9257. *
  9258. * - RSSI0_EXT20
  9259. * Bits 7:0
  9260. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  9261. * (if the rx bandwidth was >= 40 MHz)
  9262. * Value: RSSI dB units w.r.t. noise floor
  9263. * - RSSI0_EXT40
  9264. * Bits 7:0
  9265. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  9266. * (if the rx bandwidth was >= 80 MHz)
  9267. * Value: RSSI dB units w.r.t. noise floor
  9268. * - RSSI0_EXT80
  9269. * Bits 7:0
  9270. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  9271. * (if the rx bandwidth was >= 160 MHz)
  9272. * Value: RSSI dB units w.r.t. noise floor
  9273. *
  9274. * - RSSI1_PRI20
  9275. * Bits 7:0
  9276. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  9277. * Value: RSSI dB units w.r.t. noise floor
  9278. * - RSSI1_EXT20
  9279. * Bits 7:0
  9280. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  9281. * (if the rx bandwidth was >= 40 MHz)
  9282. * Value: RSSI dB units w.r.t. noise floor
  9283. * - RSSI1_EXT40
  9284. * Bits 7:0
  9285. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  9286. * (if the rx bandwidth was >= 80 MHz)
  9287. * Value: RSSI dB units w.r.t. noise floor
  9288. * - RSSI1_EXT80
  9289. * Bits 7:0
  9290. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  9291. * (if the rx bandwidth was >= 160 MHz)
  9292. * Value: RSSI dB units w.r.t. noise floor
  9293. *
  9294. * - RSSI2_PRI20
  9295. * Bits 7:0
  9296. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  9297. * Value: RSSI dB units w.r.t. noise floor
  9298. * - RSSI2_EXT20
  9299. * Bits 7:0
  9300. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  9301. * (if the rx bandwidth was >= 40 MHz)
  9302. * Value: RSSI dB units w.r.t. noise floor
  9303. * - RSSI2_EXT40
  9304. * Bits 7:0
  9305. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  9306. * (if the rx bandwidth was >= 80 MHz)
  9307. * Value: RSSI dB units w.r.t. noise floor
  9308. * - RSSI2_EXT80
  9309. * Bits 7:0
  9310. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  9311. * (if the rx bandwidth was >= 160 MHz)
  9312. * Value: RSSI dB units w.r.t. noise floor
  9313. *
  9314. * - RSSI3_PRI20
  9315. * Bits 7:0
  9316. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  9317. * Value: RSSI dB units w.r.t. noise floor
  9318. * - RSSI3_EXT20
  9319. * Bits 7:0
  9320. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  9321. * (if the rx bandwidth was >= 40 MHz)
  9322. * Value: RSSI dB units w.r.t. noise floor
  9323. * - RSSI3_EXT40
  9324. * Bits 7:0
  9325. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  9326. * (if the rx bandwidth was >= 80 MHz)
  9327. * Value: RSSI dB units w.r.t. noise floor
  9328. * - RSSI3_EXT80
  9329. * Bits 7:0
  9330. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  9331. * (if the rx bandwidth was >= 160 MHz)
  9332. * Value: RSSI dB units w.r.t. noise floor
  9333. *
  9334. * - TSF32
  9335. * Bits 31:0
  9336. * Purpose: specify the time the rx PPDU was received, in TSF units
  9337. * Value: 32 LSBs of the TSF
  9338. * - TIMESTAMP_MICROSEC
  9339. * Bits 31:0
  9340. * Purpose: specify the time the rx PPDU was received, in microsecond units
  9341. * Value: PPDU rx time, in microseconds
  9342. * - VHT_SIG_A1
  9343. * Bits 23:0
  9344. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  9345. * from the rx PPDU
  9346. * Value:
  9347. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9348. * VHT-SIG-A1 data.
  9349. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9350. * first 24 bits of the HT-SIG data.
  9351. * Otherwise, this field is invalid.
  9352. * Refer to the the 802.11 protocol for the definition of the
  9353. * HT-SIG and VHT-SIG-A1 fields
  9354. * - VHT_SIG_A2
  9355. * Bits 23:0
  9356. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  9357. * from the rx PPDU
  9358. * Value:
  9359. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9360. * VHT-SIG-A2 data.
  9361. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9362. * last 24 bits of the HT-SIG data.
  9363. * Otherwise, this field is invalid.
  9364. * Refer to the the 802.11 protocol for the definition of the
  9365. * HT-SIG and VHT-SIG-A2 fields
  9366. * - PREAMBLE_TYPE
  9367. * Bits 31:24
  9368. * Purpose: indicate the PHY format of the received burst
  9369. * Value:
  9370. * 0x4: Legacy (OFDM/CCK)
  9371. * 0x8: HT
  9372. * 0x9: HT with TxBF
  9373. * 0xC: VHT
  9374. * 0xD: VHT with TxBF
  9375. * - SERVICE
  9376. * Bits 31:24
  9377. * Purpose: TBD
  9378. * Value: TBD
  9379. *
  9380. * Rx MSDU descriptor fields:
  9381. * - FW_RX_DESC_BYTES
  9382. * Bits 15:0
  9383. * Purpose: Indicate how many bytes in the Rx indication are used for
  9384. * FW Rx descriptors
  9385. *
  9386. * Payload fields:
  9387. * - MPDU_COUNT
  9388. * Bits 7:0
  9389. * Purpose: Indicate how many sequential MPDUs share the same status.
  9390. * All MPDUs within the indicated list are from the same RA-TA-TID.
  9391. * - MPDU_STATUS
  9392. * Bits 15:8
  9393. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  9394. * received successfully.
  9395. * Value:
  9396. * 0x1: success
  9397. * 0x2: FCS error
  9398. * 0x3: duplicate error
  9399. * 0x4: replay error
  9400. * 0x5: invalid peer
  9401. */
  9402. /* header fields */
  9403. #define HTT_RX_IND_EXT_TID_M 0x1f00
  9404. #define HTT_RX_IND_EXT_TID_S 8
  9405. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  9406. #define HTT_RX_IND_FLUSH_VALID_S 13
  9407. #define HTT_RX_IND_REL_VALID_M 0x4000
  9408. #define HTT_RX_IND_REL_VALID_S 14
  9409. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  9410. #define HTT_RX_IND_PEER_ID_S 16
  9411. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  9412. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  9413. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  9414. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  9415. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  9416. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  9417. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  9418. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  9419. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  9420. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  9421. /* rx PPDU descriptor fields */
  9422. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  9423. #define HTT_RX_IND_RSSI_CMB_S 0
  9424. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  9425. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  9426. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  9427. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  9428. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  9429. #define HTT_RX_IND_PHY_ERR_S 24
  9430. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  9431. #define HTT_RX_IND_LEGACY_RATE_S 25
  9432. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  9433. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  9434. #define HTT_RX_IND_END_VALID_M 0x40000000
  9435. #define HTT_RX_IND_END_VALID_S 30
  9436. #define HTT_RX_IND_START_VALID_M 0x80000000
  9437. #define HTT_RX_IND_START_VALID_S 31
  9438. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  9439. #define HTT_RX_IND_RSSI_PRI20_S 0
  9440. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  9441. #define HTT_RX_IND_RSSI_EXT20_S 8
  9442. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  9443. #define HTT_RX_IND_RSSI_EXT40_S 16
  9444. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  9445. #define HTT_RX_IND_RSSI_EXT80_S 24
  9446. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  9447. #define HTT_RX_IND_VHT_SIG_A1_S 0
  9448. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  9449. #define HTT_RX_IND_VHT_SIG_A2_S 0
  9450. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  9451. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  9452. #define HTT_RX_IND_SERVICE_M 0xff000000
  9453. #define HTT_RX_IND_SERVICE_S 24
  9454. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  9455. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  9456. /* rx MSDU descriptor fields */
  9457. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  9458. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  9459. /* payload fields */
  9460. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  9461. #define HTT_RX_IND_MPDU_COUNT_S 0
  9462. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  9463. #define HTT_RX_IND_MPDU_STATUS_S 8
  9464. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  9465. do { \
  9466. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  9467. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  9468. } while (0)
  9469. #define HTT_RX_IND_EXT_TID_GET(word) \
  9470. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  9471. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  9472. do { \
  9473. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  9474. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  9475. } while (0)
  9476. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  9477. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  9478. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  9479. do { \
  9480. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  9481. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  9482. } while (0)
  9483. #define HTT_RX_IND_REL_VALID_GET(word) \
  9484. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  9485. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  9486. do { \
  9487. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  9488. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  9489. } while (0)
  9490. #define HTT_RX_IND_PEER_ID_GET(word) \
  9491. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  9492. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  9493. do { \
  9494. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  9495. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  9496. } while (0)
  9497. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  9498. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  9499. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  9500. do { \
  9501. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  9502. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  9503. } while (0)
  9504. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  9505. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  9506. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  9507. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  9508. do { \
  9509. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  9510. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  9511. } while (0)
  9512. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  9513. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  9514. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  9515. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  9516. do { \
  9517. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  9518. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  9519. } while (0)
  9520. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  9521. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  9522. HTT_RX_IND_REL_SEQ_NUM_START_S)
  9523. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  9524. do { \
  9525. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  9526. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  9527. } while (0)
  9528. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  9529. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  9530. HTT_RX_IND_REL_SEQ_NUM_END_S)
  9531. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  9532. do { \
  9533. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  9534. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  9535. } while (0)
  9536. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  9537. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  9538. HTT_RX_IND_NUM_MPDU_RANGES_S)
  9539. /* FW rx PPDU descriptor fields */
  9540. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  9541. do { \
  9542. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  9543. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  9544. } while (0)
  9545. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  9546. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  9547. HTT_RX_IND_RSSI_CMB_S)
  9548. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  9549. do { \
  9550. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  9551. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  9552. } while (0)
  9553. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  9554. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  9555. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  9556. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  9557. do { \
  9558. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  9559. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  9560. } while (0)
  9561. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  9562. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  9563. HTT_RX_IND_PHY_ERR_CODE_S)
  9564. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  9565. do { \
  9566. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  9567. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  9568. } while (0)
  9569. #define HTT_RX_IND_PHY_ERR_GET(word) \
  9570. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  9571. HTT_RX_IND_PHY_ERR_S)
  9572. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  9573. do { \
  9574. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  9575. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  9576. } while (0)
  9577. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  9578. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  9579. HTT_RX_IND_LEGACY_RATE_S)
  9580. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  9581. do { \
  9582. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  9583. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  9584. } while (0)
  9585. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  9586. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  9587. HTT_RX_IND_LEGACY_RATE_SEL_S)
  9588. #define HTT_RX_IND_END_VALID_SET(word, value) \
  9589. do { \
  9590. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  9591. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  9592. } while (0)
  9593. #define HTT_RX_IND_END_VALID_GET(word) \
  9594. (((word) & HTT_RX_IND_END_VALID_M) >> \
  9595. HTT_RX_IND_END_VALID_S)
  9596. #define HTT_RX_IND_START_VALID_SET(word, value) \
  9597. do { \
  9598. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  9599. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  9600. } while (0)
  9601. #define HTT_RX_IND_START_VALID_GET(word) \
  9602. (((word) & HTT_RX_IND_START_VALID_M) >> \
  9603. HTT_RX_IND_START_VALID_S)
  9604. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  9605. do { \
  9606. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  9607. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  9608. } while (0)
  9609. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  9610. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  9611. HTT_RX_IND_RSSI_PRI20_S)
  9612. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  9613. do { \
  9614. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  9615. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  9616. } while (0)
  9617. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  9618. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  9619. HTT_RX_IND_RSSI_EXT20_S)
  9620. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  9621. do { \
  9622. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  9623. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  9624. } while (0)
  9625. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  9626. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  9627. HTT_RX_IND_RSSI_EXT40_S)
  9628. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  9629. do { \
  9630. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  9631. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  9632. } while (0)
  9633. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  9634. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  9635. HTT_RX_IND_RSSI_EXT80_S)
  9636. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  9637. do { \
  9638. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  9639. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  9640. } while (0)
  9641. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  9642. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  9643. HTT_RX_IND_VHT_SIG_A1_S)
  9644. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  9645. do { \
  9646. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  9647. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  9648. } while (0)
  9649. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  9650. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  9651. HTT_RX_IND_VHT_SIG_A2_S)
  9652. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  9653. do { \
  9654. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  9655. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  9656. } while (0)
  9657. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  9658. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  9659. HTT_RX_IND_PREAMBLE_TYPE_S)
  9660. #define HTT_RX_IND_SERVICE_SET(word, value) \
  9661. do { \
  9662. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  9663. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  9664. } while (0)
  9665. #define HTT_RX_IND_SERVICE_GET(word) \
  9666. (((word) & HTT_RX_IND_SERVICE_M) >> \
  9667. HTT_RX_IND_SERVICE_S)
  9668. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  9669. do { \
  9670. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  9671. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  9672. } while (0)
  9673. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  9674. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  9675. HTT_RX_IND_SA_ANT_MATRIX_S)
  9676. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  9677. do { \
  9678. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  9679. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  9680. } while (0)
  9681. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  9682. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  9683. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  9684. do { \
  9685. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  9686. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  9687. } while (0)
  9688. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  9689. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  9690. #define HTT_RX_IND_HL_BYTES \
  9691. (HTT_RX_IND_HDR_BYTES + \
  9692. 4 /* single FW rx MSDU descriptor */ + \
  9693. 4 /* single MPDU range information element */)
  9694. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  9695. /* Could we use one macro entry? */
  9696. #define HTT_WORD_SET(word, field, value) \
  9697. do { \
  9698. HTT_CHECK_SET_VAL(field, value); \
  9699. (word) |= ((value) << field ## _S); \
  9700. } while (0)
  9701. #define HTT_WORD_GET(word, field) \
  9702. (((word) & field ## _M) >> field ## _S)
  9703. PREPACK struct hl_htt_rx_ind_base {
  9704. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  9705. } POSTPACK;
  9706. /*
  9707. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  9708. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  9709. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  9710. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  9711. * htt_rx_ind_hl_rx_desc_t.
  9712. */
  9713. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  9714. struct htt_rx_ind_hl_rx_desc_t {
  9715. A_UINT8 ver;
  9716. A_UINT8 len;
  9717. struct {
  9718. A_UINT8
  9719. first_msdu: 1,
  9720. last_msdu: 1,
  9721. c3_failed: 1,
  9722. c4_failed: 1,
  9723. ipv6: 1,
  9724. tcp: 1,
  9725. udp: 1,
  9726. reserved: 1;
  9727. } flags;
  9728. /* NOTE: no reserved space - don't append any new fields here */
  9729. };
  9730. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  9731. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9732. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  9733. #define HTT_RX_IND_HL_RX_DESC_VER 0
  9734. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  9735. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9736. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  9737. #define HTT_RX_IND_HL_FLAG_OFFSET \
  9738. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9739. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  9740. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  9741. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  9742. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  9743. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  9744. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  9745. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  9746. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  9747. /* This structure is used in HL, the basic descriptor information
  9748. * used by host. the structure is translated by FW from HW desc
  9749. * or generated by FW. But in HL monitor mode, the host would use
  9750. * the same structure with LL.
  9751. */
  9752. PREPACK struct hl_htt_rx_desc_base {
  9753. A_UINT32
  9754. seq_num:12,
  9755. encrypted:1,
  9756. chan_info_present:1,
  9757. resv0:2,
  9758. mcast_bcast:1,
  9759. fragment:1,
  9760. key_id_oct:8,
  9761. resv1:6;
  9762. A_UINT32
  9763. pn_31_0;
  9764. union {
  9765. struct {
  9766. A_UINT16 pn_47_32;
  9767. A_UINT16 pn_63_48;
  9768. } pn16;
  9769. A_UINT32 pn_63_32;
  9770. } u0;
  9771. A_UINT32
  9772. pn_95_64;
  9773. A_UINT32
  9774. pn_127_96;
  9775. } POSTPACK;
  9776. /*
  9777. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  9778. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  9779. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  9780. * Please see htt_chan_change_t for description of the fields.
  9781. */
  9782. PREPACK struct htt_chan_info_t
  9783. {
  9784. A_UINT32 primary_chan_center_freq_mhz: 16,
  9785. contig_chan1_center_freq_mhz: 16;
  9786. A_UINT32 contig_chan2_center_freq_mhz: 16,
  9787. phy_mode: 8,
  9788. reserved: 8;
  9789. } POSTPACK;
  9790. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  9791. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  9792. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  9793. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  9794. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  9795. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  9796. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  9797. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  9798. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  9799. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  9800. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  9801. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  9802. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  9803. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  9804. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  9805. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  9806. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  9807. /* Channel information */
  9808. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  9809. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  9810. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  9811. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  9812. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  9813. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  9814. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  9815. #define HTT_CHAN_INFO_PHY_MODE_S 16
  9816. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  9817. do { \
  9818. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  9819. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  9820. } while (0)
  9821. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  9822. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  9823. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  9824. do { \
  9825. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  9826. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  9827. } while (0)
  9828. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  9829. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  9830. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  9831. do { \
  9832. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  9833. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  9834. } while (0)
  9835. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  9836. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  9837. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  9838. do { \
  9839. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  9840. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  9841. } while (0)
  9842. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  9843. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  9844. /*
  9845. * @brief target -> host message definition for FW offloaded pkts
  9846. *
  9847. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  9848. *
  9849. * @details
  9850. * The following field definitions describe the format of the firmware
  9851. * offload deliver message sent from the target to the host.
  9852. *
  9853. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  9854. *
  9855. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  9856. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  9857. * | reserved_1 | msg type |
  9858. * |--------------------------------------------------------------------------|
  9859. * | phy_timestamp_l32 |
  9860. * |--------------------------------------------------------------------------|
  9861. * | WORD2 (see below) |
  9862. * |--------------------------------------------------------------------------|
  9863. * | seqno | framectrl |
  9864. * |--------------------------------------------------------------------------|
  9865. * | reserved_3 | vdev_id | tid_num|
  9866. * |--------------------------------------------------------------------------|
  9867. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  9868. * |--------------------------------------------------------------------------|
  9869. *
  9870. * where:
  9871. * STAT = status
  9872. * F = format (802.3 vs. 802.11)
  9873. *
  9874. * definition for word 2
  9875. *
  9876. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  9877. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  9878. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  9879. * |--------------------------------------------------------------------------|
  9880. *
  9881. * where:
  9882. * PR = preamble
  9883. * BF = beamformed
  9884. */
  9885. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  9886. {
  9887. A_UINT32 /* word 0 */
  9888. msg_type:8, /* [ 7: 0] */
  9889. reserved_1:24; /* [31: 8] */
  9890. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  9891. A_UINT32 /* word 2 */
  9892. /* preamble:
  9893. * 0-OFDM,
  9894. * 1-CCk,
  9895. * 2-HT,
  9896. * 3-VHT
  9897. */
  9898. preamble: 2, /* [1:0] */
  9899. /* mcs:
  9900. * In case of HT preamble interpret
  9901. * MCS along with NSS.
  9902. * Valid values for HT are 0 to 7.
  9903. * HT mcs 0 with NSS 2 is mcs 8.
  9904. * Valid values for VHT are 0 to 9.
  9905. */
  9906. mcs: 4, /* [5:2] */
  9907. /* rate:
  9908. * This is applicable only for
  9909. * CCK and OFDM preamble type
  9910. * rate 0: OFDM 48 Mbps,
  9911. * 1: OFDM 24 Mbps,
  9912. * 2: OFDM 12 Mbps
  9913. * 3: OFDM 6 Mbps
  9914. * 4: OFDM 54 Mbps
  9915. * 5: OFDM 36 Mbps
  9916. * 6: OFDM 18 Mbps
  9917. * 7: OFDM 9 Mbps
  9918. * rate 0: CCK 11 Mbps Long
  9919. * 1: CCK 5.5 Mbps Long
  9920. * 2: CCK 2 Mbps Long
  9921. * 3: CCK 1 Mbps Long
  9922. * 4: CCK 11 Mbps Short
  9923. * 5: CCK 5.5 Mbps Short
  9924. * 6: CCK 2 Mbps Short
  9925. */
  9926. rate : 3, /* [ 8: 6] */
  9927. rssi : 8, /* [16: 9] units=dBm */
  9928. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  9929. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  9930. stbc : 1, /* [22] */
  9931. sgi : 1, /* [23] */
  9932. ldpc : 1, /* [24] */
  9933. beamformed: 1, /* [25] */
  9934. reserved_2: 6; /* [31:26] */
  9935. A_UINT32 /* word 3 */
  9936. framectrl:16, /* [15: 0] */
  9937. seqno:16; /* [31:16] */
  9938. A_UINT32 /* word 4 */
  9939. tid_num:5, /* [ 4: 0] actual TID number */
  9940. vdev_id:8, /* [12: 5] */
  9941. reserved_3:19; /* [31:13] */
  9942. A_UINT32 /* word 5 */
  9943. /* status:
  9944. * 0: tx_ok
  9945. * 1: retry
  9946. * 2: drop
  9947. * 3: filtered
  9948. * 4: abort
  9949. * 5: tid delete
  9950. * 6: sw abort
  9951. * 7: dropped by peer migration
  9952. */
  9953. status:3, /* [2:0] */
  9954. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  9955. tx_mpdu_bytes:16, /* [19:4] */
  9956. /* Indicates retry count of offloaded/local generated Data tx frames */
  9957. tx_retry_cnt:6, /* [25:20] */
  9958. reserved_4:6; /* [31:26] */
  9959. } POSTPACK;
  9960. /* FW offload deliver ind message header fields */
  9961. /* DWORD one */
  9962. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  9963. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  9964. /* DWORD two */
  9965. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  9966. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  9967. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  9968. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  9969. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  9970. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  9971. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  9972. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  9973. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  9974. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  9975. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  9976. #define HTT_FW_OFFLOAD_IND_BW_S 19
  9977. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  9978. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  9979. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  9980. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  9981. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  9982. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  9983. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  9984. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  9985. /* DWORD three*/
  9986. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  9987. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  9988. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  9989. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  9990. /* DWORD four */
  9991. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  9992. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  9993. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  9994. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  9995. /* DWORD five */
  9996. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  9997. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  9998. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  9999. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10000. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10001. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10002. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10003. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10004. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10005. do { \
  10006. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10007. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10008. } while (0)
  10009. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10010. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10011. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10012. do { \
  10013. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10014. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10015. } while (0)
  10016. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10017. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10018. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10019. do { \
  10020. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10021. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10022. } while (0)
  10023. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10024. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10025. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10026. do { \
  10027. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10028. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10029. } while (0)
  10030. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10031. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  10032. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  10033. do { \
  10034. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  10035. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  10036. } while (0)
  10037. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  10038. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  10039. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  10040. do { \
  10041. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  10042. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  10043. } while (0)
  10044. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  10045. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  10046. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  10047. do { \
  10048. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  10049. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  10050. } while (0)
  10051. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  10052. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  10053. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  10054. do { \
  10055. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  10056. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  10057. } while (0)
  10058. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  10059. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  10060. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  10061. do { \
  10062. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  10063. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  10064. } while (0)
  10065. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  10066. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  10067. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  10068. do { \
  10069. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  10070. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  10071. } while (0)
  10072. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  10073. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  10074. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  10075. do { \
  10076. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  10077. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  10078. } while (0)
  10079. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  10080. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  10081. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  10082. do { \
  10083. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  10084. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  10085. } while (0)
  10086. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  10087. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  10088. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  10089. do { \
  10090. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  10091. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  10092. } while (0)
  10093. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  10094. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  10095. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  10096. do { \
  10097. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  10098. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  10099. } while (0)
  10100. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  10101. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  10102. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  10103. do { \
  10104. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  10105. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  10106. } while (0)
  10107. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  10108. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  10109. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  10110. do { \
  10111. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  10112. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  10113. } while (0)
  10114. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  10115. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  10116. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  10117. do { \
  10118. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  10119. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  10120. } while (0)
  10121. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  10122. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  10123. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  10124. do { \
  10125. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  10126. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  10127. } while (0)
  10128. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  10129. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  10130. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  10131. do { \
  10132. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  10133. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  10134. } while (0)
  10135. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  10136. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  10137. /*
  10138. * @brief target -> host rx reorder flush message definition
  10139. *
  10140. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  10141. *
  10142. * @details
  10143. * The following field definitions describe the format of the rx flush
  10144. * message sent from the target to the host.
  10145. * The message consists of a 4-octet header, followed by one or more
  10146. * 4-octet payload information elements.
  10147. *
  10148. * |31 24|23 8|7 0|
  10149. * |--------------------------------------------------------------|
  10150. * | TID | peer ID | msg type |
  10151. * |--------------------------------------------------------------|
  10152. * | seq num end | seq num start | MPDU status | reserved |
  10153. * |--------------------------------------------------------------|
  10154. * First DWORD:
  10155. * - MSG_TYPE
  10156. * Bits 7:0
  10157. * Purpose: identifies this as an rx flush message
  10158. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  10159. * - PEER_ID
  10160. * Bits 23:8 (only bits 18:8 actually used)
  10161. * Purpose: identify which peer's rx data is being flushed
  10162. * Value: (rx) peer ID
  10163. * - TID
  10164. * Bits 31:24 (only bits 27:24 actually used)
  10165. * Purpose: Specifies which traffic identifier's rx data is being flushed
  10166. * Value: traffic identifier
  10167. * Second DWORD:
  10168. * - MPDU_STATUS
  10169. * Bits 15:8
  10170. * Purpose:
  10171. * Indicate whether the flushed MPDUs should be discarded or processed.
  10172. * Value:
  10173. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  10174. * stages of rx processing
  10175. * other: discard the MPDUs
  10176. * It is anticipated that flush messages will always have
  10177. * MPDU status == 1, but the status flag is included for
  10178. * flexibility.
  10179. * - SEQ_NUM_START
  10180. * Bits 23:16
  10181. * Purpose:
  10182. * Indicate the start of a series of consecutive MPDUs being flushed.
  10183. * Not all MPDUs within this range are necessarily valid - the host
  10184. * must check each sequence number within this range to see if the
  10185. * corresponding MPDU is actually present.
  10186. * Value:
  10187. * The sequence number for the first MPDU in the sequence.
  10188. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10189. * - SEQ_NUM_END
  10190. * Bits 30:24
  10191. * Purpose:
  10192. * Indicate the end of a series of consecutive MPDUs being flushed.
  10193. * Value:
  10194. * The sequence number one larger than the sequence number of the
  10195. * last MPDU being flushed.
  10196. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10197. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  10198. * are to be released for further rx processing.
  10199. * Not all MPDUs within this range are necessarily valid - the host
  10200. * must check each sequence number within this range to see if the
  10201. * corresponding MPDU is actually present.
  10202. */
  10203. /* first DWORD */
  10204. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  10205. #define HTT_RX_FLUSH_PEER_ID_S 8
  10206. #define HTT_RX_FLUSH_TID_M 0xff000000
  10207. #define HTT_RX_FLUSH_TID_S 24
  10208. /* second DWORD */
  10209. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  10210. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  10211. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  10212. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  10213. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  10214. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  10215. #define HTT_RX_FLUSH_BYTES 8
  10216. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  10217. do { \
  10218. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  10219. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  10220. } while (0)
  10221. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  10222. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  10223. #define HTT_RX_FLUSH_TID_SET(word, value) \
  10224. do { \
  10225. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  10226. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  10227. } while (0)
  10228. #define HTT_RX_FLUSH_TID_GET(word) \
  10229. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  10230. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  10231. do { \
  10232. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  10233. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  10234. } while (0)
  10235. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  10236. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  10237. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  10238. do { \
  10239. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  10240. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  10241. } while (0)
  10242. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  10243. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  10244. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  10245. do { \
  10246. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  10247. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  10248. } while (0)
  10249. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  10250. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  10251. /*
  10252. * @brief target -> host rx pn check indication message
  10253. *
  10254. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  10255. *
  10256. * @details
  10257. * The following field definitions describe the format of the Rx PN check
  10258. * indication message sent from the target to the host.
  10259. * The message consists of a 4-octet header, followed by the start and
  10260. * end sequence numbers to be released, followed by the PN IEs. Each PN
  10261. * IE is one octet containing the sequence number that failed the PN
  10262. * check.
  10263. *
  10264. * |31 24|23 8|7 0|
  10265. * |--------------------------------------------------------------|
  10266. * | TID | peer ID | msg type |
  10267. * |--------------------------------------------------------------|
  10268. * | Reserved | PN IE count | seq num end | seq num start|
  10269. * |--------------------------------------------------------------|
  10270. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  10271. * |--------------------------------------------------------------|
  10272. * First DWORD:
  10273. * - MSG_TYPE
  10274. * Bits 7:0
  10275. * Purpose: Identifies this as an rx pn check indication message
  10276. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  10277. * - PEER_ID
  10278. * Bits 23:8 (only bits 18:8 actually used)
  10279. * Purpose: identify which peer
  10280. * Value: (rx) peer ID
  10281. * - TID
  10282. * Bits 31:24 (only bits 27:24 actually used)
  10283. * Purpose: identify traffic identifier
  10284. * Value: traffic identifier
  10285. * Second DWORD:
  10286. * - SEQ_NUM_START
  10287. * Bits 7:0
  10288. * Purpose:
  10289. * Indicates the starting sequence number of the MPDU in this
  10290. * series of MPDUs that went though PN check.
  10291. * Value:
  10292. * The sequence number for the first MPDU in the sequence.
  10293. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10294. * - SEQ_NUM_END
  10295. * Bits 15:8
  10296. * Purpose:
  10297. * Indicates the ending sequence number of the MPDU in this
  10298. * series of MPDUs that went though PN check.
  10299. * Value:
  10300. * The sequence number one larger then the sequence number of the last
  10301. * MPDU being flushed.
  10302. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10303. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  10304. * for invalid PN numbers and are ready to be released for further processing.
  10305. * Not all MPDUs within this range are necessarily valid - the host
  10306. * must check each sequence number within this range to see if the
  10307. * corresponding MPDU is actually present.
  10308. * - PN_IE_COUNT
  10309. * Bits 23:16
  10310. * Purpose:
  10311. * Used to determine the variable number of PN information elements in this
  10312. * message
  10313. *
  10314. * PN information elements:
  10315. * - PN_IE_x-
  10316. * Purpose:
  10317. * Each PN information element contains the sequence number of the MPDU that
  10318. * has failed the target PN check.
  10319. * Value:
  10320. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  10321. * that failed the PN check.
  10322. */
  10323. /* first DWORD */
  10324. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  10325. #define HTT_RX_PN_IND_PEER_ID_S 8
  10326. #define HTT_RX_PN_IND_TID_M 0xff000000
  10327. #define HTT_RX_PN_IND_TID_S 24
  10328. /* second DWORD */
  10329. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  10330. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  10331. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  10332. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  10333. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  10334. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  10335. #define HTT_RX_PN_IND_BYTES 8
  10336. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  10337. do { \
  10338. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  10339. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  10340. } while (0)
  10341. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  10342. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  10343. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  10344. do { \
  10345. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  10346. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  10347. } while (0)
  10348. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  10349. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  10350. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  10351. do { \
  10352. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  10353. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  10354. } while (0)
  10355. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  10356. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  10357. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  10358. do { \
  10359. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  10360. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  10361. } while (0)
  10362. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  10363. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  10364. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  10365. do { \
  10366. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  10367. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  10368. } while (0)
  10369. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  10370. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  10371. /*
  10372. * @brief target -> host rx offload deliver message for LL system
  10373. *
  10374. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  10375. *
  10376. * @details
  10377. * In a low latency system this message is sent whenever the offload
  10378. * manager flushes out the packets it has coalesced in its coalescing buffer.
  10379. * The DMA of the actual packets into host memory is done before sending out
  10380. * this message. This message indicates only how many MSDUs to reap. The
  10381. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  10382. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  10383. * DMA'd by the MAC directly into host memory these packets do not contain
  10384. * the MAC descriptors in the header portion of the packet. Instead they contain
  10385. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  10386. * message, the packets are delivered directly to the NW stack without going
  10387. * through the regular reorder buffering and PN checking path since it has
  10388. * already been done in target.
  10389. *
  10390. * |31 24|23 16|15 8|7 0|
  10391. * |-----------------------------------------------------------------------|
  10392. * | Total MSDU count | reserved | msg type |
  10393. * |-----------------------------------------------------------------------|
  10394. *
  10395. * @brief target -> host rx offload deliver message for HL system
  10396. *
  10397. * @details
  10398. * In a high latency system this message is sent whenever the offload manager
  10399. * flushes out the packets it has coalesced in its coalescing buffer. The
  10400. * actual packets are also carried along with this message. When the host
  10401. * receives this message, it is expected to deliver these packets to the NW
  10402. * stack directly instead of routing them through the reorder buffering and
  10403. * PN checking path since it has already been done in target.
  10404. *
  10405. * |31 24|23 16|15 8|7 0|
  10406. * |-----------------------------------------------------------------------|
  10407. * | Total MSDU count | reserved | msg type |
  10408. * |-----------------------------------------------------------------------|
  10409. * | peer ID | MSDU length |
  10410. * |-----------------------------------------------------------------------|
  10411. * | MSDU payload | FW Desc | tid | vdev ID |
  10412. * |-----------------------------------------------------------------------|
  10413. * | MSDU payload contd. |
  10414. * |-----------------------------------------------------------------------|
  10415. * | peer ID | MSDU length |
  10416. * |-----------------------------------------------------------------------|
  10417. * | MSDU payload | FW Desc | tid | vdev ID |
  10418. * |-----------------------------------------------------------------------|
  10419. * | MSDU payload contd. |
  10420. * |-----------------------------------------------------------------------|
  10421. *
  10422. */
  10423. /* first DWORD */
  10424. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  10425. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  10426. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  10427. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  10428. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  10429. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  10430. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  10431. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  10432. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  10433. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  10434. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  10435. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  10436. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  10437. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  10438. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  10439. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  10440. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  10441. do { \
  10442. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  10443. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  10444. } while (0)
  10445. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  10446. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  10447. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  10448. do { \
  10449. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  10450. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  10451. } while (0)
  10452. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  10453. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  10454. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  10455. do { \
  10456. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  10457. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  10458. } while (0)
  10459. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  10460. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  10461. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  10462. do { \
  10463. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  10464. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  10465. } while (0)
  10466. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  10467. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  10468. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  10469. do { \
  10470. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  10471. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  10472. } while (0)
  10473. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  10474. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  10475. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  10476. do { \
  10477. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  10478. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  10479. } while (0)
  10480. /**
  10481. * @brief target -> host rx peer map/unmap message definition
  10482. *
  10483. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  10484. *
  10485. * @details
  10486. * The following diagram shows the format of the rx peer map message sent
  10487. * from the target to the host. This layout assumes the target operates
  10488. * as little-endian.
  10489. *
  10490. * This message always contains a SW peer ID. The main purpose of the
  10491. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10492. * with, so that the host can use that peer ID to determine which peer
  10493. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10494. * other purposes, such as identifying during tx completions which peer
  10495. * the tx frames in question were transmitted to.
  10496. *
  10497. * In certain generations of chips, the peer map message also contains
  10498. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  10499. * to identify which peer the frame needs to be forwarded to (i.e. the
  10500. * peer assocated with the Destination MAC Address within the packet),
  10501. * and particularly which vdev needs to transmit the frame (for cases
  10502. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  10503. * meaning as AST_INDEX_0.
  10504. * This DA-based peer ID that is provided for certain rx frames
  10505. * (the rx frames that need to be re-transmitted as tx frames)
  10506. * is the ID that the HW uses for referring to the peer in question,
  10507. * rather than the peer ID that the SW+FW use to refer to the peer.
  10508. *
  10509. *
  10510. * |31 24|23 16|15 8|7 0|
  10511. * |-----------------------------------------------------------------------|
  10512. * | SW peer ID | VDEV ID | msg type |
  10513. * |-----------------------------------------------------------------------|
  10514. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10515. * |-----------------------------------------------------------------------|
  10516. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10517. * |-----------------------------------------------------------------------|
  10518. *
  10519. *
  10520. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  10521. *
  10522. * The following diagram shows the format of the rx peer unmap message sent
  10523. * from the target to the host.
  10524. *
  10525. * |31 24|23 16|15 8|7 0|
  10526. * |-----------------------------------------------------------------------|
  10527. * | SW peer ID | VDEV ID | msg type |
  10528. * |-----------------------------------------------------------------------|
  10529. *
  10530. * The following field definitions describe the format of the rx peer map
  10531. * and peer unmap messages sent from the target to the host.
  10532. * - MSG_TYPE
  10533. * Bits 7:0
  10534. * Purpose: identifies this as an rx peer map or peer unmap message
  10535. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  10536. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  10537. * - VDEV_ID
  10538. * Bits 15:8
  10539. * Purpose: Indicates which virtual device the peer is associated
  10540. * with.
  10541. * Value: vdev ID (used in the host to look up the vdev object)
  10542. * - PEER_ID (a.k.a. SW_PEER_ID)
  10543. * Bits 31:16
  10544. * Purpose: The peer ID (index) that WAL is allocating (map) or
  10545. * freeing (unmap)
  10546. * Value: (rx) peer ID
  10547. * - MAC_ADDR_L32 (peer map only)
  10548. * Bits 31:0
  10549. * Purpose: Identifies which peer node the peer ID is for.
  10550. * Value: lower 4 bytes of peer node's MAC address
  10551. * - MAC_ADDR_U16 (peer map only)
  10552. * Bits 15:0
  10553. * Purpose: Identifies which peer node the peer ID is for.
  10554. * Value: upper 2 bytes of peer node's MAC address
  10555. * - HW_PEER_ID
  10556. * Bits 31:16
  10557. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10558. * address, so for rx frames marked for rx --> tx forwarding, the
  10559. * host can determine from the HW peer ID provided as meta-data with
  10560. * the rx frame which peer the frame is supposed to be forwarded to.
  10561. * Value: ID used by the MAC HW to identify the peer
  10562. */
  10563. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  10564. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  10565. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  10566. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  10567. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  10568. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  10569. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10570. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  10571. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  10572. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  10573. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  10574. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  10575. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  10576. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  10577. do { \
  10578. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  10579. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  10580. } while (0)
  10581. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  10582. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  10583. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  10584. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  10585. do { \
  10586. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  10587. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  10588. } while (0)
  10589. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  10590. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  10591. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  10592. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  10593. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  10594. do { \
  10595. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  10596. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  10597. } while (0)
  10598. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  10599. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  10600. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10601. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  10602. #define HTT_RX_PEER_MAP_BYTES 12
  10603. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  10604. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  10605. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  10606. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  10607. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  10608. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  10609. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  10610. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  10611. #define HTT_RX_PEER_UNMAP_BYTES 4
  10612. /**
  10613. * @brief target -> host rx peer map V2 message definition
  10614. *
  10615. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  10616. *
  10617. * @details
  10618. * The following diagram shows the format of the rx peer map v2 message sent
  10619. * from the target to the host. This layout assumes the target operates
  10620. * as little-endian.
  10621. *
  10622. * This message always contains a SW peer ID. The main purpose of the
  10623. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10624. * with, so that the host can use that peer ID to determine which peer
  10625. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10626. * other purposes, such as identifying during tx completions which peer
  10627. * the tx frames in question were transmitted to.
  10628. *
  10629. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  10630. * is used during rx --> tx frame forwarding to identify which peer the
  10631. * frame needs to be forwarded to (i.e. the peer assocated with the
  10632. * Destination MAC Address within the packet), and particularly which vdev
  10633. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  10634. * This DA-based peer ID that is provided for certain rx frames
  10635. * (the rx frames that need to be re-transmitted as tx frames)
  10636. * is the ID that the HW uses for referring to the peer in question,
  10637. * rather than the peer ID that the SW+FW use to refer to the peer.
  10638. *
  10639. * The HW peer id here is the same meaning as AST_INDEX_0.
  10640. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  10641. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  10642. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  10643. * AST is valid.
  10644. *
  10645. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  10646. * |-------------------------------------------------------------------------|
  10647. * | SW peer ID | VDEV ID | msg type |
  10648. * |-------------------------------------------------------------------------|
  10649. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10650. * |-------------------------------------------------------------------------|
  10651. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10652. * |-------------------------------------------------------------------------|
  10653. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  10654. * |-------------------------------------------------------------------------|
  10655. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  10656. * |-------------------------------------------------------------------------|
  10657. * |TID valid low pri| TID valid hi pri | AST index 2 |
  10658. * |-------------------------------------------------------------------------|
  10659. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  10660. * |-------------------------------------------------------------------------|
  10661. * | Reserved_2 |
  10662. * |-------------------------------------------------------------------------|
  10663. * Where:
  10664. * NH = Next Hop
  10665. * ASTVM = AST valid mask
  10666. * OA = on-chip AST valid bit
  10667. * ASTFM = AST flow mask
  10668. *
  10669. * The following field definitions describe the format of the rx peer map v2
  10670. * messages sent from the target to the host.
  10671. * - MSG_TYPE
  10672. * Bits 7:0
  10673. * Purpose: identifies this as an rx peer map v2 message
  10674. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  10675. * - VDEV_ID
  10676. * Bits 15:8
  10677. * Purpose: Indicates which virtual device the peer is associated with.
  10678. * Value: vdev ID (used in the host to look up the vdev object)
  10679. * - SW_PEER_ID
  10680. * Bits 31:16
  10681. * Purpose: The peer ID (index) that WAL is allocating
  10682. * Value: (rx) peer ID
  10683. * - MAC_ADDR_L32
  10684. * Bits 31:0
  10685. * Purpose: Identifies which peer node the peer ID is for.
  10686. * Value: lower 4 bytes of peer node's MAC address
  10687. * - MAC_ADDR_U16
  10688. * Bits 15:0
  10689. * Purpose: Identifies which peer node the peer ID is for.
  10690. * Value: upper 2 bytes of peer node's MAC address
  10691. * - HW_PEER_ID / AST_INDEX_0
  10692. * Bits 31:16
  10693. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10694. * address, so for rx frames marked for rx --> tx forwarding, the
  10695. * host can determine from the HW peer ID provided as meta-data with
  10696. * the rx frame which peer the frame is supposed to be forwarded to.
  10697. * Value: ID used by the MAC HW to identify the peer
  10698. * - AST_HASH_VALUE
  10699. * Bits 15:0
  10700. * Purpose: Indicates AST Hash value is required for the TCL AST index
  10701. * override feature.
  10702. * - NEXT_HOP
  10703. * Bit 16
  10704. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  10705. * (Wireless Distribution System).
  10706. * - AST_VALID_MASK
  10707. * Bits 19:17
  10708. * Purpose: Indicate if the AST 1 through AST 3 are valid
  10709. * - ONCHIP_AST_VALID_FLAG
  10710. * Bit 20
  10711. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  10712. * is valid.
  10713. * - AST_INDEX_1
  10714. * Bits 15:0
  10715. * Purpose: indicate the second AST index for this peer
  10716. * - AST_0_FLOW_MASK
  10717. * Bits 19:16
  10718. * Purpose: identify the which flow the AST 0 entry corresponds to.
  10719. * - AST_1_FLOW_MASK
  10720. * Bits 23:20
  10721. * Purpose: identify the which flow the AST 1 entry corresponds to.
  10722. * - AST_2_FLOW_MASK
  10723. * Bits 27:24
  10724. * Purpose: identify the which flow the AST 2 entry corresponds to.
  10725. * - AST_3_FLOW_MASK
  10726. * Bits 31:28
  10727. * Purpose: identify the which flow the AST 3 entry corresponds to.
  10728. * - AST_INDEX_2
  10729. * Bits 15:0
  10730. * Purpose: indicate the third AST index for this peer
  10731. * - TID_VALID_HI_PRI
  10732. * Bits 23:16
  10733. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  10734. * - TID_VALID_LOW_PRI
  10735. * Bits 31:24
  10736. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  10737. * - AST_INDEX_3
  10738. * Bits 15:0
  10739. * Purpose: indicate the fourth AST index for this peer
  10740. * - ONCHIP_AST_IDX / RESERVED
  10741. * Bits 31:16
  10742. * Purpose: This field is valid only when split AST feature is enabled.
  10743. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  10744. * If valid, identifies the HW peer ID corresponding to the peer MAC
  10745. * address, this ast_idx is used for LMAC modules for RXPCU.
  10746. * Value: ID used by the LMAC HW to identify the peer
  10747. */
  10748. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  10749. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  10750. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  10751. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  10752. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  10753. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  10754. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  10755. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  10756. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  10757. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  10758. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  10759. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  10760. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  10761. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  10762. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  10763. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  10764. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  10765. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  10766. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  10767. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  10768. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  10769. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  10770. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  10771. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  10772. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  10773. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  10774. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  10775. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  10776. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  10777. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  10778. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  10779. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  10780. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  10781. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  10782. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  10783. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  10784. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  10785. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  10786. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  10787. do { \
  10788. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  10789. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  10790. } while (0)
  10791. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  10792. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  10793. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  10794. do { \
  10795. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  10796. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  10797. } while (0)
  10798. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  10799. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  10800. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  10801. do { \
  10802. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  10803. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  10804. } while (0)
  10805. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  10806. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  10807. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  10808. do { \
  10809. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  10810. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  10811. } while (0)
  10812. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  10813. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  10814. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  10815. do { \
  10816. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  10817. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  10818. } while (0)
  10819. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  10820. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  10821. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  10822. do { \
  10823. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  10824. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  10825. } while (0)
  10826. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  10827. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  10828. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  10829. do { \
  10830. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  10831. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  10832. } while (0)
  10833. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  10834. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  10835. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  10836. do { \
  10837. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  10838. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  10839. } while (0)
  10840. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  10841. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  10842. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  10843. do { \
  10844. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  10845. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  10846. } while (0)
  10847. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  10848. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  10849. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  10850. do { \
  10851. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  10852. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  10853. } while (0)
  10854. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  10855. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  10856. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  10857. do { \
  10858. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  10859. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  10860. } while (0)
  10861. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  10862. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  10863. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  10864. do { \
  10865. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  10866. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  10867. } while (0)
  10868. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  10869. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  10870. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  10871. do { \
  10872. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  10873. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  10874. } while (0)
  10875. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  10876. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  10877. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  10878. do { \
  10879. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  10880. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  10881. } while (0)
  10882. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  10883. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  10884. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  10885. do { \
  10886. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  10887. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  10888. } while (0)
  10889. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  10890. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  10891. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  10892. do { \
  10893. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  10894. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  10895. } while (0)
  10896. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  10897. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  10898. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  10899. do { \
  10900. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  10901. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  10902. } while (0)
  10903. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  10904. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  10905. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10906. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  10907. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  10908. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  10909. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  10910. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  10911. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  10912. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  10913. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  10914. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  10915. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  10916. #define HTT_RX_PEER_MAP_V2_BYTES 32
  10917. /**
  10918. * @brief target -> host rx peer map V3 message definition
  10919. *
  10920. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  10921. *
  10922. * @details
  10923. * The following diagram shows the format of the rx peer map v3 message sent
  10924. * from the target to the host.
  10925. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  10926. * This layout assumes the target operates as little-endian.
  10927. *
  10928. * |31 24|23 20|19|18|17|16|15 8|7 0|
  10929. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  10930. * | SW peer ID | VDEV ID | msg type |
  10931. * |-----------------+--------------------+-----------------+-----------------|
  10932. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10933. * |-----------------+--------------------+-----------------+-----------------|
  10934. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  10935. * |-----------------+--------+-----------+-----------------+-----------------|
  10936. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  10937. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  10938. * | (8bits) | | (4bits) | |
  10939. * |-----------------+--------+--+--+--+--------------------------------------|
  10940. * | RESERVED |E |O | | |
  10941. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  10942. * | |V |V | | |
  10943. * |-----------------+--------------------+-----------------------------------|
  10944. * | HTT_MSDU_IDX_ | RESERVED | |
  10945. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  10946. * | (8bits) | | |
  10947. * |-----------------+--------------------+-----------------------------------|
  10948. * | Reserved_2 |
  10949. * |--------------------------------------------------------------------------|
  10950. * | Reserved_3 |
  10951. * |--------------------------------------------------------------------------|
  10952. *
  10953. * Where:
  10954. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  10955. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  10956. * NH = Next Hop
  10957. * The following field definitions describe the format of the rx peer map v3
  10958. * messages sent from the target to the host.
  10959. * - MSG_TYPE
  10960. * Bits 7:0
  10961. * Purpose: identifies this as a peer map v3 message
  10962. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  10963. * - VDEV_ID
  10964. * Bits 15:8
  10965. * Purpose: Indicates which virtual device the peer is associated with.
  10966. * - SW_PEER_ID
  10967. * Bits 31:16
  10968. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  10969. * - MAC_ADDR_L32
  10970. * Bits 31:0
  10971. * Purpose: Identifies which peer node the peer ID is for.
  10972. * Value: lower 4 bytes of peer node's MAC address
  10973. * - MAC_ADDR_U16
  10974. * Bits 15:0
  10975. * Purpose: Identifies which peer node the peer ID is for.
  10976. * Value: upper 2 bytes of peer node's MAC address
  10977. * - MULTICAST_SW_PEER_ID
  10978. * Bits 31:16
  10979. * Purpose: The multicast peer ID (index)
  10980. * Value: set to HTT_INVALID_PEER if not valid
  10981. * - HW_PEER_ID / AST_INDEX
  10982. * Bits 15:0
  10983. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10984. * address, so for rx frames marked for rx --> tx forwarding, the
  10985. * host can determine from the HW peer ID provided as meta-data with
  10986. * the rx frame which peer the frame is supposed to be forwarded to.
  10987. * - CACHE_SET_NUM
  10988. * Bits 19:16
  10989. * Purpose: Cache Set Number for AST_INDEX
  10990. * Cache set number that should be used to cache the index based
  10991. * search results, for address and flow search.
  10992. * This value should be equal to LSB 4 bits of the hash value
  10993. * of match data, in case of search index points to an entry which
  10994. * may be used in content based search also. The value can be
  10995. * anything when the entry pointed by search index will not be
  10996. * used for content based search.
  10997. * - HTT_MSDU_IDX_VALID_MASK
  10998. * Bits 31:24
  10999. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11000. * - ONCHIP_AST_IDX / RESERVED
  11001. * Bits 15:0
  11002. * Purpose: This field is valid only when split AST feature is enabled.
  11003. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11004. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11005. * address, this ast_idx is used for LMAC modules for RXPCU.
  11006. * - NEXT_HOP
  11007. * Bits 16
  11008. * Purpose: Flag indicates next_hop AST entry used for WDS
  11009. * (Wireless Distribution System).
  11010. * - ONCHIP_AST_VALID
  11011. * Bits 17
  11012. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11013. * - EXT_AST_VALID
  11014. * Bits 18
  11015. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11016. * - EXT_AST_INDEX
  11017. * Bits 15:0
  11018. * Purpose: This field describes Extended AST index
  11019. * Valid if EXT_AST_VALID flag set
  11020. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11021. * Bits 31:24
  11022. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11023. */
  11024. /* dword 0 */
  11025. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11026. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11027. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11028. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11029. /* dword 1 */
  11030. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11031. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  11032. /* dword 2 */
  11033. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  11034. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  11035. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  11036. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  11037. /* dword 3 */
  11038. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  11039. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  11040. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  11041. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  11042. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  11043. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  11044. /* dword 4 */
  11045. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  11046. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  11047. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  11048. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  11049. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  11050. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  11051. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  11052. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  11053. /* dword 5 */
  11054. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  11055. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  11056. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  11057. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  11058. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  11059. do { \
  11060. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  11061. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  11062. } while (0)
  11063. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  11064. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  11065. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  11066. do { \
  11067. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  11068. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  11069. } while (0)
  11070. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  11071. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  11072. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  11073. do { \
  11074. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  11075. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  11076. } while (0)
  11077. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  11078. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  11079. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  11080. do { \
  11081. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  11082. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  11083. } while (0)
  11084. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  11085. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  11086. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  11087. do { \
  11088. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  11089. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  11090. } while (0)
  11091. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  11092. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  11093. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  11094. do { \
  11095. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  11096. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  11097. } while (0)
  11098. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  11099. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  11100. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  11101. do { \
  11102. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  11103. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  11104. } while (0)
  11105. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  11106. (((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)
  11107. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  11108. do { \
  11109. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  11110. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  11111. } while (0)
  11112. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  11113. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  11114. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11115. do { \
  11116. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  11117. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  11118. } while (0)
  11119. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  11120. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  11121. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  11122. do { \
  11123. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  11124. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  11125. } while (0)
  11126. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  11127. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  11128. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  11129. do { \
  11130. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  11131. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  11132. } while (0)
  11133. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  11134. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  11135. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  11136. do { \
  11137. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  11138. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  11139. } while (0)
  11140. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  11141. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  11142. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  11143. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  11144. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  11145. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  11146. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  11147. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  11148. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  11149. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11150. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11151. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  11152. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  11153. #define HTT_RX_PEER_MAP_V3_BYTES 32
  11154. /**
  11155. * @brief target -> host rx peer unmap V2 message definition
  11156. *
  11157. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  11158. *
  11159. * The following diagram shows the format of the rx peer unmap message sent
  11160. * from the target to the host.
  11161. *
  11162. * |31 24|23 16|15 8|7 0|
  11163. * |-----------------------------------------------------------------------|
  11164. * | SW peer ID | VDEV ID | msg type |
  11165. * |-----------------------------------------------------------------------|
  11166. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11167. * |-----------------------------------------------------------------------|
  11168. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  11169. * |-----------------------------------------------------------------------|
  11170. * | Peer Delete Duration |
  11171. * |-----------------------------------------------------------------------|
  11172. * | Reserved_0 | WDS Free Count |
  11173. * |-----------------------------------------------------------------------|
  11174. * | Reserved_1 |
  11175. * |-----------------------------------------------------------------------|
  11176. * | Reserved_2 |
  11177. * |-----------------------------------------------------------------------|
  11178. *
  11179. *
  11180. * The following field definitions describe the format of the rx peer unmap
  11181. * messages sent from the target to the host.
  11182. * - MSG_TYPE
  11183. * Bits 7:0
  11184. * Purpose: identifies this as an rx peer unmap v2 message
  11185. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  11186. * - VDEV_ID
  11187. * Bits 15:8
  11188. * Purpose: Indicates which virtual device the peer is associated
  11189. * with.
  11190. * Value: vdev ID (used in the host to look up the vdev object)
  11191. * - SW_PEER_ID
  11192. * Bits 31:16
  11193. * Purpose: The peer ID (index) that WAL is freeing
  11194. * Value: (rx) peer ID
  11195. * - MAC_ADDR_L32
  11196. * Bits 31:0
  11197. * Purpose: Identifies which peer node the peer ID is for.
  11198. * Value: lower 4 bytes of peer node's MAC address
  11199. * - MAC_ADDR_U16
  11200. * Bits 15:0
  11201. * Purpose: Identifies which peer node the peer ID is for.
  11202. * Value: upper 2 bytes of peer node's MAC address
  11203. * - NEXT_HOP
  11204. * Bits 16
  11205. * Purpose: Bit indicates next_hop AST entry used for WDS
  11206. * (Wireless Distribution System).
  11207. * - PEER_DELETE_DURATION
  11208. * Bits 31:0
  11209. * Purpose: Time taken to delete peer, in msec,
  11210. * Used for monitoring / debugging PEER delete response delay
  11211. * - PEER_WDS_FREE_COUNT
  11212. * Bits 15:0
  11213. * Purpose: Count of WDS entries deleted associated to peer deleted
  11214. */
  11215. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  11216. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  11217. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  11218. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  11219. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  11220. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  11221. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  11222. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  11223. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  11224. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  11225. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  11226. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  11227. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  11228. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  11229. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  11230. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  11231. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  11232. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  11233. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  11234. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  11235. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  11236. do { \
  11237. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  11238. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  11239. } while (0)
  11240. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  11241. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  11242. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  11243. do { \
  11244. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  11245. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  11246. } while (0)
  11247. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  11248. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  11249. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11250. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  11251. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  11252. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  11253. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  11254. /**
  11255. * @brief target -> host rx peer mlo map message definition
  11256. *
  11257. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  11258. *
  11259. * @details
  11260. * The following diagram shows the format of the rx mlo peer map message sent
  11261. * from the target to the host. This layout assumes the target operates
  11262. * as little-endian.
  11263. *
  11264. * MCC:
  11265. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  11266. *
  11267. * WIN:
  11268. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  11269. * It will be sent on the Assoc Link.
  11270. *
  11271. * This message always contains a MLO peer ID. The main purpose of the
  11272. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  11273. * with, so that the host can use that MLO peer ID to determine which peer
  11274. * transmitted the rx frame.
  11275. *
  11276. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  11277. * |-------------------------------------------------------------------------|
  11278. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  11279. * |-------------------------------------------------------------------------|
  11280. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11281. * |-------------------------------------------------------------------------|
  11282. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  11283. * |-------------------------------------------------------------------------|
  11284. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  11285. * |-------------------------------------------------------------------------|
  11286. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  11287. * |-------------------------------------------------------------------------|
  11288. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  11289. * |-------------------------------------------------------------------------|
  11290. * |RSVD |
  11291. * |-------------------------------------------------------------------------|
  11292. * |RSVD |
  11293. * |-------------------------------------------------------------------------|
  11294. * | htt_tlv_hdr_t |
  11295. * |-------------------------------------------------------------------------|
  11296. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11297. * |-------------------------------------------------------------------------|
  11298. * | htt_tlv_hdr_t |
  11299. * |-------------------------------------------------------------------------|
  11300. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11301. * |-------------------------------------------------------------------------|
  11302. * | htt_tlv_hdr_t |
  11303. * |-------------------------------------------------------------------------|
  11304. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11305. * |-------------------------------------------------------------------------|
  11306. *
  11307. * Where:
  11308. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  11309. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  11310. * V (valid) - 1 Bit Bit17
  11311. * CHIPID - 3 Bits
  11312. * TIDMASK - 8 Bits
  11313. * CACHE_SET_NUM - 8 Bits
  11314. *
  11315. * The following field definitions describe the format of the rx MLO peer map
  11316. * messages sent from the target to the host.
  11317. * - MSG_TYPE
  11318. * Bits 7:0
  11319. * Purpose: identifies this as an rx mlo peer map message
  11320. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  11321. *
  11322. * - MLO_PEER_ID
  11323. * Bits 23:8
  11324. * Purpose: The MLO peer ID (index).
  11325. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  11326. * Value: MLO peer ID
  11327. *
  11328. * - NUMLINK
  11329. * Bits: 26:24 (3Bits)
  11330. * Purpose: Indicate the max number of logical links supported per client.
  11331. * Value: number of logical links
  11332. *
  11333. * - PRC
  11334. * Bits: 29:27 (3Bits)
  11335. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  11336. * if there is migration of the primary chip.
  11337. * Value: Primary REO CHIPID
  11338. *
  11339. * - MAC_ADDR_L32
  11340. * Bits 31:0
  11341. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  11342. * Value: lower 4 bytes of peer node's MAC address
  11343. *
  11344. * - MAC_ADDR_U16
  11345. * Bits 15:0
  11346. * Purpose: Identifies which peer node the peer ID is for.
  11347. * Value: upper 2 bytes of peer node's MAC address
  11348. *
  11349. * - PRIMARY_TCL_AST_IDX
  11350. * Bits 15:0
  11351. * Purpose: Primary TCL AST index for this peer.
  11352. *
  11353. * - V
  11354. * 1 Bit Position 16
  11355. * Purpose: If the ast idx is valid.
  11356. *
  11357. * - CHIPID
  11358. * Bits 19:17
  11359. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  11360. *
  11361. * - TIDMASK
  11362. * Bits 27:20
  11363. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  11364. *
  11365. * - CACHE_SET_NUM
  11366. * Bits 31:28
  11367. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  11368. * Cache set number that should be used to cache the index based
  11369. * search results, for address and flow search.
  11370. * This value should be equal to LSB four bits of the hash value
  11371. * of match data, in case of search index points to an entry which
  11372. * may be used in content based search also. The value can be
  11373. * anything when the entry pointed by search index will not be
  11374. * used for content based search.
  11375. *
  11376. * - htt_tlv_hdr_t
  11377. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  11378. *
  11379. * Bits 11:0
  11380. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  11381. *
  11382. * Bits 23:12
  11383. * Purpose: Length, Length of the value that follows the header
  11384. *
  11385. * Bits 31:28
  11386. * Purpose: Reserved.
  11387. *
  11388. *
  11389. * - SW_PEER_ID
  11390. * Bits 15:0
  11391. * Purpose: The peer ID (index) that WAL is allocating
  11392. * Value: (rx) peer ID
  11393. *
  11394. * - VDEV_ID
  11395. * Bits 23:16
  11396. * Purpose: Indicates which virtual device the peer is associated with.
  11397. * Value: vdev ID (used in the host to look up the vdev object)
  11398. *
  11399. * - CHIPID
  11400. * Bits 26:24
  11401. * Purpose: Indicates which Chip id the peer is associated with.
  11402. * Value: chip ID (Provided by Host as part of QMI exchange)
  11403. */
  11404. typedef enum {
  11405. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  11406. } MLO_PEER_MAP_TLV_TAG_ID;
  11407. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  11408. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  11409. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  11410. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  11411. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  11412. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  11413. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11414. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  11415. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  11416. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  11417. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  11418. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  11419. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  11420. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  11421. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  11422. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  11423. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  11424. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  11425. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  11426. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  11427. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  11428. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  11429. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  11430. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  11431. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  11432. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  11433. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  11434. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  11435. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  11436. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  11437. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  11438. do { \
  11439. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  11440. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  11441. } while (0)
  11442. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  11443. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  11444. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  11445. do { \
  11446. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  11447. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  11448. } while (0)
  11449. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  11450. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  11451. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  11452. do { \
  11453. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  11454. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  11455. } while (0)
  11456. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  11457. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  11458. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  11459. do { \
  11460. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  11461. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  11462. } while (0)
  11463. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  11464. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  11465. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  11466. do { \
  11467. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  11468. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  11469. } while (0)
  11470. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  11471. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  11472. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  11473. do { \
  11474. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  11475. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  11476. } while (0)
  11477. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  11478. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  11479. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  11480. do { \
  11481. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  11482. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  11483. } while (0)
  11484. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  11485. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  11486. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  11487. do { \
  11488. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  11489. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  11490. } while (0)
  11491. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  11492. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  11493. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  11494. do { \
  11495. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  11496. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  11497. } while (0)
  11498. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  11499. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  11500. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  11501. do { \
  11502. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  11503. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  11504. } while (0)
  11505. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  11506. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  11507. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  11508. do { \
  11509. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  11510. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  11511. } while (0)
  11512. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  11513. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  11514. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  11515. do { \
  11516. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  11517. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  11518. } while (0)
  11519. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  11520. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  11521. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  11522. do { \
  11523. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  11524. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  11525. } while (0)
  11526. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  11527. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  11528. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11529. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  11530. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  11531. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  11532. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  11533. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  11534. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  11535. *
  11536. * The following diagram shows the format of the rx mlo peer unmap message sent
  11537. * from the target to the host.
  11538. *
  11539. * |31 24|23 16|15 8|7 0|
  11540. * |-----------------------------------------------------------------------|
  11541. * | RSVD_24_31 | MLO peer ID | msg type |
  11542. * |-----------------------------------------------------------------------|
  11543. */
  11544. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  11545. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  11546. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  11547. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  11548. /**
  11549. * @brief target -> host message specifying security parameters
  11550. *
  11551. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  11552. *
  11553. * @details
  11554. * The following diagram shows the format of the security specification
  11555. * message sent from the target to the host.
  11556. * This security specification message tells the host whether a PN check is
  11557. * necessary on rx data frames, and if so, how large the PN counter is.
  11558. * This message also tells the host about the security processing to apply
  11559. * to defragmented rx frames - specifically, whether a Message Integrity
  11560. * Check is required, and the Michael key to use.
  11561. *
  11562. * |31 24|23 16|15|14 8|7 0|
  11563. * |-----------------------------------------------------------------------|
  11564. * | peer ID | U| security type | msg type |
  11565. * |-----------------------------------------------------------------------|
  11566. * | Michael Key K0 |
  11567. * |-----------------------------------------------------------------------|
  11568. * | Michael Key K1 |
  11569. * |-----------------------------------------------------------------------|
  11570. * | WAPI RSC Low0 |
  11571. * |-----------------------------------------------------------------------|
  11572. * | WAPI RSC Low1 |
  11573. * |-----------------------------------------------------------------------|
  11574. * | WAPI RSC Hi0 |
  11575. * |-----------------------------------------------------------------------|
  11576. * | WAPI RSC Hi1 |
  11577. * |-----------------------------------------------------------------------|
  11578. *
  11579. * The following field definitions describe the format of the security
  11580. * indication message sent from the target to the host.
  11581. * - MSG_TYPE
  11582. * Bits 7:0
  11583. * Purpose: identifies this as a security specification message
  11584. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  11585. * - SEC_TYPE
  11586. * Bits 14:8
  11587. * Purpose: specifies which type of security applies to the peer
  11588. * Value: htt_sec_type enum value
  11589. * - UNICAST
  11590. * Bit 15
  11591. * Purpose: whether this security is applied to unicast or multicast data
  11592. * Value: 1 -> unicast, 0 -> multicast
  11593. * - PEER_ID
  11594. * Bits 31:16
  11595. * Purpose: The ID number for the peer the security specification is for
  11596. * Value: peer ID
  11597. * - MICHAEL_KEY_K0
  11598. * Bits 31:0
  11599. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  11600. * Value: Michael Key K0 (if security type is TKIP)
  11601. * - MICHAEL_KEY_K1
  11602. * Bits 31:0
  11603. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  11604. * Value: Michael Key K1 (if security type is TKIP)
  11605. * - WAPI_RSC_LOW0
  11606. * Bits 31:0
  11607. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  11608. * Value: WAPI RSC Low0 (if security type is WAPI)
  11609. * - WAPI_RSC_LOW1
  11610. * Bits 31:0
  11611. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  11612. * Value: WAPI RSC Low1 (if security type is WAPI)
  11613. * - WAPI_RSC_HI0
  11614. * Bits 31:0
  11615. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  11616. * Value: WAPI RSC Hi0 (if security type is WAPI)
  11617. * - WAPI_RSC_HI1
  11618. * Bits 31:0
  11619. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  11620. * Value: WAPI RSC Hi1 (if security type is WAPI)
  11621. */
  11622. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  11623. #define HTT_SEC_IND_SEC_TYPE_S 8
  11624. #define HTT_SEC_IND_UNICAST_M 0x00008000
  11625. #define HTT_SEC_IND_UNICAST_S 15
  11626. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  11627. #define HTT_SEC_IND_PEER_ID_S 16
  11628. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  11629. do { \
  11630. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  11631. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  11632. } while (0)
  11633. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  11634. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  11635. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  11636. do { \
  11637. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  11638. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  11639. } while (0)
  11640. #define HTT_SEC_IND_UNICAST_GET(word) \
  11641. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  11642. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  11643. do { \
  11644. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  11645. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  11646. } while (0)
  11647. #define HTT_SEC_IND_PEER_ID_GET(word) \
  11648. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  11649. #define HTT_SEC_IND_BYTES 28
  11650. /**
  11651. * @brief target -> host rx ADDBA / DELBA message definitions
  11652. *
  11653. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  11654. *
  11655. * @details
  11656. * The following diagram shows the format of the rx ADDBA message sent
  11657. * from the target to the host:
  11658. *
  11659. * |31 20|19 16|15 8|7 0|
  11660. * |---------------------------------------------------------------------|
  11661. * | peer ID | TID | window size | msg type |
  11662. * |---------------------------------------------------------------------|
  11663. *
  11664. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  11665. *
  11666. * The following diagram shows the format of the rx DELBA message sent
  11667. * from the target to the host:
  11668. *
  11669. * |31 20|19 16|15 10|9 8|7 0|
  11670. * |---------------------------------------------------------------------|
  11671. * | peer ID | TID | window size | IR| msg type |
  11672. * |---------------------------------------------------------------------|
  11673. *
  11674. * The following field definitions describe the format of the rx ADDBA
  11675. * and DELBA messages sent from the target to the host.
  11676. * - MSG_TYPE
  11677. * Bits 7:0
  11678. * Purpose: identifies this as an rx ADDBA or DELBA message
  11679. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  11680. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  11681. * - IR (initiator / recipient)
  11682. * Bits 9:8 (DELBA only)
  11683. * Purpose: specify whether the DELBA handshake was initiated by the
  11684. * local STA/AP, or by the peer STA/AP
  11685. * Value:
  11686. * 0 - unspecified
  11687. * 1 - initiator (a.k.a. originator)
  11688. * 2 - recipient (a.k.a. responder)
  11689. * 3 - unused / reserved
  11690. * - WIN_SIZE
  11691. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  11692. * Purpose: Specifies the length of the block ack window (max = 64).
  11693. * Value:
  11694. * block ack window length specified by the received ADDBA/DELBA
  11695. * management message.
  11696. * - TID
  11697. * Bits 19:16
  11698. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  11699. * Value:
  11700. * TID specified by the received ADDBA or DELBA management message.
  11701. * - PEER_ID
  11702. * Bits 31:20
  11703. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  11704. * Value:
  11705. * ID (hash value) used by the host for fast, direct lookup of
  11706. * host SW peer info, including rx reorder states.
  11707. */
  11708. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  11709. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  11710. #define HTT_RX_ADDBA_TID_M 0xf0000
  11711. #define HTT_RX_ADDBA_TID_S 16
  11712. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  11713. #define HTT_RX_ADDBA_PEER_ID_S 20
  11714. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  11715. do { \
  11716. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  11717. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  11718. } while (0)
  11719. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  11720. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  11721. #define HTT_RX_ADDBA_TID_SET(word, value) \
  11722. do { \
  11723. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  11724. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  11725. } while (0)
  11726. #define HTT_RX_ADDBA_TID_GET(word) \
  11727. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  11728. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  11729. do { \
  11730. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  11731. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  11732. } while (0)
  11733. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  11734. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  11735. #define HTT_RX_ADDBA_BYTES 4
  11736. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  11737. #define HTT_RX_DELBA_INITIATOR_S 8
  11738. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  11739. #define HTT_RX_DELBA_WIN_SIZE_S 10
  11740. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  11741. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  11742. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  11743. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  11744. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  11745. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  11746. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  11747. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  11748. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  11749. do { \
  11750. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  11751. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  11752. } while (0)
  11753. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  11754. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  11755. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  11756. do { \
  11757. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  11758. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  11759. } while (0)
  11760. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  11761. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  11762. #define HTT_RX_DELBA_BYTES 4
  11763. /**
  11764. * @brief tx queue group information element definition
  11765. *
  11766. * @details
  11767. * The following diagram shows the format of the tx queue group
  11768. * information element, which can be included in target --> host
  11769. * messages to specify the number of tx "credits" (tx descriptors
  11770. * for LL, or tx buffers for HL) available to a particular group
  11771. * of host-side tx queues, and which host-side tx queues belong to
  11772. * the group.
  11773. *
  11774. * |31|30 24|23 16|15|14|13 0|
  11775. * |------------------------------------------------------------------------|
  11776. * | X| reserved | tx queue grp ID | A| S| credit count |
  11777. * |------------------------------------------------------------------------|
  11778. * | vdev ID mask | AC mask |
  11779. * |------------------------------------------------------------------------|
  11780. *
  11781. * The following definitions describe the fields within the tx queue group
  11782. * information element:
  11783. * - credit_count
  11784. * Bits 13:1
  11785. * Purpose: specify how many tx credits are available to the tx queue group
  11786. * Value: An absolute or relative, positive or negative credit value
  11787. * The 'A' bit specifies whether the value is absolute or relative.
  11788. * The 'S' bit specifies whether the value is positive or negative.
  11789. * A negative value can only be relative, not absolute.
  11790. * An absolute value replaces any prior credit value the host has for
  11791. * the tx queue group in question.
  11792. * A relative value is added to the prior credit value the host has for
  11793. * the tx queue group in question.
  11794. * - sign
  11795. * Bit 14
  11796. * Purpose: specify whether the credit count is positive or negative
  11797. * Value: 0 -> positive, 1 -> negative
  11798. * - absolute
  11799. * Bit 15
  11800. * Purpose: specify whether the credit count is absolute or relative
  11801. * Value: 0 -> relative, 1 -> absolute
  11802. * - txq_group_id
  11803. * Bits 23:16
  11804. * Purpose: indicate which tx queue group's credit and/or membership are
  11805. * being specified
  11806. * Value: 0 to max_tx_queue_groups-1
  11807. * - reserved
  11808. * Bits 30:16
  11809. * Value: 0x0
  11810. * - eXtension
  11811. * Bit 31
  11812. * Purpose: specify whether another tx queue group info element follows
  11813. * Value: 0 -> no more tx queue group information elements
  11814. * 1 -> another tx queue group information element immediately follows
  11815. * - ac_mask
  11816. * Bits 15:0
  11817. * Purpose: specify which Access Categories belong to the tx queue group
  11818. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  11819. * the tx queue group.
  11820. * The AC bit-mask values are obtained by left-shifting by the
  11821. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  11822. * - vdev_id_mask
  11823. * Bits 31:16
  11824. * Purpose: specify which vdev's tx queues belong to the tx queue group
  11825. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  11826. * belong to the tx queue group.
  11827. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  11828. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  11829. */
  11830. PREPACK struct htt_txq_group {
  11831. A_UINT32
  11832. credit_count: 14,
  11833. sign: 1,
  11834. absolute: 1,
  11835. tx_queue_group_id: 8,
  11836. reserved0: 7,
  11837. extension: 1;
  11838. A_UINT32
  11839. ac_mask: 16,
  11840. vdev_id_mask: 16;
  11841. } POSTPACK;
  11842. /* first word */
  11843. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  11844. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  11845. #define HTT_TXQ_GROUP_SIGN_S 14
  11846. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  11847. #define HTT_TXQ_GROUP_ABS_S 15
  11848. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  11849. #define HTT_TXQ_GROUP_ID_S 16
  11850. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  11851. #define HTT_TXQ_GROUP_EXT_S 31
  11852. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  11853. /* second word */
  11854. #define HTT_TXQ_GROUP_AC_MASK_S 0
  11855. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  11856. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  11857. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  11858. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  11859. do { \
  11860. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  11861. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  11862. } while (0)
  11863. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  11864. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  11865. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  11866. do { \
  11867. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  11868. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  11869. } while (0)
  11870. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  11871. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  11872. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  11873. do { \
  11874. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  11875. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  11876. } while (0)
  11877. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  11878. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  11879. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  11880. do { \
  11881. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  11882. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  11883. } while (0)
  11884. #define HTT_TXQ_GROUP_ID_GET(_info) \
  11885. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  11886. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  11887. do { \
  11888. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  11889. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  11890. } while (0)
  11891. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  11892. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  11893. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  11894. do { \
  11895. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  11896. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  11897. } while (0)
  11898. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  11899. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  11900. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  11901. do { \
  11902. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  11903. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  11904. } while (0)
  11905. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  11906. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  11907. /**
  11908. * @brief target -> host TX completion indication message definition
  11909. *
  11910. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  11911. *
  11912. * @details
  11913. * The following diagram shows the format of the TX completion indication sent
  11914. * from the target to the host
  11915. *
  11916. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  11917. * |-------------------------------------------------------------------|
  11918. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  11919. * |-------------------------------------------------------------------|
  11920. * payload:| MSDU1 ID | MSDU0 ID |
  11921. * |-------------------------------------------------------------------|
  11922. * : MSDU3 ID | MSDU2 ID :
  11923. * |-------------------------------------------------------------------|
  11924. * | struct htt_tx_compl_ind_append_retries |
  11925. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11926. * | struct htt_tx_compl_ind_append_tx_tstamp |
  11927. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11928. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  11929. * |-------------------------------------------------------------------|
  11930. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  11931. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11932. * | MSDU0 tx_tsf64_low |
  11933. * |-------------------------------------------------------------------|
  11934. * | MSDU0 tx_tsf64_high |
  11935. * |-------------------------------------------------------------------|
  11936. * | MSDU1 tx_tsf64_low |
  11937. * |-------------------------------------------------------------------|
  11938. * | MSDU1 tx_tsf64_high |
  11939. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11940. * | phy_timestamp |
  11941. * |-------------------------------------------------------------------|
  11942. * | rate specs (see below) |
  11943. * |-------------------------------------------------------------------|
  11944. * | seqctrl | framectrl |
  11945. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11946. * Where:
  11947. * A0 = append (a.k.a. append0)
  11948. * A1 = append1
  11949. * TP = MSDU tx power presence
  11950. * A2 = append2
  11951. * A3 = append3
  11952. * A4 = append4
  11953. *
  11954. * The following field definitions describe the format of the TX completion
  11955. * indication sent from the target to the host
  11956. * Header fields:
  11957. * - msg_type
  11958. * Bits 7:0
  11959. * Purpose: identifies this as HTT TX completion indication
  11960. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  11961. * - status
  11962. * Bits 10:8
  11963. * Purpose: the TX completion status of payload fragmentations descriptors
  11964. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  11965. * - tid
  11966. * Bits 14:11
  11967. * Purpose: the tid associated with those fragmentation descriptors. It is
  11968. * valid or not, depending on the tid_invalid bit.
  11969. * Value: 0 to 15
  11970. * - tid_invalid
  11971. * Bits 15:15
  11972. * Purpose: this bit indicates whether the tid field is valid or not
  11973. * Value: 0 indicates valid; 1 indicates invalid
  11974. * - num
  11975. * Bits 23:16
  11976. * Purpose: the number of payload in this indication
  11977. * Value: 1 to 255
  11978. * - append (a.k.a. append0)
  11979. * Bits 24:24
  11980. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  11981. * the number of tx retries for one MSDU at the end of this message
  11982. * Value: 0 indicates no appending; 1 indicates appending
  11983. * - append1
  11984. * Bits 25:25
  11985. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  11986. * contains the timestamp info for each TX msdu id in payload.
  11987. * The order of the timestamps matches the order of the MSDU IDs.
  11988. * Note that a big-endian host needs to account for the reordering
  11989. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  11990. * conversion) when determining which tx timestamp corresponds to
  11991. * which MSDU ID.
  11992. * Value: 0 indicates no appending; 1 indicates appending
  11993. * - msdu_tx_power_presence
  11994. * Bits 26:26
  11995. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  11996. * for each MSDU referenced by the TX_COMPL_IND message.
  11997. * The tx power is reported in 0.5 dBm units.
  11998. * The order of the per-MSDU tx power reports matches the order
  11999. * of the MSDU IDs.
  12000. * Note that a big-endian host needs to account for the reordering
  12001. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12002. * conversion) when determining which Tx Power corresponds to
  12003. * which MSDU ID.
  12004. * Value: 0 indicates MSDU tx power reports are not appended,
  12005. * 1 indicates MSDU tx power reports are appended
  12006. * - append2
  12007. * Bits 27:27
  12008. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  12009. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  12010. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  12011. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  12012. * for each MSDU, for convenience.
  12013. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  12014. * this append2 bit is set).
  12015. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  12016. * dB above the noise floor.
  12017. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  12018. * 1 indicates MSDU ACK RSSI values are appended.
  12019. * - append3
  12020. * Bits 28:28
  12021. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  12022. * contains the tx tsf info based on wlan global TSF for
  12023. * each TX msdu id in payload.
  12024. * The order of the tx tsf matches the order of the MSDU IDs.
  12025. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  12026. * values to indicate the the lower 32 bits and higher 32 bits of
  12027. * the tx tsf.
  12028. * The tx_tsf64 here represents the time MSDU was acked and the
  12029. * tx_tsf64 has microseconds units.
  12030. * Value: 0 indicates no appending; 1 indicates appending
  12031. * - append4
  12032. * Bits 29:29
  12033. * Purpose: Indicate whether data frame control fields and fields required
  12034. * for radio tap header are appended for each MSDU in TX_COMP_IND
  12035. * message. The order of the this message matches the order of
  12036. * the MSDU IDs.
  12037. * Value: 0 indicates frame control fields and fields required for
  12038. * radio tap header values are not appended,
  12039. * 1 indicates frame control fields and fields required for
  12040. * radio tap header values are appended.
  12041. * Payload fields:
  12042. * - hmsdu_id
  12043. * Bits 15:0
  12044. * Purpose: this ID is used to track the Tx buffer in host
  12045. * Value: 0 to "size of host MSDU descriptor pool - 1"
  12046. */
  12047. PREPACK struct htt_tx_data_hdr_information {
  12048. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  12049. A_UINT32 /* word 1 */
  12050. /* preamble:
  12051. * 0-OFDM,
  12052. * 1-CCk,
  12053. * 2-HT,
  12054. * 3-VHT
  12055. */
  12056. preamble: 2, /* [1:0] */
  12057. /* mcs:
  12058. * In case of HT preamble interpret
  12059. * MCS along with NSS.
  12060. * Valid values for HT are 0 to 7.
  12061. * HT mcs 0 with NSS 2 is mcs 8.
  12062. * Valid values for VHT are 0 to 9.
  12063. */
  12064. mcs: 4, /* [5:2] */
  12065. /* rate:
  12066. * This is applicable only for
  12067. * CCK and OFDM preamble type
  12068. * rate 0: OFDM 48 Mbps,
  12069. * 1: OFDM 24 Mbps,
  12070. * 2: OFDM 12 Mbps
  12071. * 3: OFDM 6 Mbps
  12072. * 4: OFDM 54 Mbps
  12073. * 5: OFDM 36 Mbps
  12074. * 6: OFDM 18 Mbps
  12075. * 7: OFDM 9 Mbps
  12076. * rate 0: CCK 11 Mbps Long
  12077. * 1: CCK 5.5 Mbps Long
  12078. * 2: CCK 2 Mbps Long
  12079. * 3: CCK 1 Mbps Long
  12080. * 4: CCK 11 Mbps Short
  12081. * 5: CCK 5.5 Mbps Short
  12082. * 6: CCK 2 Mbps Short
  12083. */
  12084. rate : 3, /* [ 8: 6] */
  12085. rssi : 8, /* [16: 9] units=dBm */
  12086. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  12087. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  12088. stbc : 1, /* [22] */
  12089. sgi : 1, /* [23] */
  12090. ldpc : 1, /* [24] */
  12091. beamformed: 1, /* [25] */
  12092. /* tx_retry_cnt:
  12093. * Indicates retry count of data tx frames provided by the host.
  12094. */
  12095. tx_retry_cnt: 6; /* [31:26] */
  12096. A_UINT32 /* word 2 */
  12097. framectrl:16, /* [15: 0] */
  12098. seqno:16; /* [31:16] */
  12099. } POSTPACK;
  12100. #define HTT_TX_COMPL_IND_STATUS_S 8
  12101. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  12102. #define HTT_TX_COMPL_IND_TID_S 11
  12103. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  12104. #define HTT_TX_COMPL_IND_TID_INV_S 15
  12105. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  12106. #define HTT_TX_COMPL_IND_NUM_S 16
  12107. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  12108. #define HTT_TX_COMPL_IND_APPEND_S 24
  12109. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  12110. #define HTT_TX_COMPL_IND_APPEND1_S 25
  12111. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  12112. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  12113. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  12114. #define HTT_TX_COMPL_IND_APPEND2_S 27
  12115. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  12116. #define HTT_TX_COMPL_IND_APPEND3_S 28
  12117. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  12118. #define HTT_TX_COMPL_IND_APPEND4_S 29
  12119. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  12120. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  12121. do { \
  12122. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  12123. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  12124. } while (0)
  12125. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  12126. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  12127. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  12128. do { \
  12129. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  12130. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  12131. } while (0)
  12132. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  12133. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  12134. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  12135. do { \
  12136. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  12137. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  12138. } while (0)
  12139. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  12140. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  12141. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  12142. do { \
  12143. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  12144. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  12145. } while (0)
  12146. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  12147. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  12148. HTT_TX_COMPL_IND_TID_INV_S)
  12149. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  12150. do { \
  12151. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  12152. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  12153. } while (0)
  12154. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  12155. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  12156. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  12157. do { \
  12158. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  12159. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  12160. } while (0)
  12161. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  12162. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  12163. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  12164. do { \
  12165. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  12166. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  12167. } while (0)
  12168. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  12169. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  12170. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  12171. do { \
  12172. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  12173. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  12174. } while (0)
  12175. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  12176. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  12177. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  12178. do { \
  12179. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  12180. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  12181. } while (0)
  12182. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  12183. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  12184. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  12185. do { \
  12186. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  12187. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  12188. } while (0)
  12189. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  12190. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  12191. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  12192. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  12193. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  12194. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  12195. #define HTT_TX_COMPL_IND_STAT_OK 0
  12196. /* DISCARD:
  12197. * current meaning:
  12198. * MSDUs were queued for transmission but filtered by HW or SW
  12199. * without any over the air attempts
  12200. * legacy meaning (HL Rome):
  12201. * MSDUs were discarded by the target FW without any over the air
  12202. * attempts due to lack of space
  12203. */
  12204. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  12205. /* NO_ACK:
  12206. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  12207. */
  12208. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  12209. /* POSTPONE:
  12210. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  12211. * be downloaded again later (in the appropriate order), when they are
  12212. * deliverable.
  12213. */
  12214. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  12215. /*
  12216. * The PEER_DEL tx completion status is used for HL cases
  12217. * where the peer the frame is for has been deleted.
  12218. * The host has already discarded its copy of the frame, but
  12219. * it still needs the tx completion to restore its credit.
  12220. */
  12221. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  12222. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  12223. #define HTT_TX_COMPL_IND_STAT_DROP 5
  12224. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  12225. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  12226. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  12227. PREPACK struct htt_tx_compl_ind_base {
  12228. A_UINT32 hdr;
  12229. A_UINT16 payload[1/*or more*/];
  12230. } POSTPACK;
  12231. PREPACK struct htt_tx_compl_ind_append_retries {
  12232. A_UINT16 msdu_id;
  12233. A_UINT8 tx_retries;
  12234. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  12235. 0: this is the last append_retries struct */
  12236. } POSTPACK;
  12237. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  12238. A_UINT32 timestamp[1/*or more*/];
  12239. } POSTPACK;
  12240. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  12241. A_UINT32 tx_tsf64_low;
  12242. A_UINT32 tx_tsf64_high;
  12243. } POSTPACK;
  12244. /* htt_tx_data_hdr_information payload extension fields: */
  12245. /* DWORD zero */
  12246. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  12247. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  12248. /* DWORD one */
  12249. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  12250. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  12251. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  12252. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  12253. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  12254. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  12255. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  12256. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  12257. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  12258. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  12259. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  12260. #define HTT_FW_TX_DATA_HDR_BW_S 19
  12261. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  12262. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  12263. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  12264. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  12265. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  12266. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  12267. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  12268. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  12269. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  12270. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  12271. /* DWORD two */
  12272. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  12273. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  12274. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  12275. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  12276. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  12277. do { \
  12278. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  12279. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  12280. } while (0)
  12281. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  12282. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  12283. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  12284. do { \
  12285. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  12286. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  12287. } while (0)
  12288. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  12289. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  12290. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  12291. do { \
  12292. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  12293. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  12294. } while (0)
  12295. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  12296. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  12297. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  12298. do { \
  12299. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  12300. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  12301. } while (0)
  12302. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  12303. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  12304. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  12305. do { \
  12306. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  12307. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  12308. } while (0)
  12309. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  12310. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  12311. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  12312. do { \
  12313. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  12314. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  12315. } while (0)
  12316. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  12317. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  12318. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  12319. do { \
  12320. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  12321. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  12322. } while (0)
  12323. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  12324. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  12325. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  12326. do { \
  12327. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  12328. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  12329. } while (0)
  12330. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  12331. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  12332. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  12333. do { \
  12334. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  12335. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  12336. } while (0)
  12337. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  12338. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  12339. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  12340. do { \
  12341. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  12342. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  12343. } while (0)
  12344. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  12345. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  12346. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  12347. do { \
  12348. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  12349. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  12350. } while (0)
  12351. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  12352. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  12353. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  12354. do { \
  12355. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  12356. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  12357. } while (0)
  12358. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  12359. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  12360. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  12361. do { \
  12362. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  12363. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  12364. } while (0)
  12365. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  12366. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  12367. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  12368. do { \
  12369. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  12370. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  12371. } while (0)
  12372. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  12373. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  12374. /**
  12375. * @brief target -> host rate-control update indication message
  12376. *
  12377. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  12378. *
  12379. * @details
  12380. * The following diagram shows the format of the RC Update message
  12381. * sent from the target to the host, while processing the tx-completion
  12382. * of a transmitted PPDU.
  12383. *
  12384. * |31 24|23 16|15 8|7 0|
  12385. * |-------------------------------------------------------------|
  12386. * | peer ID | vdev ID | msg_type |
  12387. * |-------------------------------------------------------------|
  12388. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12389. * |-------------------------------------------------------------|
  12390. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  12391. * |-------------------------------------------------------------|
  12392. * | : |
  12393. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12394. * | : |
  12395. * |-------------------------------------------------------------|
  12396. * | : |
  12397. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12398. * | : |
  12399. * |-------------------------------------------------------------|
  12400. * : :
  12401. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12402. *
  12403. */
  12404. typedef struct {
  12405. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  12406. A_UINT32 rate_code_flags;
  12407. A_UINT32 flags; /* Encodes information such as excessive
  12408. retransmission, aggregate, some info
  12409. from .11 frame control,
  12410. STBC, LDPC, (SGI and Tx Chain Mask
  12411. are encoded in ptx_rc->flags field),
  12412. AMPDU truncation (BT/time based etc.),
  12413. RTS/CTS attempt */
  12414. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  12415. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  12416. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  12417. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  12418. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  12419. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  12420. } HTT_RC_TX_DONE_PARAMS;
  12421. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  12422. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  12423. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  12424. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  12425. #define HTT_RC_UPDATE_VDEVID_S 8
  12426. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  12427. #define HTT_RC_UPDATE_PEERID_S 16
  12428. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  12429. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  12430. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  12431. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  12432. do { \
  12433. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  12434. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  12435. } while (0)
  12436. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  12437. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  12438. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  12439. do { \
  12440. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  12441. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  12442. } while (0)
  12443. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  12444. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  12445. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  12446. do { \
  12447. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  12448. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  12449. } while (0)
  12450. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  12451. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  12452. /**
  12453. * @brief target -> host rx fragment indication message definition
  12454. *
  12455. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  12456. *
  12457. * @details
  12458. * The following field definitions describe the format of the rx fragment
  12459. * indication message sent from the target to the host.
  12460. * The rx fragment indication message shares the format of the
  12461. * rx indication message, but not all fields from the rx indication message
  12462. * are relevant to the rx fragment indication message.
  12463. *
  12464. *
  12465. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  12466. * |-----------+-------------------+---------------------+-------------|
  12467. * | peer ID | |FV| ext TID | msg type |
  12468. * |-------------------------------------------------------------------|
  12469. * | | flush | flush |
  12470. * | | end | start |
  12471. * | | seq num | seq num |
  12472. * |-------------------------------------------------------------------|
  12473. * | reserved | FW rx desc bytes |
  12474. * |-------------------------------------------------------------------|
  12475. * | | FW MSDU Rx |
  12476. * | | desc B0 |
  12477. * |-------------------------------------------------------------------|
  12478. * Header fields:
  12479. * - MSG_TYPE
  12480. * Bits 7:0
  12481. * Purpose: identifies this as an rx fragment indication message
  12482. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  12483. * - EXT_TID
  12484. * Bits 12:8
  12485. * Purpose: identify the traffic ID of the rx data, including
  12486. * special "extended" TID values for multicast, broadcast, and
  12487. * non-QoS data frames
  12488. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  12489. * - FLUSH_VALID (FV)
  12490. * Bit 13
  12491. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  12492. * is valid
  12493. * Value:
  12494. * 1 -> flush IE is valid and needs to be processed
  12495. * 0 -> flush IE is not valid and should be ignored
  12496. * - PEER_ID
  12497. * Bits 31:16
  12498. * Purpose: Identify, by ID, which peer sent the rx data
  12499. * Value: ID of the peer who sent the rx data
  12500. * - FLUSH_SEQ_NUM_START
  12501. * Bits 5:0
  12502. * Purpose: Indicate the start of a series of MPDUs to flush
  12503. * Not all MPDUs within this series are necessarily valid - the host
  12504. * must check each sequence number within this range to see if the
  12505. * corresponding MPDU is actually present.
  12506. * This field is only valid if the FV bit is set.
  12507. * Value:
  12508. * The sequence number for the first MPDUs to check to flush.
  12509. * The sequence number is masked by 0x3f.
  12510. * - FLUSH_SEQ_NUM_END
  12511. * Bits 11:6
  12512. * Purpose: Indicate the end of a series of MPDUs to flush
  12513. * Value:
  12514. * The sequence number one larger than the sequence number of the
  12515. * last MPDU to check to flush.
  12516. * The sequence number is masked by 0x3f.
  12517. * Not all MPDUs within this series are necessarily valid - the host
  12518. * must check each sequence number within this range to see if the
  12519. * corresponding MPDU is actually present.
  12520. * This field is only valid if the FV bit is set.
  12521. * Rx descriptor fields:
  12522. * - FW_RX_DESC_BYTES
  12523. * Bits 15:0
  12524. * Purpose: Indicate how many bytes in the Rx indication are used for
  12525. * FW Rx descriptors
  12526. * Value: 1
  12527. */
  12528. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  12529. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  12530. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  12531. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  12532. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  12533. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  12534. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  12535. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  12536. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  12537. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  12538. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  12539. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  12540. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  12541. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  12542. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  12543. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  12544. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  12545. #define HTT_RX_FRAG_IND_BYTES \
  12546. (4 /* msg hdr */ + \
  12547. 4 /* flush spec */ + \
  12548. 4 /* (unused) FW rx desc bytes spec */ + \
  12549. 4 /* FW rx desc */)
  12550. /**
  12551. * @brief target -> host test message definition
  12552. *
  12553. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  12554. *
  12555. * @details
  12556. * The following field definitions describe the format of the test
  12557. * message sent from the target to the host.
  12558. * The message consists of a 4-octet header, followed by a variable
  12559. * number of 32-bit integer values, followed by a variable number
  12560. * of 8-bit character values.
  12561. *
  12562. * |31 16|15 8|7 0|
  12563. * |-----------------------------------------------------------|
  12564. * | num chars | num ints | msg type |
  12565. * |-----------------------------------------------------------|
  12566. * | int 0 |
  12567. * |-----------------------------------------------------------|
  12568. * | int 1 |
  12569. * |-----------------------------------------------------------|
  12570. * | ... |
  12571. * |-----------------------------------------------------------|
  12572. * | char 3 | char 2 | char 1 | char 0 |
  12573. * |-----------------------------------------------------------|
  12574. * | | | ... | char 4 |
  12575. * |-----------------------------------------------------------|
  12576. * - MSG_TYPE
  12577. * Bits 7:0
  12578. * Purpose: identifies this as a test message
  12579. * Value: HTT_MSG_TYPE_TEST
  12580. * - NUM_INTS
  12581. * Bits 15:8
  12582. * Purpose: indicate how many 32-bit integers follow the message header
  12583. * - NUM_CHARS
  12584. * Bits 31:16
  12585. * Purpose: indicate how many 8-bit charaters follow the series of integers
  12586. */
  12587. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  12588. #define HTT_RX_TEST_NUM_INTS_S 8
  12589. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  12590. #define HTT_RX_TEST_NUM_CHARS_S 16
  12591. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  12592. do { \
  12593. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  12594. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  12595. } while (0)
  12596. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  12597. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  12598. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  12599. do { \
  12600. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  12601. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  12602. } while (0)
  12603. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  12604. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  12605. /**
  12606. * @brief target -> host packet log message
  12607. *
  12608. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  12609. *
  12610. * @details
  12611. * The following field definitions describe the format of the packet log
  12612. * message sent from the target to the host.
  12613. * The message consists of a 4-octet header,followed by a variable number
  12614. * of 32-bit character values.
  12615. *
  12616. * |31 16|15 12|11 10|9 8|7 0|
  12617. * |------------------------------------------------------------------|
  12618. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  12619. * |------------------------------------------------------------------|
  12620. * | payload |
  12621. * |------------------------------------------------------------------|
  12622. * - MSG_TYPE
  12623. * Bits 7:0
  12624. * Purpose: identifies this as a pktlog message
  12625. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  12626. * - mac_id
  12627. * Bits 9:8
  12628. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  12629. * Value: 0-3
  12630. * - pdev_id
  12631. * Bits 11:10
  12632. * Purpose: pdev_id
  12633. * Value: 0-3
  12634. * 0 (for rings at SOC level),
  12635. * 1/2/3 PDEV -> 0/1/2
  12636. * - payload_size
  12637. * Bits 31:16
  12638. * Purpose: explicitly specify the payload size
  12639. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  12640. */
  12641. PREPACK struct htt_pktlog_msg {
  12642. A_UINT32 header;
  12643. A_UINT32 payload[1/* or more */];
  12644. } POSTPACK;
  12645. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  12646. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  12647. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  12648. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  12649. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  12650. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  12651. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  12652. do { \
  12653. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  12654. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  12655. } while (0)
  12656. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  12657. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  12658. HTT_T2H_PKTLOG_MAC_ID_S)
  12659. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  12660. do { \
  12661. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  12662. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  12663. } while (0)
  12664. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  12665. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  12666. HTT_T2H_PKTLOG_PDEV_ID_S)
  12667. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  12668. do { \
  12669. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  12670. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  12671. } while (0)
  12672. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  12673. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  12674. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  12675. /*
  12676. * Rx reorder statistics
  12677. * NB: all the fields must be defined in 4 octets size.
  12678. */
  12679. struct rx_reorder_stats {
  12680. /* Non QoS MPDUs received */
  12681. A_UINT32 deliver_non_qos;
  12682. /* MPDUs received in-order */
  12683. A_UINT32 deliver_in_order;
  12684. /* Flush due to reorder timer expired */
  12685. A_UINT32 deliver_flush_timeout;
  12686. /* Flush due to move out of window */
  12687. A_UINT32 deliver_flush_oow;
  12688. /* Flush due to DELBA */
  12689. A_UINT32 deliver_flush_delba;
  12690. /* MPDUs dropped due to FCS error */
  12691. A_UINT32 fcs_error;
  12692. /* MPDUs dropped due to monitor mode non-data packet */
  12693. A_UINT32 mgmt_ctrl;
  12694. /* Unicast-data MPDUs dropped due to invalid peer */
  12695. A_UINT32 invalid_peer;
  12696. /* MPDUs dropped due to duplication (non aggregation) */
  12697. A_UINT32 dup_non_aggr;
  12698. /* MPDUs dropped due to processed before */
  12699. A_UINT32 dup_past;
  12700. /* MPDUs dropped due to duplicate in reorder queue */
  12701. A_UINT32 dup_in_reorder;
  12702. /* Reorder timeout happened */
  12703. A_UINT32 reorder_timeout;
  12704. /* invalid bar ssn */
  12705. A_UINT32 invalid_bar_ssn;
  12706. /* reorder reset due to bar ssn */
  12707. A_UINT32 ssn_reset;
  12708. /* Flush due to delete peer */
  12709. A_UINT32 deliver_flush_delpeer;
  12710. /* Flush due to offload*/
  12711. A_UINT32 deliver_flush_offload;
  12712. /* Flush due to out of buffer*/
  12713. A_UINT32 deliver_flush_oob;
  12714. /* MPDUs dropped due to PN check fail */
  12715. A_UINT32 pn_fail;
  12716. /* MPDUs dropped due to unable to allocate memory */
  12717. A_UINT32 store_fail;
  12718. /* Number of times the tid pool alloc succeeded */
  12719. A_UINT32 tid_pool_alloc_succ;
  12720. /* Number of times the MPDU pool alloc succeeded */
  12721. A_UINT32 mpdu_pool_alloc_succ;
  12722. /* Number of times the MSDU pool alloc succeeded */
  12723. A_UINT32 msdu_pool_alloc_succ;
  12724. /* Number of times the tid pool alloc failed */
  12725. A_UINT32 tid_pool_alloc_fail;
  12726. /* Number of times the MPDU pool alloc failed */
  12727. A_UINT32 mpdu_pool_alloc_fail;
  12728. /* Number of times the MSDU pool alloc failed */
  12729. A_UINT32 msdu_pool_alloc_fail;
  12730. /* Number of times the tid pool freed */
  12731. A_UINT32 tid_pool_free;
  12732. /* Number of times the MPDU pool freed */
  12733. A_UINT32 mpdu_pool_free;
  12734. /* Number of times the MSDU pool freed */
  12735. A_UINT32 msdu_pool_free;
  12736. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  12737. A_UINT32 msdu_queued;
  12738. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  12739. A_UINT32 msdu_recycled;
  12740. /* Number of MPDUs with invalid peer but A2 found in AST */
  12741. A_UINT32 invalid_peer_a2_in_ast;
  12742. /* Number of MPDUs with invalid peer but A3 found in AST */
  12743. A_UINT32 invalid_peer_a3_in_ast;
  12744. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  12745. A_UINT32 invalid_peer_bmc_mpdus;
  12746. /* Number of MSDUs with err attention word */
  12747. A_UINT32 rxdesc_err_att;
  12748. /* Number of MSDUs with flag of peer_idx_invalid */
  12749. A_UINT32 rxdesc_err_peer_idx_inv;
  12750. /* Number of MSDUs with flag of peer_idx_timeout */
  12751. A_UINT32 rxdesc_err_peer_idx_to;
  12752. /* Number of MSDUs with flag of overflow */
  12753. A_UINT32 rxdesc_err_ov;
  12754. /* Number of MSDUs with flag of msdu_length_err */
  12755. A_UINT32 rxdesc_err_msdu_len;
  12756. /* Number of MSDUs with flag of mpdu_length_err */
  12757. A_UINT32 rxdesc_err_mpdu_len;
  12758. /* Number of MSDUs with flag of tkip_mic_err */
  12759. A_UINT32 rxdesc_err_tkip_mic;
  12760. /* Number of MSDUs with flag of decrypt_err */
  12761. A_UINT32 rxdesc_err_decrypt;
  12762. /* Number of MSDUs with flag of fcs_err */
  12763. A_UINT32 rxdesc_err_fcs;
  12764. /* Number of Unicast (bc_mc bit is not set in attention word)
  12765. * frames with invalid peer handler
  12766. */
  12767. A_UINT32 rxdesc_uc_msdus_inv_peer;
  12768. /* Number of unicast frame directly (direct bit is set in attention word)
  12769. * to DUT with invalid peer handler
  12770. */
  12771. A_UINT32 rxdesc_direct_msdus_inv_peer;
  12772. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  12773. * frames with invalid peer handler
  12774. */
  12775. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  12776. /* Number of MSDUs dropped due to no first MSDU flag */
  12777. A_UINT32 rxdesc_no_1st_msdu;
  12778. /* Number of MSDUs droped due to ring overflow */
  12779. A_UINT32 msdu_drop_ring_ov;
  12780. /* Number of MSDUs dropped due to FC mismatch */
  12781. A_UINT32 msdu_drop_fc_mismatch;
  12782. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  12783. A_UINT32 msdu_drop_mgmt_remote_ring;
  12784. /* Number of MSDUs dropped due to errors not reported in attention word */
  12785. A_UINT32 msdu_drop_misc;
  12786. /* Number of MSDUs go to offload before reorder */
  12787. A_UINT32 offload_msdu_wal;
  12788. /* Number of data frame dropped by offload after reorder */
  12789. A_UINT32 offload_msdu_reorder;
  12790. /* Number of MPDUs with sequence number in the past and within the BA window */
  12791. A_UINT32 dup_past_within_window;
  12792. /* Number of MPDUs with sequence number in the past and outside the BA window */
  12793. A_UINT32 dup_past_outside_window;
  12794. /* Number of MSDUs with decrypt/MIC error */
  12795. A_UINT32 rxdesc_err_decrypt_mic;
  12796. /* Number of data MSDUs received on both local and remote rings */
  12797. A_UINT32 data_msdus_on_both_rings;
  12798. /* MPDUs never filled */
  12799. A_UINT32 holes_not_filled;
  12800. };
  12801. /*
  12802. * Rx Remote buffer statistics
  12803. * NB: all the fields must be defined in 4 octets size.
  12804. */
  12805. struct rx_remote_buffer_mgmt_stats {
  12806. /* Total number of MSDUs reaped for Rx processing */
  12807. A_UINT32 remote_reaped;
  12808. /* MSDUs recycled within firmware */
  12809. A_UINT32 remote_recycled;
  12810. /* MSDUs stored by Data Rx */
  12811. A_UINT32 data_rx_msdus_stored;
  12812. /* Number of HTT indications from WAL Rx MSDU */
  12813. A_UINT32 wal_rx_ind;
  12814. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  12815. A_UINT32 wal_rx_ind_unconsumed;
  12816. /* Number of HTT indications from Data Rx MSDU */
  12817. A_UINT32 data_rx_ind;
  12818. /* Number of unconsumed HTT indications from Data Rx MSDU */
  12819. A_UINT32 data_rx_ind_unconsumed;
  12820. /* Number of HTT indications from ATHBUF */
  12821. A_UINT32 athbuf_rx_ind;
  12822. /* Number of remote buffers requested for refill */
  12823. A_UINT32 refill_buf_req;
  12824. /* Number of remote buffers filled by the host */
  12825. A_UINT32 refill_buf_rsp;
  12826. /* Number of times MAC hw_index = f/w write_index */
  12827. A_INT32 mac_no_bufs;
  12828. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  12829. A_INT32 fw_indices_equal;
  12830. /* Number of times f/w finds no buffers to post */
  12831. A_INT32 host_no_bufs;
  12832. };
  12833. /*
  12834. * TXBF MU/SU packets and NDPA statistics
  12835. * NB: all the fields must be defined in 4 octets size.
  12836. */
  12837. struct rx_txbf_musu_ndpa_pkts_stats {
  12838. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  12839. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  12840. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  12841. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  12842. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  12843. A_UINT32 reserved[3]; /* must be set to 0x0 */
  12844. };
  12845. /*
  12846. * htt_dbg_stats_status -
  12847. * present - The requested stats have been delivered in full.
  12848. * This indicates that either the stats information was contained
  12849. * in its entirety within this message, or else this message
  12850. * completes the delivery of the requested stats info that was
  12851. * partially delivered through earlier STATS_CONF messages.
  12852. * partial - The requested stats have been delivered in part.
  12853. * One or more subsequent STATS_CONF messages with the same
  12854. * cookie value will be sent to deliver the remainder of the
  12855. * information.
  12856. * error - The requested stats could not be delivered, for example due
  12857. * to a shortage of memory to construct a message holding the
  12858. * requested stats.
  12859. * invalid - The requested stat type is either not recognized, or the
  12860. * target is configured to not gather the stats type in question.
  12861. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12862. * series_done - This special value indicates that no further stats info
  12863. * elements are present within a series of stats info elems
  12864. * (within a stats upload confirmation message).
  12865. */
  12866. enum htt_dbg_stats_status {
  12867. HTT_DBG_STATS_STATUS_PRESENT = 0,
  12868. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  12869. HTT_DBG_STATS_STATUS_ERROR = 2,
  12870. HTT_DBG_STATS_STATUS_INVALID = 3,
  12871. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  12872. };
  12873. /**
  12874. * @brief target -> host statistics upload
  12875. *
  12876. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  12877. *
  12878. * @details
  12879. * The following field definitions describe the format of the HTT target
  12880. * to host stats upload confirmation message.
  12881. * The message contains a cookie echoed from the HTT host->target stats
  12882. * upload request, which identifies which request the confirmation is
  12883. * for, and a series of tag-length-value stats information elements.
  12884. * The tag-length header for each stats info element also includes a
  12885. * status field, to indicate whether the request for the stat type in
  12886. * question was fully met, partially met, unable to be met, or invalid
  12887. * (if the stat type in question is disabled in the target).
  12888. * A special value of all 1's in this status field is used to indicate
  12889. * the end of the series of stats info elements.
  12890. *
  12891. *
  12892. * |31 16|15 8|7 5|4 0|
  12893. * |------------------------------------------------------------|
  12894. * | reserved | msg type |
  12895. * |------------------------------------------------------------|
  12896. * | cookie LSBs |
  12897. * |------------------------------------------------------------|
  12898. * | cookie MSBs |
  12899. * |------------------------------------------------------------|
  12900. * | stats entry length | reserved | S |stat type|
  12901. * |------------------------------------------------------------|
  12902. * | |
  12903. * | type-specific stats info |
  12904. * | |
  12905. * |------------------------------------------------------------|
  12906. * | stats entry length | reserved | S |stat type|
  12907. * |------------------------------------------------------------|
  12908. * | |
  12909. * | type-specific stats info |
  12910. * | |
  12911. * |------------------------------------------------------------|
  12912. * | n/a | reserved | 111 | n/a |
  12913. * |------------------------------------------------------------|
  12914. * Header fields:
  12915. * - MSG_TYPE
  12916. * Bits 7:0
  12917. * Purpose: identifies this is a statistics upload confirmation message
  12918. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  12919. * - COOKIE_LSBS
  12920. * Bits 31:0
  12921. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12922. * message with its preceding host->target stats request message.
  12923. * Value: LSBs of the opaque cookie specified by the host-side requestor
  12924. * - COOKIE_MSBS
  12925. * Bits 31:0
  12926. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12927. * message with its preceding host->target stats request message.
  12928. * Value: MSBs of the opaque cookie specified by the host-side requestor
  12929. *
  12930. * Stats Information Element tag-length header fields:
  12931. * - STAT_TYPE
  12932. * Bits 4:0
  12933. * Purpose: identifies the type of statistics info held in the
  12934. * following information element
  12935. * Value: htt_dbg_stats_type
  12936. * - STATUS
  12937. * Bits 7:5
  12938. * Purpose: indicate whether the requested stats are present
  12939. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  12940. * the completion of the stats entry series
  12941. * - LENGTH
  12942. * Bits 31:16
  12943. * Purpose: indicate the stats information size
  12944. * Value: This field specifies the number of bytes of stats information
  12945. * that follows the element tag-length header.
  12946. * It is expected but not required that this length is a multiple of
  12947. * 4 bytes. Even if the length is not an integer multiple of 4, the
  12948. * subsequent stats entry header will begin on a 4-byte aligned
  12949. * boundary.
  12950. */
  12951. #define HTT_T2H_STATS_COOKIE_SIZE 8
  12952. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  12953. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  12954. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  12955. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  12956. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  12957. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  12958. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  12959. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  12960. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  12961. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  12962. do { \
  12963. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  12964. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  12965. } while (0)
  12966. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  12967. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  12968. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  12969. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  12970. do { \
  12971. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  12972. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  12973. } while (0)
  12974. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  12975. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  12976. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  12977. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  12978. do { \
  12979. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  12980. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  12981. } while (0)
  12982. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  12983. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  12984. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  12985. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  12986. #define HTT_MAX_AGGR 64
  12987. #define HTT_HL_MAX_AGGR 18
  12988. /**
  12989. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  12990. *
  12991. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  12992. *
  12993. * @details
  12994. * The following field definitions describe the format of the HTT host
  12995. * to target frag_desc/msdu_ext bank configuration message.
  12996. * The message contains the based address and the min and max id of the
  12997. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  12998. * MSDU_EXT/FRAG_DESC.
  12999. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  13000. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  13001. * the hardware does the mapping/translation.
  13002. *
  13003. * Total banks that can be configured is configured to 16.
  13004. *
  13005. * This should be called before any TX has be initiated by the HTT
  13006. *
  13007. * |31 16|15 8|7 5|4 0|
  13008. * |------------------------------------------------------------|
  13009. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  13010. * |------------------------------------------------------------|
  13011. * | BANK0_BASE_ADDRESS (bits 31:0) |
  13012. #if HTT_PADDR64
  13013. * | BANK0_BASE_ADDRESS (bits 63:32) |
  13014. #endif
  13015. * |------------------------------------------------------------|
  13016. * | ... |
  13017. * |------------------------------------------------------------|
  13018. * | BANK15_BASE_ADDRESS (bits 31:0) |
  13019. #if HTT_PADDR64
  13020. * | BANK15_BASE_ADDRESS (bits 63:32) |
  13021. #endif
  13022. * |------------------------------------------------------------|
  13023. * | BANK0_MAX_ID | BANK0_MIN_ID |
  13024. * |------------------------------------------------------------|
  13025. * | ... |
  13026. * |------------------------------------------------------------|
  13027. * | BANK15_MAX_ID | BANK15_MIN_ID |
  13028. * |------------------------------------------------------------|
  13029. * Header fields:
  13030. * - MSG_TYPE
  13031. * Bits 7:0
  13032. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  13033. * for systems with 64-bit format for bus addresses:
  13034. * - BANKx_BASE_ADDRESS_LO
  13035. * Bits 31:0
  13036. * Purpose: Provide a mechanism to specify the base address of the
  13037. * MSDU_EXT bank physical/bus address.
  13038. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  13039. * - BANKx_BASE_ADDRESS_HI
  13040. * Bits 31:0
  13041. * Purpose: Provide a mechanism to specify the base address of the
  13042. * MSDU_EXT bank physical/bus address.
  13043. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  13044. * for systems with 32-bit format for bus addresses:
  13045. * - BANKx_BASE_ADDRESS
  13046. * Bits 31:0
  13047. * Purpose: Provide a mechanism to specify the base address of the
  13048. * MSDU_EXT bank physical/bus address.
  13049. * Value: MSDU_EXT bank physical / bus address
  13050. * - BANKx_MIN_ID
  13051. * Bits 15:0
  13052. * Purpose: Provide a mechanism to specify the min index that needs to
  13053. * mapped.
  13054. * - BANKx_MAX_ID
  13055. * Bits 31:16
  13056. * Purpose: Provide a mechanism to specify the max index that needs to
  13057. * mapped.
  13058. *
  13059. */
  13060. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  13061. * safe value.
  13062. * @note MAX supported banks is 16.
  13063. */
  13064. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  13065. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  13066. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  13067. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  13068. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  13069. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  13070. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  13071. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  13072. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  13073. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  13074. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  13075. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  13076. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  13077. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  13078. do { \
  13079. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  13080. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  13081. } while (0)
  13082. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  13083. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  13084. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  13085. do { \
  13086. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  13087. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  13088. } while (0)
  13089. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  13090. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  13091. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  13092. do { \
  13093. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  13094. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  13095. } while (0)
  13096. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  13097. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  13098. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  13099. do { \
  13100. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  13101. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  13102. } while (0)
  13103. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  13104. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  13105. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  13106. do { \
  13107. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  13108. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  13109. } while (0)
  13110. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  13111. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  13112. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  13113. do { \
  13114. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  13115. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  13116. } while (0)
  13117. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  13118. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  13119. /*
  13120. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  13121. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  13122. * addresses are stored in a XXX-bit field.
  13123. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  13124. * htt_tx_frag_desc64_bank_cfg_t structs.
  13125. */
  13126. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  13127. _paddr_bits_, \
  13128. _paddr__bank_base_address_) \
  13129. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  13130. /** word 0 \
  13131. * msg_type: 8, \
  13132. * pdev_id: 2, \
  13133. * swap: 1, \
  13134. * reserved0: 5, \
  13135. * num_banks: 8, \
  13136. * desc_size: 8; \
  13137. */ \
  13138. A_UINT32 word0; \
  13139. /* \
  13140. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  13141. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  13142. * the second A_UINT32). \
  13143. */ \
  13144. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13145. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13146. } POSTPACK
  13147. /* define htt_tx_frag_desc32_bank_cfg_t */
  13148. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  13149. /* define htt_tx_frag_desc64_bank_cfg_t */
  13150. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  13151. /*
  13152. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  13153. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  13154. */
  13155. #if HTT_PADDR64
  13156. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  13157. #else
  13158. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  13159. #endif
  13160. /**
  13161. * @brief target -> host HTT TX Credit total count update message definition
  13162. *
  13163. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  13164. *
  13165. *|31 16|15|14 9| 8 |7 0 |
  13166. *|---------------------+--+----------+-------+----------|
  13167. *|cur htt credit delta | Q| reserved | sign | msg type |
  13168. *|------------------------------------------------------|
  13169. *
  13170. * Header fields:
  13171. * - MSG_TYPE
  13172. * Bits 7:0
  13173. * Purpose: identifies this as a htt tx credit delta update message
  13174. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  13175. * - SIGN
  13176. * Bits 8
  13177. * identifies whether credit delta is positive or negative
  13178. * Value:
  13179. * - 0x0: credit delta is positive, rebalance in some buffers
  13180. * - 0x1: credit delta is negative, rebalance out some buffers
  13181. * - reserved
  13182. * Bits 14:9
  13183. * Value: 0x0
  13184. * - TXQ_GRP
  13185. * Bit 15
  13186. * Purpose: indicates whether any tx queue group information elements
  13187. * are appended to the tx credit update message
  13188. * Value: 0 -> no tx queue group information element is present
  13189. * 1 -> a tx queue group information element immediately follows
  13190. * - DELTA_COUNT
  13191. * Bits 31:16
  13192. * Purpose: Specify current htt credit delta absolute count
  13193. */
  13194. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  13195. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  13196. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  13197. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  13198. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  13199. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  13200. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  13201. do { \
  13202. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  13203. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  13204. } while (0)
  13205. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  13206. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  13207. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  13208. do { \
  13209. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  13210. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  13211. } while (0)
  13212. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  13213. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  13214. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  13215. do { \
  13216. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  13217. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  13218. } while (0)
  13219. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  13220. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  13221. #define HTT_TX_CREDIT_MSG_BYTES 4
  13222. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  13223. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  13224. /**
  13225. * @brief HTT WDI_IPA Operation Response Message
  13226. *
  13227. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  13228. *
  13229. * @details
  13230. * HTT WDI_IPA Operation Response message is sent by target
  13231. * to host confirming suspend or resume operation.
  13232. * |31 24|23 16|15 8|7 0|
  13233. * |----------------+----------------+----------------+----------------|
  13234. * | op_code | Rsvd | msg_type |
  13235. * |-------------------------------------------------------------------|
  13236. * | Rsvd | Response len |
  13237. * |-------------------------------------------------------------------|
  13238. * | |
  13239. * | Response-type specific info |
  13240. * | |
  13241. * | |
  13242. * |-------------------------------------------------------------------|
  13243. * Header fields:
  13244. * - MSG_TYPE
  13245. * Bits 7:0
  13246. * Purpose: Identifies this as WDI_IPA Operation Response message
  13247. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  13248. * - OP_CODE
  13249. * Bits 31:16
  13250. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  13251. * value: = enum htt_wdi_ipa_op_code
  13252. * - RSP_LEN
  13253. * Bits 16:0
  13254. * Purpose: length for the response-type specific info
  13255. * value: = length in bytes for response-type specific info
  13256. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  13257. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  13258. */
  13259. PREPACK struct htt_wdi_ipa_op_response_t
  13260. {
  13261. /* DWORD 0: flags and meta-data */
  13262. A_UINT32
  13263. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13264. reserved1: 8,
  13265. op_code: 16;
  13266. A_UINT32
  13267. rsp_len: 16,
  13268. reserved2: 16;
  13269. } POSTPACK;
  13270. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  13271. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  13272. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  13273. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  13274. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  13275. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  13276. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  13277. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  13278. do { \
  13279. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  13280. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  13281. } while (0)
  13282. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  13283. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  13284. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  13285. do { \
  13286. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  13287. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  13288. } while (0)
  13289. enum htt_phy_mode {
  13290. htt_phy_mode_11a = 0,
  13291. htt_phy_mode_11g = 1,
  13292. htt_phy_mode_11b = 2,
  13293. htt_phy_mode_11g_only = 3,
  13294. htt_phy_mode_11na_ht20 = 4,
  13295. htt_phy_mode_11ng_ht20 = 5,
  13296. htt_phy_mode_11na_ht40 = 6,
  13297. htt_phy_mode_11ng_ht40 = 7,
  13298. htt_phy_mode_11ac_vht20 = 8,
  13299. htt_phy_mode_11ac_vht40 = 9,
  13300. htt_phy_mode_11ac_vht80 = 10,
  13301. htt_phy_mode_11ac_vht20_2g = 11,
  13302. htt_phy_mode_11ac_vht40_2g = 12,
  13303. htt_phy_mode_11ac_vht80_2g = 13,
  13304. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  13305. htt_phy_mode_11ac_vht160 = 15,
  13306. htt_phy_mode_max,
  13307. };
  13308. /**
  13309. * @brief target -> host HTT channel change indication
  13310. *
  13311. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  13312. *
  13313. * @details
  13314. * Specify when a channel change occurs.
  13315. * This allows the host to precisely determine which rx frames arrived
  13316. * on the old channel and which rx frames arrived on the new channel.
  13317. *
  13318. *|31 |7 0 |
  13319. *|-------------------------------------------+----------|
  13320. *| reserved | msg type |
  13321. *|------------------------------------------------------|
  13322. *| primary_chan_center_freq_mhz |
  13323. *|------------------------------------------------------|
  13324. *| contiguous_chan1_center_freq_mhz |
  13325. *|------------------------------------------------------|
  13326. *| contiguous_chan2_center_freq_mhz |
  13327. *|------------------------------------------------------|
  13328. *| phy_mode |
  13329. *|------------------------------------------------------|
  13330. *
  13331. * Header fields:
  13332. * - MSG_TYPE
  13333. * Bits 7:0
  13334. * Purpose: identifies this as a htt channel change indication message
  13335. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  13336. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  13337. * Bits 31:0
  13338. * Purpose: identify the (center of the) new 20 MHz primary channel
  13339. * Value: center frequency of the 20 MHz primary channel, in MHz units
  13340. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  13341. * Bits 31:0
  13342. * Purpose: identify the (center of the) contiguous frequency range
  13343. * comprising the new channel.
  13344. * For example, if the new channel is a 80 MHz channel extending
  13345. * 60 MHz beyond the primary channel, this field would be 30 larger
  13346. * than the primary channel center frequency field.
  13347. * Value: center frequency of the contiguous frequency range comprising
  13348. * the full channel in MHz units
  13349. * (80+80 channels also use the CONTIG_CHAN2 field)
  13350. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  13351. * Bits 31:0
  13352. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  13353. * within a VHT 80+80 channel.
  13354. * This field is only relevant for VHT 80+80 channels.
  13355. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  13356. * channel (arbitrary value for cases besides VHT 80+80)
  13357. * - PHY_MODE
  13358. * Bits 31:0
  13359. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  13360. * and band
  13361. * Value: htt_phy_mode enum value
  13362. */
  13363. PREPACK struct htt_chan_change_t
  13364. {
  13365. /* DWORD 0: flags and meta-data */
  13366. A_UINT32
  13367. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13368. reserved1: 24;
  13369. A_UINT32 primary_chan_center_freq_mhz;
  13370. A_UINT32 contig_chan1_center_freq_mhz;
  13371. A_UINT32 contig_chan2_center_freq_mhz;
  13372. A_UINT32 phy_mode;
  13373. } POSTPACK;
  13374. /*
  13375. * Due to historical / backwards-compatibility reasons, maintain the
  13376. * below htt_chan_change_msg struct definition, which needs to be
  13377. * consistent with the above htt_chan_change_t struct definition
  13378. * (aside from the htt_chan_change_t definition including the msg_type
  13379. * dword within the message, and the htt_chan_change_msg only containing
  13380. * the payload of the message that follows the msg_type dword).
  13381. */
  13382. PREPACK struct htt_chan_change_msg {
  13383. A_UINT32 chan_mhz; /* frequency in mhz */
  13384. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  13385. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  13386. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  13387. } POSTPACK;
  13388. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  13389. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  13390. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  13391. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  13392. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  13393. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  13394. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  13395. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  13396. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  13397. do { \
  13398. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  13399. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  13400. } while (0)
  13401. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  13402. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  13403. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  13404. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  13405. do { \
  13406. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  13407. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  13408. } while (0)
  13409. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  13410. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  13411. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  13412. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  13413. do { \
  13414. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  13415. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  13416. } while (0)
  13417. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  13418. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  13419. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  13420. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  13421. do { \
  13422. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  13423. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  13424. } while (0)
  13425. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  13426. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  13427. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  13428. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  13429. /**
  13430. * @brief rx offload packet error message
  13431. *
  13432. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  13433. *
  13434. * @details
  13435. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  13436. * of target payload like mic err.
  13437. *
  13438. * |31 24|23 16|15 8|7 0|
  13439. * |----------------+----------------+----------------+----------------|
  13440. * | tid | vdev_id | msg_sub_type | msg_type |
  13441. * |-------------------------------------------------------------------|
  13442. * : (sub-type dependent content) :
  13443. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13444. * Header fields:
  13445. * - msg_type
  13446. * Bits 7:0
  13447. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  13448. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  13449. * - msg_sub_type
  13450. * Bits 15:8
  13451. * Purpose: Identifies which type of rx error is reported by this message
  13452. * value: htt_rx_ofld_pkt_err_type
  13453. * - vdev_id
  13454. * Bits 23:16
  13455. * Purpose: Identifies which vdev received the erroneous rx frame
  13456. * value:
  13457. * - tid
  13458. * Bits 31:24
  13459. * Purpose: Identifies the traffic type of the rx frame
  13460. * value:
  13461. *
  13462. * - The payload fields used if the sub-type == MIC error are shown below.
  13463. * Note - MIC err is per MSDU, while PN is per MPDU.
  13464. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  13465. * with MIC err in A-MSDU case, so FW will send only one HTT message
  13466. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  13467. * instead of sending separate HTT messages for each wrong MSDU within
  13468. * the MPDU.
  13469. *
  13470. * |31 24|23 16|15 8|7 0|
  13471. * |----------------+----------------+----------------+----------------|
  13472. * | Rsvd | key_id | peer_id |
  13473. * |-------------------------------------------------------------------|
  13474. * | receiver MAC addr 31:0 |
  13475. * |-------------------------------------------------------------------|
  13476. * | Rsvd | receiver MAC addr 47:32 |
  13477. * |-------------------------------------------------------------------|
  13478. * | transmitter MAC addr 31:0 |
  13479. * |-------------------------------------------------------------------|
  13480. * | Rsvd | transmitter MAC addr 47:32 |
  13481. * |-------------------------------------------------------------------|
  13482. * | PN 31:0 |
  13483. * |-------------------------------------------------------------------|
  13484. * | Rsvd | PN 47:32 |
  13485. * |-------------------------------------------------------------------|
  13486. * - peer_id
  13487. * Bits 15:0
  13488. * Purpose: identifies which peer is frame is from
  13489. * value:
  13490. * - key_id
  13491. * Bits 23:16
  13492. * Purpose: identifies key_id of rx frame
  13493. * value:
  13494. * - RA_31_0 (receiver MAC addr 31:0)
  13495. * Bits 31:0
  13496. * Purpose: identifies by MAC address which vdev received the frame
  13497. * value: MAC address lower 4 bytes
  13498. * - RA_47_32 (receiver MAC addr 47:32)
  13499. * Bits 15:0
  13500. * Purpose: identifies by MAC address which vdev received the frame
  13501. * value: MAC address upper 2 bytes
  13502. * - TA_31_0 (transmitter MAC addr 31:0)
  13503. * Bits 31:0
  13504. * Purpose: identifies by MAC address which peer transmitted the frame
  13505. * value: MAC address lower 4 bytes
  13506. * - TA_47_32 (transmitter MAC addr 47:32)
  13507. * Bits 15:0
  13508. * Purpose: identifies by MAC address which peer transmitted the frame
  13509. * value: MAC address upper 2 bytes
  13510. * - PN_31_0
  13511. * Bits 31:0
  13512. * Purpose: Identifies pn of rx frame
  13513. * value: PN lower 4 bytes
  13514. * - PN_47_32
  13515. * Bits 15:0
  13516. * Purpose: Identifies pn of rx frame
  13517. * value:
  13518. * TKIP or CCMP: PN upper 2 bytes
  13519. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  13520. */
  13521. enum htt_rx_ofld_pkt_err_type {
  13522. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  13523. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  13524. };
  13525. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  13526. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  13527. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  13528. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  13529. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  13530. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  13531. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  13532. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  13533. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  13534. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  13535. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  13536. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  13537. do { \
  13538. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  13539. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  13540. } while (0)
  13541. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  13542. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  13543. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  13544. do { \
  13545. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  13546. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  13547. } while (0)
  13548. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  13549. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  13550. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  13551. do { \
  13552. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  13553. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  13554. } while (0)
  13555. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  13556. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  13557. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  13558. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  13559. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  13560. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  13561. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  13562. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  13563. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  13564. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  13565. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  13566. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  13567. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  13568. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  13569. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  13570. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  13571. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  13572. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  13573. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  13574. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  13575. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  13576. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  13577. do { \
  13578. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  13579. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  13580. } while (0)
  13581. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  13582. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  13583. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  13584. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  13585. do { \
  13586. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  13587. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  13588. } while (0)
  13589. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  13590. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  13591. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  13592. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  13593. do { \
  13594. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  13595. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  13596. } while (0)
  13597. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  13598. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  13599. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  13600. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  13601. do { \
  13602. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  13603. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  13604. } while (0)
  13605. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  13606. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  13607. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  13608. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  13609. do { \
  13610. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  13611. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  13612. } while (0)
  13613. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  13614. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  13615. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  13616. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  13617. do { \
  13618. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  13619. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  13620. } while (0)
  13621. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  13622. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  13623. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  13624. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  13625. do { \
  13626. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  13627. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  13628. } while (0)
  13629. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  13630. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  13631. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  13632. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  13633. do { \
  13634. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  13635. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  13636. } while (0)
  13637. /**
  13638. * @brief target -> host peer rate report message
  13639. *
  13640. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  13641. *
  13642. * @details
  13643. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  13644. * justified rate of all the peers.
  13645. *
  13646. * |31 24|23 16|15 8|7 0|
  13647. * |----------------+----------------+----------------+----------------|
  13648. * | peer_count | | msg_type |
  13649. * |-------------------------------------------------------------------|
  13650. * : Payload (variant number of peer rate report) :
  13651. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13652. * Header fields:
  13653. * - msg_type
  13654. * Bits 7:0
  13655. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  13656. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  13657. * - reserved
  13658. * Bits 15:8
  13659. * Purpose:
  13660. * value:
  13661. * - peer_count
  13662. * Bits 31:16
  13663. * Purpose: Specify how many peer rate report elements are present in the payload.
  13664. * value:
  13665. *
  13666. * Payload:
  13667. * There are variant number of peer rate report follow the first 32 bits.
  13668. * The peer rate report is defined as follows.
  13669. *
  13670. * |31 20|19 16|15 0|
  13671. * |-----------------------+---------+---------------------------------|-
  13672. * | reserved | phy | peer_id | \
  13673. * |-------------------------------------------------------------------| -> report #0
  13674. * | rate | /
  13675. * |-----------------------+---------+---------------------------------|-
  13676. * | reserved | phy | peer_id | \
  13677. * |-------------------------------------------------------------------| -> report #1
  13678. * | rate | /
  13679. * |-----------------------+---------+---------------------------------|-
  13680. * | reserved | phy | peer_id | \
  13681. * |-------------------------------------------------------------------| -> report #2
  13682. * | rate | /
  13683. * |-------------------------------------------------------------------|-
  13684. * : :
  13685. * : :
  13686. * : :
  13687. * :-------------------------------------------------------------------:
  13688. *
  13689. * - peer_id
  13690. * Bits 15:0
  13691. * Purpose: identify the peer
  13692. * value:
  13693. * - phy
  13694. * Bits 19:16
  13695. * Purpose: identify which phy is in use
  13696. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  13697. * Please see enum htt_peer_report_phy_type for detail.
  13698. * - reserved
  13699. * Bits 31:20
  13700. * Purpose:
  13701. * value:
  13702. * - rate
  13703. * Bits 31:0
  13704. * Purpose: represent the justified rate of the peer specified by peer_id
  13705. * value:
  13706. */
  13707. enum htt_peer_rate_report_phy_type {
  13708. HTT_PEER_RATE_REPORT_11B = 0,
  13709. HTT_PEER_RATE_REPORT_11A_G,
  13710. HTT_PEER_RATE_REPORT_11N,
  13711. HTT_PEER_RATE_REPORT_11AC,
  13712. };
  13713. #define HTT_PEER_RATE_REPORT_SIZE 8
  13714. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  13715. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  13716. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  13717. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  13718. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  13719. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  13720. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  13721. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  13722. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  13723. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  13724. do { \
  13725. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  13726. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  13727. } while (0)
  13728. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  13729. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  13730. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  13731. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  13732. do { \
  13733. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  13734. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  13735. } while (0)
  13736. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  13737. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  13738. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  13739. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  13740. do { \
  13741. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  13742. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  13743. } while (0)
  13744. /**
  13745. * @brief target -> host flow pool map message
  13746. *
  13747. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  13748. *
  13749. * @details
  13750. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  13751. * a flow of descriptors.
  13752. *
  13753. * This message is in TLV format and indicates the parameters to be setup a
  13754. * flow in the host. Each entry indicates that a particular flow ID is ready to
  13755. * receive descriptors from a specified pool.
  13756. *
  13757. * The message would appear as follows:
  13758. *
  13759. * |31 24|23 16|15 8|7 0|
  13760. * |----------------+----------------+----------------+----------------|
  13761. * header | reserved | num_flows | msg_type |
  13762. * |-------------------------------------------------------------------|
  13763. * | |
  13764. * : payload :
  13765. * | |
  13766. * |-------------------------------------------------------------------|
  13767. *
  13768. * The header field is one DWORD long and is interpreted as follows:
  13769. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  13770. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  13771. * this message
  13772. * b'16-31 - reserved: These bits are reserved for future use
  13773. *
  13774. * Payload:
  13775. * The payload would contain multiple objects of the following structure. Each
  13776. * object represents a flow.
  13777. *
  13778. * |31 24|23 16|15 8|7 0|
  13779. * |----------------+----------------+----------------+----------------|
  13780. * header | reserved | num_flows | msg_type |
  13781. * |-------------------------------------------------------------------|
  13782. * payload0| flow_type |
  13783. * |-------------------------------------------------------------------|
  13784. * | flow_id |
  13785. * |-------------------------------------------------------------------|
  13786. * | reserved0 | flow_pool_id |
  13787. * |-------------------------------------------------------------------|
  13788. * | reserved1 | flow_pool_size |
  13789. * |-------------------------------------------------------------------|
  13790. * | reserved2 |
  13791. * |-------------------------------------------------------------------|
  13792. * payload1| flow_type |
  13793. * |-------------------------------------------------------------------|
  13794. * | flow_id |
  13795. * |-------------------------------------------------------------------|
  13796. * | reserved0 | flow_pool_id |
  13797. * |-------------------------------------------------------------------|
  13798. * | reserved1 | flow_pool_size |
  13799. * |-------------------------------------------------------------------|
  13800. * | reserved2 |
  13801. * |-------------------------------------------------------------------|
  13802. * | . |
  13803. * | . |
  13804. * | . |
  13805. * |-------------------------------------------------------------------|
  13806. *
  13807. * Each payload is 5 DWORDS long and is interpreted as follows:
  13808. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  13809. * this flow is associated. It can be VDEV, peer,
  13810. * or tid (AC). Based on enum htt_flow_type.
  13811. *
  13812. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13813. * object. For flow_type vdev it is set to the
  13814. * vdevid, for peer it is peerid and for tid, it is
  13815. * tid_num.
  13816. *
  13817. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  13818. * in the host for this flow
  13819. * b'16:31 - reserved0: This field in reserved for the future. In case
  13820. * we have a hierarchical implementation (HCM) of
  13821. * pools, it can be used to indicate the ID of the
  13822. * parent-pool.
  13823. *
  13824. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  13825. * Descriptors for this flow will be
  13826. * allocated from this pool in the host.
  13827. * b'16:31 - reserved1: This field in reserved for the future. In case
  13828. * we have a hierarchical implementation of pools,
  13829. * it can be used to indicate the max number of
  13830. * descriptors in the pool. The b'0:15 can be used
  13831. * to indicate min number of descriptors in the
  13832. * HCM scheme.
  13833. *
  13834. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  13835. * we have a hierarchical implementation of pools,
  13836. * b'0:15 can be used to indicate the
  13837. * priority-based borrowing (PBB) threshold of
  13838. * the flow's pool. The b'16:31 are still left
  13839. * reserved.
  13840. */
  13841. enum htt_flow_type {
  13842. FLOW_TYPE_VDEV = 0,
  13843. /* Insert new flow types above this line */
  13844. };
  13845. PREPACK struct htt_flow_pool_map_payload_t {
  13846. A_UINT32 flow_type;
  13847. A_UINT32 flow_id;
  13848. A_UINT32 flow_pool_id:16,
  13849. reserved0:16;
  13850. A_UINT32 flow_pool_size:16,
  13851. reserved1:16;
  13852. A_UINT32 reserved2;
  13853. } POSTPACK;
  13854. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  13855. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  13856. (sizeof(struct htt_flow_pool_map_payload_t))
  13857. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  13858. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  13859. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  13860. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  13861. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  13862. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  13863. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  13864. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  13865. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  13866. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  13867. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  13868. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  13869. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  13870. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  13871. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  13872. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  13873. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  13874. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  13875. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  13876. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  13877. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  13878. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  13879. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  13880. do { \
  13881. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  13882. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  13883. } while (0)
  13884. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  13885. do { \
  13886. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  13887. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  13888. } while (0)
  13889. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  13890. do { \
  13891. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  13892. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  13893. } while (0)
  13894. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  13895. do { \
  13896. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  13897. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  13898. } while (0)
  13899. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  13900. do { \
  13901. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  13902. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  13903. } while (0)
  13904. /**
  13905. * @brief target -> host flow pool unmap message
  13906. *
  13907. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  13908. *
  13909. * @details
  13910. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  13911. * down a flow of descriptors.
  13912. * This message indicates that for the flow (whose ID is provided) is wanting
  13913. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  13914. * pool of descriptors from where descriptors are being allocated for this
  13915. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  13916. * be unmapped by the host.
  13917. *
  13918. * The message would appear as follows:
  13919. *
  13920. * |31 24|23 16|15 8|7 0|
  13921. * |----------------+----------------+----------------+----------------|
  13922. * | reserved0 | msg_type |
  13923. * |-------------------------------------------------------------------|
  13924. * | flow_type |
  13925. * |-------------------------------------------------------------------|
  13926. * | flow_id |
  13927. * |-------------------------------------------------------------------|
  13928. * | reserved1 | flow_pool_id |
  13929. * |-------------------------------------------------------------------|
  13930. *
  13931. * The message is interpreted as follows:
  13932. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  13933. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  13934. * b'8:31 - reserved0: Reserved for future use
  13935. *
  13936. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  13937. * this flow is associated. It can be VDEV, peer,
  13938. * or tid (AC). Based on enum htt_flow_type.
  13939. *
  13940. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13941. * object. For flow_type vdev it is set to the
  13942. * vdevid, for peer it is peerid and for tid, it is
  13943. * tid_num.
  13944. *
  13945. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  13946. * used in the host for this flow
  13947. * b'16:31 - reserved0: This field in reserved for the future.
  13948. *
  13949. */
  13950. PREPACK struct htt_flow_pool_unmap_t {
  13951. A_UINT32 msg_type:8,
  13952. reserved0:24;
  13953. A_UINT32 flow_type;
  13954. A_UINT32 flow_id;
  13955. A_UINT32 flow_pool_id:16,
  13956. reserved1:16;
  13957. } POSTPACK;
  13958. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  13959. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  13960. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  13961. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  13962. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  13963. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  13964. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  13965. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  13966. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  13967. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  13968. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  13969. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  13970. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  13971. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  13972. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  13973. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  13974. do { \
  13975. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  13976. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  13977. } while (0)
  13978. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  13979. do { \
  13980. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  13981. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  13982. } while (0)
  13983. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  13984. do { \
  13985. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  13986. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  13987. } while (0)
  13988. /**
  13989. * @brief target -> host SRING setup done message
  13990. *
  13991. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  13992. *
  13993. * @details
  13994. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  13995. * SRNG ring setup is done
  13996. *
  13997. * This message indicates whether the last setup operation is successful.
  13998. * It will be sent to host when host set respose_required bit in
  13999. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  14000. * The message would appear as follows:
  14001. *
  14002. * |31 24|23 16|15 8|7 0|
  14003. * |--------------- +----------------+----------------+----------------|
  14004. * | setup_status | ring_id | pdev_id | msg_type |
  14005. * |-------------------------------------------------------------------|
  14006. *
  14007. * The message is interpreted as follows:
  14008. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  14009. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  14010. * b'8:15 - pdev_id:
  14011. * 0 (for rings at SOC/UMAC level),
  14012. * 1/2/3 mac id (for rings at LMAC level)
  14013. * b'16:23 - ring_id: Identify the ring which is set up
  14014. * More details can be got from enum htt_srng_ring_id
  14015. * b'24:31 - setup_status: Indicate status of setup operation
  14016. * Refer to htt_ring_setup_status
  14017. */
  14018. PREPACK struct htt_sring_setup_done_t {
  14019. A_UINT32 msg_type: 8,
  14020. pdev_id: 8,
  14021. ring_id: 8,
  14022. setup_status: 8;
  14023. } POSTPACK;
  14024. enum htt_ring_setup_status {
  14025. htt_ring_setup_status_ok = 0,
  14026. htt_ring_setup_status_error,
  14027. };
  14028. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  14029. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  14030. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  14031. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  14032. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  14033. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  14034. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  14035. do { \
  14036. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  14037. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14038. } while (0)
  14039. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  14040. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  14041. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  14042. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  14043. HTT_SRING_SETUP_DONE_RING_ID_S)
  14044. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  14045. do { \
  14046. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  14047. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  14048. } while (0)
  14049. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  14050. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  14051. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  14052. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  14053. HTT_SRING_SETUP_DONE_STATUS_S)
  14054. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  14055. do { \
  14056. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  14057. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  14058. } while (0)
  14059. /**
  14060. * @brief target -> flow map flow info
  14061. *
  14062. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  14063. *
  14064. * @details
  14065. * HTT TX map flow entry with tqm flow pointer
  14066. * Sent from firmware to host to add tqm flow pointer in corresponding
  14067. * flow search entry. Flow metadata is replayed back to host as part of this
  14068. * struct to enable host to find the specific flow search entry
  14069. *
  14070. * The message would appear as follows:
  14071. *
  14072. * |31 28|27 18|17 14|13 8|7 0|
  14073. * |-------+------------------------------------------+----------------|
  14074. * | rsvd0 | fse_hsh_idx | msg_type |
  14075. * |-------------------------------------------------------------------|
  14076. * | rsvd1 | tid | peer_id |
  14077. * |-------------------------------------------------------------------|
  14078. * | tqm_flow_pntr_lo |
  14079. * |-------------------------------------------------------------------|
  14080. * | tqm_flow_pntr_hi |
  14081. * |-------------------------------------------------------------------|
  14082. * | fse_meta_data |
  14083. * |-------------------------------------------------------------------|
  14084. *
  14085. * The message is interpreted as follows:
  14086. *
  14087. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  14088. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  14089. *
  14090. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  14091. * for this flow entry
  14092. *
  14093. * dword0 - b'28:31 - rsvd0: Reserved for future use
  14094. *
  14095. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  14096. *
  14097. * dword1 - b'14:17 - tid
  14098. *
  14099. * dword1 - b'18:31 - rsvd1: Reserved for future use
  14100. *
  14101. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  14102. *
  14103. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  14104. *
  14105. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  14106. * given by host
  14107. */
  14108. PREPACK struct htt_tx_map_flow_info {
  14109. A_UINT32
  14110. msg_type: 8,
  14111. fse_hsh_idx: 20,
  14112. rsvd0: 4;
  14113. A_UINT32
  14114. peer_id: 14,
  14115. tid: 4,
  14116. rsvd1: 14;
  14117. A_UINT32 tqm_flow_pntr_lo;
  14118. A_UINT32 tqm_flow_pntr_hi;
  14119. struct htt_tx_flow_metadata fse_meta_data;
  14120. } POSTPACK;
  14121. /* DWORD 0 */
  14122. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  14123. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  14124. /* DWORD 1 */
  14125. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  14126. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  14127. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  14128. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  14129. /* DWORD 0 */
  14130. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  14131. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  14132. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  14133. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  14134. do { \
  14135. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  14136. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  14137. } while (0)
  14138. /* DWORD 1 */
  14139. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  14140. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  14141. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  14142. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  14143. do { \
  14144. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  14145. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  14146. } while (0)
  14147. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  14148. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  14149. HTT_TX_MAP_FLOW_INFO_TID_S)
  14150. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  14151. do { \
  14152. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  14153. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  14154. } while (0)
  14155. /*
  14156. * htt_dbg_ext_stats_status -
  14157. * present - The requested stats have been delivered in full.
  14158. * This indicates that either the stats information was contained
  14159. * in its entirety within this message, or else this message
  14160. * completes the delivery of the requested stats info that was
  14161. * partially delivered through earlier STATS_CONF messages.
  14162. * partial - The requested stats have been delivered in part.
  14163. * One or more subsequent STATS_CONF messages with the same
  14164. * cookie value will be sent to deliver the remainder of the
  14165. * information.
  14166. * error - The requested stats could not be delivered, for example due
  14167. * to a shortage of memory to construct a message holding the
  14168. * requested stats.
  14169. * invalid - The requested stat type is either not recognized, or the
  14170. * target is configured to not gather the stats type in question.
  14171. */
  14172. enum htt_dbg_ext_stats_status {
  14173. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  14174. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  14175. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  14176. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  14177. };
  14178. /**
  14179. * @brief target -> host ppdu stats upload
  14180. *
  14181. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  14182. *
  14183. * @details
  14184. * The following field definitions describe the format of the HTT target
  14185. * to host ppdu stats indication message.
  14186. *
  14187. *
  14188. * |31 16|15 12|11 10|9 8|7 0 |
  14189. * |----------------------------------------------------------------------|
  14190. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  14191. * |----------------------------------------------------------------------|
  14192. * | ppdu_id |
  14193. * |----------------------------------------------------------------------|
  14194. * | Timestamp in us |
  14195. * |----------------------------------------------------------------------|
  14196. * | reserved |
  14197. * |----------------------------------------------------------------------|
  14198. * | type-specific stats info |
  14199. * | (see htt_ppdu_stats.h) |
  14200. * |----------------------------------------------------------------------|
  14201. * Header fields:
  14202. * - MSG_TYPE
  14203. * Bits 7:0
  14204. * Purpose: Identifies this is a PPDU STATS indication
  14205. * message.
  14206. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  14207. * - mac_id
  14208. * Bits 9:8
  14209. * Purpose: mac_id of this ppdu_id
  14210. * Value: 0-3
  14211. * - pdev_id
  14212. * Bits 11:10
  14213. * Purpose: pdev_id of this ppdu_id
  14214. * Value: 0-3
  14215. * 0 (for rings at SOC level),
  14216. * 1/2/3 PDEV -> 0/1/2
  14217. * - payload_size
  14218. * Bits 31:16
  14219. * Purpose: total tlv size
  14220. * Value: payload_size in bytes
  14221. */
  14222. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  14223. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  14224. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  14225. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  14226. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  14227. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  14228. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  14229. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  14230. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  14231. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  14232. do { \
  14233. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  14234. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  14235. } while (0)
  14236. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  14237. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  14238. HTT_T2H_PPDU_STATS_MAC_ID_S)
  14239. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  14240. do { \
  14241. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  14242. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  14243. } while (0)
  14244. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  14245. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  14246. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  14247. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  14248. do { \
  14249. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  14250. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  14251. } while (0)
  14252. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  14253. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  14254. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  14255. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  14256. do { \
  14257. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  14258. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  14259. } while (0)
  14260. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  14261. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  14262. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  14263. /* htt_t2h_ppdu_stats_ind_hdr_t
  14264. * This struct contains the fields within the header of the
  14265. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  14266. * stats info.
  14267. * This struct assumes little-endian layout, and thus is only
  14268. * suitable for use within processors known to be little-endian
  14269. * (such as the target).
  14270. * In contrast, the above macros provide endian-portable methods
  14271. * to get and set the bitfields within this PPDU_STATS_IND header.
  14272. */
  14273. typedef struct {
  14274. A_UINT32 msg_type: 8, /* bits 7:0 */
  14275. mac_id: 2, /* bits 9:8 */
  14276. pdev_id: 2, /* bits 11:10 */
  14277. reserved1: 4, /* bits 15:12 */
  14278. payload_size: 16; /* bits 31:16 */
  14279. A_UINT32 ppdu_id;
  14280. A_UINT32 timestamp_us;
  14281. A_UINT32 reserved2;
  14282. } htt_t2h_ppdu_stats_ind_hdr_t;
  14283. /**
  14284. * @brief target -> host extended statistics upload
  14285. *
  14286. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  14287. *
  14288. * @details
  14289. * The following field definitions describe the format of the HTT target
  14290. * to host stats upload confirmation message.
  14291. * The message contains a cookie echoed from the HTT host->target stats
  14292. * upload request, which identifies which request the confirmation is
  14293. * for, and a single stats can span over multiple HTT stats indication
  14294. * due to the HTT message size limitation so every HTT ext stats indication
  14295. * will have tag-length-value stats information elements.
  14296. * The tag-length header for each HTT stats IND message also includes a
  14297. * status field, to indicate whether the request for the stat type in
  14298. * question was fully met, partially met, unable to be met, or invalid
  14299. * (if the stat type in question is disabled in the target).
  14300. * A Done bit 1's indicate the end of the of stats info elements.
  14301. *
  14302. *
  14303. * |31 16|15 12|11|10 8|7 5|4 0|
  14304. * |--------------------------------------------------------------|
  14305. * | reserved | msg type |
  14306. * |--------------------------------------------------------------|
  14307. * | cookie LSBs |
  14308. * |--------------------------------------------------------------|
  14309. * | cookie MSBs |
  14310. * |--------------------------------------------------------------|
  14311. * | stats entry length | rsvd | D| S | stat type |
  14312. * |--------------------------------------------------------------|
  14313. * | type-specific stats info |
  14314. * | (see htt_stats.h) |
  14315. * |--------------------------------------------------------------|
  14316. * Header fields:
  14317. * - MSG_TYPE
  14318. * Bits 7:0
  14319. * Purpose: Identifies this is a extended statistics upload confirmation
  14320. * message.
  14321. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  14322. * - COOKIE_LSBS
  14323. * Bits 31:0
  14324. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14325. * message with its preceding host->target stats request message.
  14326. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14327. * - COOKIE_MSBS
  14328. * Bits 31:0
  14329. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14330. * message with its preceding host->target stats request message.
  14331. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14332. *
  14333. * Stats Information Element tag-length header fields:
  14334. * - STAT_TYPE
  14335. * Bits 7:0
  14336. * Purpose: identifies the type of statistics info held in the
  14337. * following information element
  14338. * Value: htt_dbg_ext_stats_type
  14339. * - STATUS
  14340. * Bits 10:8
  14341. * Purpose: indicate whether the requested stats are present
  14342. * Value: htt_dbg_ext_stats_status
  14343. * - DONE
  14344. * Bits 11
  14345. * Purpose:
  14346. * Indicates the completion of the stats entry, this will be the last
  14347. * stats conf HTT segment for the requested stats type.
  14348. * Value:
  14349. * 0 -> the stats retrieval is ongoing
  14350. * 1 -> the stats retrieval is complete
  14351. * - LENGTH
  14352. * Bits 31:16
  14353. * Purpose: indicate the stats information size
  14354. * Value: This field specifies the number of bytes of stats information
  14355. * that follows the element tag-length header.
  14356. * It is expected but not required that this length is a multiple of
  14357. * 4 bytes.
  14358. */
  14359. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  14360. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  14361. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  14362. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  14363. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  14364. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  14365. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  14366. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  14367. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  14368. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14369. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  14370. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  14371. do { \
  14372. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  14373. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  14374. } while (0)
  14375. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  14376. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  14377. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  14378. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  14379. do { \
  14380. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  14381. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  14382. } while (0)
  14383. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  14384. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  14385. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  14386. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  14387. do { \
  14388. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  14389. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  14390. } while (0)
  14391. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  14392. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  14393. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  14394. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14395. do { \
  14396. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  14397. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  14398. } while (0)
  14399. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  14400. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  14401. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  14402. typedef enum {
  14403. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  14404. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  14405. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  14406. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  14407. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  14408. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  14409. /* Reserved from 128 - 255 for target internal use.*/
  14410. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  14411. } HTT_PEER_TYPE;
  14412. /** macro to convert MAC address from char array to HTT word format */
  14413. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  14414. (phtt_mac_addr)->mac_addr31to0 = \
  14415. (((c_macaddr)[0] << 0) | \
  14416. ((c_macaddr)[1] << 8) | \
  14417. ((c_macaddr)[2] << 16) | \
  14418. ((c_macaddr)[3] << 24)); \
  14419. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  14420. } while (0)
  14421. /**
  14422. * @brief target -> host monitor mac header indication message
  14423. *
  14424. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  14425. *
  14426. * @details
  14427. * The following diagram shows the format of the monitor mac header message
  14428. * sent from the target to the host.
  14429. * This message is primarily sent when promiscuous rx mode is enabled.
  14430. * One message is sent per rx PPDU.
  14431. *
  14432. * |31 24|23 16|15 8|7 0|
  14433. * |-------------------------------------------------------------|
  14434. * | peer_id | reserved0 | msg_type |
  14435. * |-------------------------------------------------------------|
  14436. * | reserved1 | num_mpdu |
  14437. * |-------------------------------------------------------------|
  14438. * | struct hw_rx_desc |
  14439. * | (see wal_rx_desc.h) |
  14440. * |-------------------------------------------------------------|
  14441. * | struct ieee80211_frame_addr4 |
  14442. * | (see ieee80211_defs.h) |
  14443. * |-------------------------------------------------------------|
  14444. * | struct ieee80211_frame_addr4 |
  14445. * | (see ieee80211_defs.h) |
  14446. * |-------------------------------------------------------------|
  14447. * | ...... |
  14448. * |-------------------------------------------------------------|
  14449. *
  14450. * Header fields:
  14451. * - msg_type
  14452. * Bits 7:0
  14453. * Purpose: Identifies this is a monitor mac header indication message.
  14454. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  14455. * - peer_id
  14456. * Bits 31:16
  14457. * Purpose: Software peer id given by host during association,
  14458. * During promiscuous mode, the peer ID will be invalid (0xFF)
  14459. * for rx PPDUs received from unassociated peers.
  14460. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  14461. * - num_mpdu
  14462. * Bits 15:0
  14463. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  14464. * delivered within the message.
  14465. * Value: 1 to 32
  14466. * num_mpdu is limited to a maximum value of 32, due to buffer
  14467. * size limits. For PPDUs with more than 32 MPDUs, only the
  14468. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  14469. * the PPDU will be provided.
  14470. */
  14471. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  14472. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  14473. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  14474. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  14475. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  14476. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  14477. do { \
  14478. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  14479. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  14480. } while (0)
  14481. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  14482. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  14483. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  14484. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  14485. do { \
  14486. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  14487. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  14488. } while (0)
  14489. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  14490. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  14491. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  14492. /**
  14493. * @brief target -> host flow pool resize Message
  14494. *
  14495. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  14496. *
  14497. * @details
  14498. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  14499. * the flow pool associated with the specified ID is resized
  14500. *
  14501. * The message would appear as follows:
  14502. *
  14503. * |31 16|15 8|7 0|
  14504. * |---------------------------------+----------------+----------------|
  14505. * | reserved0 | Msg type |
  14506. * |-------------------------------------------------------------------|
  14507. * | flow pool new size | flow pool ID |
  14508. * |-------------------------------------------------------------------|
  14509. *
  14510. * The message is interpreted as follows:
  14511. * b'0:7 - msg_type: This will be set to 0x21
  14512. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  14513. *
  14514. * b'0:15 - flow pool ID: Existing flow pool ID
  14515. *
  14516. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  14517. *
  14518. */
  14519. PREPACK struct htt_flow_pool_resize_t {
  14520. A_UINT32 msg_type:8,
  14521. reserved0:24;
  14522. A_UINT32 flow_pool_id:16,
  14523. flow_pool_new_size:16;
  14524. } POSTPACK;
  14525. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  14526. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  14527. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  14528. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  14529. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  14530. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  14531. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  14532. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  14533. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  14534. do { \
  14535. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  14536. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  14537. } while (0)
  14538. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  14539. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  14540. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  14541. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  14542. do { \
  14543. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  14544. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  14545. } while (0)
  14546. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  14547. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  14548. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  14549. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  14550. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  14551. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  14552. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  14553. /*
  14554. * The read and write indices point to the data within the host buffer.
  14555. * Because the first 4 bytes of the host buffer is used for the read index and
  14556. * the next 4 bytes for the write index, the data itself starts at offset 8.
  14557. * The read index and write index are the byte offsets from the base of the
  14558. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  14559. * Refer the ASCII text picture below.
  14560. */
  14561. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  14562. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  14563. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  14564. /*
  14565. ***************************************************************************
  14566. *
  14567. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14568. *
  14569. ***************************************************************************
  14570. *
  14571. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  14572. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  14573. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  14574. * written into the Host memory region mentioned below.
  14575. *
  14576. * Read index is updated by the Host. At any point of time, the read index will
  14577. * indicate the index that will next be read by the Host. The read index is
  14578. * in units of bytes offset from the base of the meta-data buffer.
  14579. *
  14580. * Write index is updated by the FW. At any point of time, the write index will
  14581. * indicate from where the FW can start writing any new data. The write index is
  14582. * in units of bytes offset from the base of the meta-data buffer.
  14583. *
  14584. * If the Host is not fast enough in reading the CFR data, any new capture data
  14585. * would be dropped if there is no space left to write the new captures.
  14586. *
  14587. * The last 4 bytes of the memory region will have the magic pattern
  14588. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  14589. * not overrun the host buffer.
  14590. *
  14591. * ,--------------------. read and write indices store the
  14592. * | | byte offset from the base of the
  14593. * | ,--------+--------. meta-data buffer to the next
  14594. * | | | | location within the data buffer
  14595. * | | v v that will be read / written
  14596. * ************************************************************************
  14597. * * Read * Write * * Magic *
  14598. * * index * index * CFR data1 ...... CFR data N * pattern *
  14599. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  14600. * ************************************************************************
  14601. * |<---------- data buffer ---------->|
  14602. *
  14603. * |<----------------- meta-data buffer allocated in Host ----------------|
  14604. *
  14605. * Note:
  14606. * - Considering the 4 bytes needed to store the Read index (R) and the
  14607. * Write index (W), the initial value is as follows:
  14608. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  14609. * - Buffer empty condition:
  14610. * R = W
  14611. *
  14612. * Regarding CFR data format:
  14613. * --------------------------
  14614. *
  14615. * Each CFR tone is stored in HW as 16-bits with the following format:
  14616. * {bits[15:12], bits[11:6], bits[5:0]} =
  14617. * {unsigned exponent (4 bits),
  14618. * signed mantissa_real (6 bits),
  14619. * signed mantissa_imag (6 bits)}
  14620. *
  14621. * CFR_real = mantissa_real * 2^(exponent-5)
  14622. * CFR_imag = mantissa_imag * 2^(exponent-5)
  14623. *
  14624. *
  14625. * The CFR data is written to the 16-bit unsigned output array (buff) in
  14626. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  14627. *
  14628. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  14629. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  14630. * .
  14631. * .
  14632. * .
  14633. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  14634. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  14635. */
  14636. /* Bandwidth of peer CFR captures */
  14637. typedef enum {
  14638. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  14639. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  14640. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  14641. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  14642. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  14643. HTT_PEER_CFR_CAPTURE_BW_MAX,
  14644. } HTT_PEER_CFR_CAPTURE_BW;
  14645. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  14646. * was captured
  14647. */
  14648. typedef enum {
  14649. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  14650. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  14651. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  14652. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  14653. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  14654. } HTT_PEER_CFR_CAPTURE_MODE;
  14655. typedef enum {
  14656. /* This message type is currently used for the below purpose:
  14657. *
  14658. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  14659. * wmi_peer_cfr_capture_cmd.
  14660. * If payload_present bit is set to 0 then the associated memory region
  14661. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  14662. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  14663. * message; the CFR dump will be present at the end of the message,
  14664. * after the chan_phy_mode.
  14665. */
  14666. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  14667. /* Always keep this last */
  14668. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  14669. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  14670. /**
  14671. * @brief target -> host CFR dump completion indication message definition
  14672. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  14673. *
  14674. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  14675. *
  14676. * @details
  14677. * The following diagram shows the format of the Channel Frequency Response
  14678. * (CFR) dump completion indication. This inidcation is sent to the Host when
  14679. * the channel capture of a peer is copied by Firmware into the Host memory
  14680. *
  14681. * **************************************************************************
  14682. *
  14683. * Message format when the CFR capture message type is
  14684. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14685. *
  14686. * **************************************************************************
  14687. *
  14688. * |31 16|15 |8|7 0|
  14689. * |----------------------------------------------------------------|
  14690. * header: | reserved |P| msg_type |
  14691. * word 0 | | | |
  14692. * |----------------------------------------------------------------|
  14693. * payload: | cfr_capture_msg_type |
  14694. * word 1 | |
  14695. * |----------------------------------------------------------------|
  14696. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  14697. * word 2 | | | | | | | | |
  14698. * |----------------------------------------------------------------|
  14699. * | mac_addr31to0 |
  14700. * word 3 | |
  14701. * |----------------------------------------------------------------|
  14702. * | unused / reserved | mac_addr47to32 |
  14703. * word 4 | | |
  14704. * |----------------------------------------------------------------|
  14705. * | index |
  14706. * word 5 | |
  14707. * |----------------------------------------------------------------|
  14708. * | length |
  14709. * word 6 | |
  14710. * |----------------------------------------------------------------|
  14711. * | timestamp |
  14712. * word 7 | |
  14713. * |----------------------------------------------------------------|
  14714. * | counter |
  14715. * word 8 | |
  14716. * |----------------------------------------------------------------|
  14717. * | chan_mhz |
  14718. * word 9 | |
  14719. * |----------------------------------------------------------------|
  14720. * | band_center_freq1 |
  14721. * word 10 | |
  14722. * |----------------------------------------------------------------|
  14723. * | band_center_freq2 |
  14724. * word 11 | |
  14725. * |----------------------------------------------------------------|
  14726. * | chan_phy_mode |
  14727. * word 12 | |
  14728. * |----------------------------------------------------------------|
  14729. * where,
  14730. * P - payload present bit (payload_present explained below)
  14731. * req_id - memory request id (mem_req_id explained below)
  14732. * S - status field (status explained below)
  14733. * capbw - capture bandwidth (capture_bw explained below)
  14734. * mode - mode of capture (mode explained below)
  14735. * sts - space time streams (sts_count explained below)
  14736. * chbw - channel bandwidth (channel_bw explained below)
  14737. * captype - capture type (cap_type explained below)
  14738. *
  14739. * The following field definitions describe the format of the CFR dump
  14740. * completion indication sent from the target to the host
  14741. *
  14742. * Header fields:
  14743. *
  14744. * Word 0
  14745. * - msg_type
  14746. * Bits 7:0
  14747. * Purpose: Identifies this as CFR TX completion indication
  14748. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  14749. * - payload_present
  14750. * Bit 8
  14751. * Purpose: Identifies how CFR data is sent to host
  14752. * Value: 0 - If CFR Payload is written to host memory
  14753. * 1 - If CFR Payload is sent as part of HTT message
  14754. * (This is the requirement for SDIO/USB where it is
  14755. * not possible to write CFR data to host memory)
  14756. * - reserved
  14757. * Bits 31:9
  14758. * Purpose: Reserved
  14759. * Value: 0
  14760. *
  14761. * Payload fields:
  14762. *
  14763. * Word 1
  14764. * - cfr_capture_msg_type
  14765. * Bits 31:0
  14766. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  14767. * to specify the format used for the remainder of the message
  14768. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14769. * (currently only MSG_TYPE_1 is defined)
  14770. *
  14771. * Word 2
  14772. * - mem_req_id
  14773. * Bits 6:0
  14774. * Purpose: Contain the mem request id of the region where the CFR capture
  14775. * has been stored - of type WMI_HOST_MEM_REQ_ID
  14776. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  14777. this value is invalid)
  14778. * - status
  14779. * Bit 7
  14780. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  14781. * Value: 1 (True) - Successful; 0 (False) - Not successful
  14782. * - capture_bw
  14783. * Bits 10:8
  14784. * Purpose: Carry the bandwidth of the CFR capture
  14785. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  14786. * - mode
  14787. * Bits 13:11
  14788. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  14789. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  14790. * - sts_count
  14791. * Bits 16:14
  14792. * Purpose: Carry the number of space time streams
  14793. * Value: Number of space time streams
  14794. * - channel_bw
  14795. * Bits 19:17
  14796. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  14797. * measurement
  14798. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  14799. * - cap_type
  14800. * Bits 23:20
  14801. * Purpose: Carry the type of the capture
  14802. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  14803. * - vdev_id
  14804. * Bits 31:24
  14805. * Purpose: Carry the virtual device id
  14806. * Value: vdev ID
  14807. *
  14808. * Word 3
  14809. * - mac_addr31to0
  14810. * Bits 31:0
  14811. * Purpose: Contain the bits 31:0 of the peer MAC address
  14812. * Value: Bits 31:0 of the peer MAC address
  14813. *
  14814. * Word 4
  14815. * - mac_addr47to32
  14816. * Bits 15:0
  14817. * Purpose: Contain the bits 47:32 of the peer MAC address
  14818. * Value: Bits 47:32 of the peer MAC address
  14819. *
  14820. * Word 5
  14821. * - index
  14822. * Bits 31:0
  14823. * Purpose: Contain the index at which this CFR dump was written in the Host
  14824. * allocated memory. This index is the number of bytes from the base address.
  14825. * Value: Index position
  14826. *
  14827. * Word 6
  14828. * - length
  14829. * Bits 31:0
  14830. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  14831. * Value: Length of the CFR capture of the peer
  14832. *
  14833. * Word 7
  14834. * - timestamp
  14835. * Bits 31:0
  14836. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  14837. * clock used for this timestamp is private to the target and not visible to
  14838. * the host i.e., Host can interpret only the relative timestamp deltas from
  14839. * one message to the next, but can't interpret the absolute timestamp from a
  14840. * single message.
  14841. * Value: Timestamp in microseconds
  14842. *
  14843. * Word 8
  14844. * - counter
  14845. * Bits 31:0
  14846. * Purpose: Carry the count of the current CFR capture from FW. This is
  14847. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  14848. * in host memory)
  14849. * Value: Count of the current CFR capture
  14850. *
  14851. * Word 9
  14852. * - chan_mhz
  14853. * Bits 31:0
  14854. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  14855. * Value: Primary 20 channel frequency
  14856. *
  14857. * Word 10
  14858. * - band_center_freq1
  14859. * Bits 31:0
  14860. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  14861. * Value: Center frequency 1 in MHz
  14862. *
  14863. * Word 11
  14864. * - band_center_freq2
  14865. * Bits 31:0
  14866. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  14867. * the VDEV
  14868. * 80plus80 mode
  14869. * Value: Center frequency 2 in MHz
  14870. *
  14871. * Word 12
  14872. * - chan_phy_mode
  14873. * Bits 31:0
  14874. * Purpose: Carry the phy mode of the channel, of the VDEV
  14875. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  14876. */
  14877. PREPACK struct htt_cfr_dump_ind_type_1 {
  14878. A_UINT32 mem_req_id:7,
  14879. status:1,
  14880. capture_bw:3,
  14881. mode:3,
  14882. sts_count:3,
  14883. channel_bw:3,
  14884. cap_type:4,
  14885. vdev_id:8;
  14886. htt_mac_addr addr;
  14887. A_UINT32 index;
  14888. A_UINT32 length;
  14889. A_UINT32 timestamp;
  14890. A_UINT32 counter;
  14891. struct htt_chan_change_msg chan;
  14892. } POSTPACK;
  14893. PREPACK struct htt_cfr_dump_compl_ind {
  14894. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  14895. union {
  14896. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  14897. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  14898. /* If there is a need to change the memory layout and its associated
  14899. * HTT indication format, a new CFR capture message type can be
  14900. * introduced and added into this union.
  14901. */
  14902. };
  14903. } POSTPACK;
  14904. /*
  14905. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  14906. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14907. */
  14908. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  14909. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  14910. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  14911. do { \
  14912. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  14913. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  14914. } while(0)
  14915. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  14916. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  14917. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  14918. /*
  14919. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  14920. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14921. */
  14922. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  14923. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  14924. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  14925. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  14926. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  14927. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  14928. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  14929. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  14930. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  14931. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  14932. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  14933. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  14934. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  14935. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  14936. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  14937. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  14938. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  14939. do { \
  14940. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  14941. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  14942. } while (0)
  14943. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  14944. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  14945. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  14946. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  14947. do { \
  14948. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  14949. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  14950. } while (0)
  14951. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  14952. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  14953. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  14954. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  14955. do { \
  14956. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  14957. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  14958. } while (0)
  14959. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  14960. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  14961. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  14962. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  14963. do { \
  14964. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  14965. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  14966. } while (0)
  14967. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  14968. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  14969. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  14970. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  14971. do { \
  14972. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  14973. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  14974. } while (0)
  14975. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  14976. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  14977. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  14978. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  14979. do { \
  14980. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  14981. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  14982. } while (0)
  14983. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  14984. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  14985. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  14986. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  14987. do { \
  14988. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  14989. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  14990. } while (0)
  14991. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  14992. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  14993. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  14994. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  14995. do { \
  14996. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  14997. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  14998. } while (0)
  14999. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  15000. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  15001. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  15002. /**
  15003. * @brief target -> host peer (PPDU) stats message
  15004. *
  15005. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  15006. *
  15007. * @details
  15008. * This message is generated by FW when FW is sending stats to host
  15009. * about one or more PPDUs that the FW has transmitted to one or more peers.
  15010. * This message is sent autonomously by the target rather than upon request
  15011. * by the host.
  15012. * The following field definitions describe the format of the HTT target
  15013. * to host peer stats indication message.
  15014. *
  15015. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  15016. * or more PPDU stats records.
  15017. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  15018. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  15019. * then the message would start with the
  15020. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  15021. * below.
  15022. *
  15023. * |31 16|15|14|13 11|10 9|8|7 0|
  15024. * |-------------------------------------------------------------|
  15025. * | reserved |MSG_TYPE |
  15026. * |-------------------------------------------------------------|
  15027. * rec 0 | TLV header |
  15028. * rec 0 |-------------------------------------------------------------|
  15029. * rec 0 | ppdu successful bytes |
  15030. * rec 0 |-------------------------------------------------------------|
  15031. * rec 0 | ppdu retry bytes |
  15032. * rec 0 |-------------------------------------------------------------|
  15033. * rec 0 | ppdu failed bytes |
  15034. * rec 0 |-------------------------------------------------------------|
  15035. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  15036. * rec 0 |-------------------------------------------------------------|
  15037. * rec 0 | retried MSDUs | successful MSDUs |
  15038. * rec 0 |-------------------------------------------------------------|
  15039. * rec 0 | TX duration | failed MSDUs |
  15040. * rec 0 |-------------------------------------------------------------|
  15041. * ...
  15042. * |-------------------------------------------------------------|
  15043. * rec N | TLV header |
  15044. * rec N |-------------------------------------------------------------|
  15045. * rec N | ppdu successful bytes |
  15046. * rec N |-------------------------------------------------------------|
  15047. * rec N | ppdu retry bytes |
  15048. * rec N |-------------------------------------------------------------|
  15049. * rec N | ppdu failed bytes |
  15050. * rec N |-------------------------------------------------------------|
  15051. * rec N | peer id | S|SG| BW | BA |A|rate code|
  15052. * rec N |-------------------------------------------------------------|
  15053. * rec N | retried MSDUs | successful MSDUs |
  15054. * rec N |-------------------------------------------------------------|
  15055. * rec N | TX duration | failed MSDUs |
  15056. * rec N |-------------------------------------------------------------|
  15057. *
  15058. * where:
  15059. * A = is A-MPDU flag
  15060. * BA = block-ack failure flags
  15061. * BW = bandwidth spec
  15062. * SG = SGI enabled spec
  15063. * S = skipped rate ctrl
  15064. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  15065. *
  15066. * Header
  15067. * ------
  15068. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  15069. * dword0 - b'8:31 - reserved : Reserved for future use
  15070. *
  15071. * payload include below peer_stats information
  15072. * --------------------------------------------
  15073. * @TLV : HTT_PPDU_STATS_INFO_TLV
  15074. * @tx_success_bytes : total successful bytes in the PPDU.
  15075. * @tx_retry_bytes : total retried bytes in the PPDU.
  15076. * @tx_failed_bytes : total failed bytes in the PPDU.
  15077. * @tx_ratecode : rate code used for the PPDU.
  15078. * @is_ampdu : Indicates PPDU is AMPDU or not.
  15079. * @ba_ack_failed : BA/ACK failed for this PPDU
  15080. * b00 -> BA received
  15081. * b01 -> BA failed once
  15082. * b10 -> BA failed twice, when HW retry is enabled.
  15083. * @bw : BW
  15084. * b00 -> 20 MHz
  15085. * b01 -> 40 MHz
  15086. * b10 -> 80 MHz
  15087. * b11 -> 160 MHz (or 80+80)
  15088. * @sg : SGI enabled
  15089. * @s : skipped ratectrl
  15090. * @peer_id : peer id
  15091. * @tx_success_msdus : successful MSDUs
  15092. * @tx_retry_msdus : retried MSDUs
  15093. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  15094. * @tx_duration : Tx duration for the PPDU (microsecond units)
  15095. */
  15096. /**
  15097. * @brief target -> host backpressure event
  15098. *
  15099. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  15100. *
  15101. * @details
  15102. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  15103. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  15104. * This message will only be sent if the backpressure condition has existed
  15105. * continuously for an initial period (100 ms).
  15106. * Repeat messages with updated information will be sent after each
  15107. * subsequent period (100 ms) as long as the backpressure remains unabated.
  15108. * This message indicates the ring id along with current head and tail index
  15109. * locations (i.e. write and read indices).
  15110. * The backpressure time indicates the time in ms for which continous
  15111. * backpressure has been observed in the ring.
  15112. *
  15113. * The message format is as follows:
  15114. *
  15115. * |31 24|23 16|15 8|7 0|
  15116. * |----------------+----------------+----------------+----------------|
  15117. * | ring_id | ring_type | pdev_id | msg_type |
  15118. * |-------------------------------------------------------------------|
  15119. * | tail_idx | head_idx |
  15120. * |-------------------------------------------------------------------|
  15121. * | backpressure_time_ms |
  15122. * |-------------------------------------------------------------------|
  15123. *
  15124. * The message is interpreted as follows:
  15125. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  15126. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  15127. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  15128. * 1, 2, 3 indicates pdev_id 0,1,2 and
  15129. the msg is for LMAC ring.
  15130. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  15131. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  15132. * htt_backpressure_lmac_ring_id. This represents
  15133. * the ring id for which continous backpressure is seen
  15134. *
  15135. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  15136. * the ring indicated by the ring_id
  15137. *
  15138. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  15139. * the ring indicated by the ring id
  15140. *
  15141. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  15142. * backpressure has been seen in the ring
  15143. * indicated by the ring_id.
  15144. * Units = milliseconds
  15145. */
  15146. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  15147. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  15148. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  15149. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  15150. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  15151. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  15152. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  15153. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  15154. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  15155. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  15156. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  15157. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  15158. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  15159. do { \
  15160. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  15161. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  15162. } while (0)
  15163. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  15164. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  15165. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  15166. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  15167. do { \
  15168. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  15169. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  15170. } while (0)
  15171. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  15172. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  15173. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  15174. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  15175. do { \
  15176. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  15177. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  15178. } while (0)
  15179. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  15180. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  15181. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  15182. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  15183. do { \
  15184. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  15185. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  15186. } while (0)
  15187. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  15188. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  15189. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  15190. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  15191. do { \
  15192. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  15193. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  15194. } while (0)
  15195. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  15196. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  15197. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  15198. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  15199. do { \
  15200. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  15201. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  15202. } while (0)
  15203. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  15204. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  15205. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  15206. enum htt_backpressure_ring_type {
  15207. HTT_SW_RING_TYPE_UMAC,
  15208. HTT_SW_RING_TYPE_LMAC,
  15209. HTT_SW_RING_TYPE_MAX,
  15210. };
  15211. /* Ring id for which the message is sent to host */
  15212. enum htt_backpressure_umac_ringid {
  15213. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  15214. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  15215. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  15216. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  15217. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  15218. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  15219. HTT_SW_RING_IDX_REO_REO2FW_RING,
  15220. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  15221. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  15222. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  15223. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  15224. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  15225. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  15226. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  15227. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  15228. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  15229. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  15230. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  15231. HTT_SW_UMAC_RING_IDX_MAX,
  15232. };
  15233. enum htt_backpressure_lmac_ringid {
  15234. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  15235. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  15236. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  15237. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  15238. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  15239. HTT_SW_RING_IDX_RXDMA2FW_RING,
  15240. HTT_SW_RING_IDX_RXDMA2SW_RING,
  15241. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  15242. HTT_SW_RING_IDX_RXDMA2REO_RING,
  15243. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  15244. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  15245. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  15246. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  15247. HTT_SW_LMAC_RING_IDX_MAX,
  15248. };
  15249. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  15250. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  15251. pdev_id: 8,
  15252. ring_type: 8, /* htt_backpressure_ring_type */
  15253. /*
  15254. * ring_id holds an enum value from either
  15255. * htt_backpressure_umac_ringid or
  15256. * htt_backpressure_lmac_ringid, based on
  15257. * the ring_type setting.
  15258. */
  15259. ring_id: 8;
  15260. A_UINT16 head_idx;
  15261. A_UINT16 tail_idx;
  15262. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  15263. } POSTPACK;
  15264. /*
  15265. * Defines two 32 bit words that can be used by the target to indicate a per
  15266. * user RU allocation and rate information.
  15267. *
  15268. * This information is currently provided in the "sw_response_reference_ptr"
  15269. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  15270. * "rx_ppdu_end_user_stats" TLV.
  15271. *
  15272. * VALID:
  15273. * The consumer of these words must explicitly check the valid bit,
  15274. * and only attempt interpretation of any of the remaining fields if
  15275. * the valid bit is set to 1.
  15276. *
  15277. * VERSION:
  15278. * The consumer of these words must also explicitly check the version bit,
  15279. * and only use the V0 definition if the VERSION field is set to 0.
  15280. *
  15281. * Version 1 is currently undefined, with the exception of the VALID and
  15282. * VERSION fields.
  15283. *
  15284. * Version 0:
  15285. *
  15286. * The fields below are duplicated per BW.
  15287. *
  15288. * The consumer must determine which BW field to use, based on the UL OFDMA
  15289. * PPDU BW indicated by HW.
  15290. *
  15291. * RU_START: RU26 start index for the user.
  15292. * Note that this is always using the RU26 index, regardless
  15293. * of the actual RU assigned to the user
  15294. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  15295. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  15296. *
  15297. * For example, 20MHz (the value in the top row is RU_START)
  15298. *
  15299. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  15300. * RU Size 1 (52): | | | | | |
  15301. * RU Size 2 (106): | | | |
  15302. * RU Size 3 (242): | |
  15303. *
  15304. * RU_SIZE: Indicates the RU size, as defined by enum
  15305. * htt_ul_ofdma_user_info_ru_size.
  15306. *
  15307. * LDPC: LDPC enabled (if 0, BCC is used)
  15308. *
  15309. * DCM: DCM enabled
  15310. *
  15311. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  15312. * |---------------------------------+--------------------------------|
  15313. * |Ver|Valid| FW internal |
  15314. * |---------------------------------+--------------------------------|
  15315. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  15316. * |---------------------------------+--------------------------------|
  15317. */
  15318. enum htt_ul_ofdma_user_info_ru_size {
  15319. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  15320. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  15321. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  15322. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  15323. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  15324. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  15325. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  15326. };
  15327. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  15328. struct htt_ul_ofdma_user_info_v0 {
  15329. A_UINT32 word0;
  15330. A_UINT32 word1;
  15331. };
  15332. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  15333. A_UINT32 w0_fw_rsvd:30; \
  15334. A_UINT32 w0_valid:1; \
  15335. A_UINT32 w0_version:1;
  15336. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  15337. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15338. };
  15339. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  15340. A_UINT32 w1_nss:3; \
  15341. A_UINT32 w1_mcs:4; \
  15342. A_UINT32 w1_ldpc:1; \
  15343. A_UINT32 w1_dcm:1; \
  15344. A_UINT32 w1_ru_start:7; \
  15345. A_UINT32 w1_ru_size:3; \
  15346. A_UINT32 w1_trig_type:4; \
  15347. A_UINT32 w1_unused:9;
  15348. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  15349. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15350. };
  15351. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  15352. A_UINT32 w0_fw_rsvd:27; \
  15353. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  15354. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  15355. 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) */
  15356. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  15357. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15358. };
  15359. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  15360. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  15361. A_UINT32 w1_trig_type:4; \
  15362. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  15363. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  15364. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15365. };
  15366. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  15367. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  15368. union {
  15369. A_UINT32 word0;
  15370. struct {
  15371. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15372. };
  15373. };
  15374. union {
  15375. A_UINT32 word1;
  15376. struct {
  15377. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15378. };
  15379. };
  15380. } POSTPACK;
  15381. /*
  15382. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  15383. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  15384. * this should be picked.
  15385. */
  15386. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  15387. union {
  15388. A_UINT32 word0;
  15389. struct {
  15390. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15391. };
  15392. };
  15393. union {
  15394. A_UINT32 word1;
  15395. struct {
  15396. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15397. };
  15398. };
  15399. } POSTPACK;
  15400. enum HTT_UL_OFDMA_TRIG_TYPE {
  15401. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  15402. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  15403. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  15404. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  15405. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  15406. };
  15407. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  15408. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  15409. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  15410. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  15411. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  15412. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  15413. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  15414. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  15415. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  15416. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  15417. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  15418. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  15419. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  15420. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  15421. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  15422. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  15423. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  15424. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  15425. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  15426. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  15427. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  15428. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  15429. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  15430. /*--- word 0 ---*/
  15431. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  15432. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  15433. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  15434. do { \
  15435. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  15436. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  15437. } while (0)
  15438. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  15439. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  15440. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  15441. do { \
  15442. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  15443. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  15444. } while (0)
  15445. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  15446. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  15447. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  15448. do { \
  15449. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  15450. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  15451. } while (0)
  15452. /*--- word 1 ---*/
  15453. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  15454. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  15455. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  15456. do { \
  15457. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  15458. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  15459. } while (0)
  15460. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  15461. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  15462. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  15463. do { \
  15464. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  15465. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  15466. } while (0)
  15467. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  15468. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  15469. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  15470. do { \
  15471. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  15472. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  15473. } while (0)
  15474. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  15475. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  15476. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  15477. do { \
  15478. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  15479. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  15480. } while (0)
  15481. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  15482. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  15483. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  15484. do { \
  15485. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  15486. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  15487. } while (0)
  15488. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  15489. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  15490. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  15491. do { \
  15492. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  15493. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  15494. } while (0)
  15495. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  15496. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  15497. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  15498. do { \
  15499. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  15500. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  15501. } while (0)
  15502. /**
  15503. * @brief target -> host channel calibration data message
  15504. *
  15505. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  15506. *
  15507. * @brief host -> target channel calibration data message
  15508. *
  15509. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  15510. *
  15511. * @details
  15512. * The following field definitions describe the format of the channel
  15513. * calibration data message sent from the target to the host when
  15514. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  15515. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  15516. * The message is defined as htt_chan_caldata_msg followed by a variable
  15517. * number of 32-bit character values.
  15518. *
  15519. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  15520. * |------------------------------------------------------------------|
  15521. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  15522. * |------------------------------------------------------------------|
  15523. * | payload size | mhz |
  15524. * |------------------------------------------------------------------|
  15525. * | center frequency 2 | center frequency 1 |
  15526. * |------------------------------------------------------------------|
  15527. * | check sum |
  15528. * |------------------------------------------------------------------|
  15529. * | payload |
  15530. * |------------------------------------------------------------------|
  15531. * message info field:
  15532. * - MSG_TYPE
  15533. * Bits 7:0
  15534. * Purpose: identifies this as a channel calibration data message
  15535. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  15536. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  15537. * - SUB_TYPE
  15538. * Bits 11:8
  15539. * Purpose: T2H: indicates whether target is providing chan cal data
  15540. * to the host to store, or requesting that the host
  15541. * download previously-stored data.
  15542. * H2T: indicates whether the host is providing the requested
  15543. * channel cal data, or if it is rejecting the data
  15544. * request because it does not have the requested data.
  15545. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  15546. * - CHKSUM_VALID
  15547. * Bit 12
  15548. * Purpose: indicates if the checksum field is valid
  15549. * value:
  15550. * - FRAG
  15551. * Bit 19:16
  15552. * Purpose: indicates the fragment index for message
  15553. * value: 0 for first fragment, 1 for second fragment, ...
  15554. * - APPEND
  15555. * Bit 20
  15556. * Purpose: indicates if this is the last fragment
  15557. * value: 0 = final fragment, 1 = more fragments will be appended
  15558. *
  15559. * channel and payload size field
  15560. * - MHZ
  15561. * Bits 15:0
  15562. * Purpose: indicates the channel primary frequency
  15563. * Value:
  15564. * - PAYLOAD_SIZE
  15565. * Bits 31:16
  15566. * Purpose: indicates the bytes of calibration data in payload
  15567. * Value:
  15568. *
  15569. * center frequency field
  15570. * - CENTER FREQUENCY 1
  15571. * Bits 15:0
  15572. * Purpose: indicates the channel center frequency
  15573. * Value: channel center frequency, in MHz units
  15574. * - CENTER FREQUENCY 2
  15575. * Bits 31:16
  15576. * Purpose: indicates the secondary channel center frequency,
  15577. * only for 11acvht 80plus80 mode
  15578. * Value: secondary channel center frequeny, in MHz units, if applicable
  15579. *
  15580. * checksum field
  15581. * - CHECK_SUM
  15582. * Bits 31:0
  15583. * Purpose: check the payload data, it is just for this fragment.
  15584. * This is intended for the target to check that the channel
  15585. * calibration data returned by the host is the unmodified data
  15586. * that was previously provided to the host by the target.
  15587. * value: checksum of fragment payload
  15588. */
  15589. PREPACK struct htt_chan_caldata_msg {
  15590. /* DWORD 0: message info */
  15591. A_UINT32
  15592. msg_type: 8,
  15593. sub_type: 4 ,
  15594. chksum_valid: 1, /** 1:valid, 0:invalid */
  15595. reserved1: 3,
  15596. frag_idx: 4, /** fragment index for calibration data */
  15597. appending: 1, /** 0: no fragment appending,
  15598. * 1: extra fragment appending */
  15599. reserved2: 11;
  15600. /* DWORD 1: channel and payload size */
  15601. A_UINT32
  15602. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  15603. payload_size: 16; /** unit: bytes */
  15604. /* DWORD 2: center frequency */
  15605. A_UINT32
  15606. band_center_freq1: 16, /** Center frequency 1 in MHz */
  15607. band_center_freq2: 16; /** Center frequency 2 in MHz,
  15608. * valid only for 11acvht 80plus80 mode */
  15609. /* DWORD 3: check sum */
  15610. A_UINT32 chksum;
  15611. /* variable length for calibration data */
  15612. A_UINT32 payload[1/* or more */];
  15613. } POSTPACK;
  15614. /* T2H SUBTYPE */
  15615. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  15616. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  15617. /* H2T SUBTYPE */
  15618. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  15619. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  15620. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  15621. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  15622. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  15623. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  15624. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  15625. do { \
  15626. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  15627. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  15628. } while (0)
  15629. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  15630. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  15631. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  15632. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  15633. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  15634. do { \
  15635. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  15636. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  15637. } while (0)
  15638. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  15639. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  15640. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  15641. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  15642. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  15643. do { \
  15644. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  15645. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  15646. } while (0)
  15647. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  15648. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  15649. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  15650. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  15651. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  15652. do { \
  15653. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  15654. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  15655. } while (0)
  15656. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  15657. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  15658. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  15659. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  15660. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  15661. do { \
  15662. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  15663. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  15664. } while (0)
  15665. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  15666. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  15667. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  15668. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  15669. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  15670. do { \
  15671. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  15672. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  15673. } while (0)
  15674. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  15675. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  15676. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  15677. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  15678. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  15679. do { \
  15680. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  15681. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  15682. } while (0)
  15683. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  15684. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  15685. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  15686. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  15687. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  15688. do { \
  15689. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  15690. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  15691. } while (0)
  15692. /**
  15693. * @brief target -> host FSE CMEM based send
  15694. *
  15695. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  15696. *
  15697. * @details
  15698. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  15699. * FSE placement in CMEM is enabled.
  15700. *
  15701. * This message sends the non-secure CMEM base address.
  15702. * It will be sent to host in response to message
  15703. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  15704. * The message would appear as follows:
  15705. *
  15706. * |31 24|23 16|15 8|7 0|
  15707. * |----------------+----------------+----------------+----------------|
  15708. * | reserved | num_entries | msg_type |
  15709. * |----------------+----------------+----------------+----------------|
  15710. * | base_address_lo |
  15711. * |----------------+----------------+----------------+----------------|
  15712. * | base_address_hi |
  15713. * |-------------------------------------------------------------------|
  15714. *
  15715. * The message is interpreted as follows:
  15716. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  15717. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  15718. * b'8:15 - number_entries: Indicated the number of entries
  15719. * programmed.
  15720. * b'16:31 - reserved.
  15721. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  15722. * CMEM base address
  15723. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  15724. * CMEM base address
  15725. */
  15726. PREPACK struct htt_cmem_base_send_t {
  15727. A_UINT32 msg_type: 8,
  15728. num_entries: 8,
  15729. reserved: 16;
  15730. A_UINT32 base_address_lo;
  15731. A_UINT32 base_address_hi;
  15732. } POSTPACK;
  15733. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  15734. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  15735. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  15736. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  15737. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  15738. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  15739. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  15740. do { \
  15741. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  15742. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  15743. } while (0)
  15744. /**
  15745. * @brief - HTT PPDU ID format
  15746. *
  15747. * @details
  15748. * The following field definitions describe the format of the PPDU ID.
  15749. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  15750. *
  15751. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  15752. * +--------------------------------------------------------------------------
  15753. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  15754. * +--------------------------------------------------------------------------
  15755. *
  15756. * sch id :Schedule command id
  15757. * Bits [11 : 0] : monotonically increasing counter to track the
  15758. * PPDU posted to a specific transmit queue.
  15759. *
  15760. * hwq_id: Hardware Queue ID.
  15761. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  15762. *
  15763. * mac_id: MAC ID
  15764. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  15765. *
  15766. * seq_idx: Sequence index.
  15767. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  15768. * a particular TXOP.
  15769. *
  15770. * tqm_cmd: HWSCH/TQM flag.
  15771. * Bit [23] : Always set to 0.
  15772. *
  15773. * seq_cmd_type: Sequence command type.
  15774. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  15775. * Refer to enum HTT_STATS_FTYPE for values.
  15776. */
  15777. PREPACK struct htt_ppdu_id {
  15778. A_UINT32
  15779. sch_id: 12,
  15780. hwq_id: 5,
  15781. mac_id: 2,
  15782. seq_idx: 2,
  15783. reserved1: 2,
  15784. tqm_cmd: 1,
  15785. seq_cmd_type: 6,
  15786. reserved2: 2;
  15787. } POSTPACK;
  15788. #define HTT_PPDU_ID_SCH_ID_S 0
  15789. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  15790. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  15791. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  15792. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  15793. do { \
  15794. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  15795. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  15796. } while (0)
  15797. #define HTT_PPDU_ID_HWQ_ID_S 12
  15798. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  15799. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  15800. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  15801. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  15802. do { \
  15803. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  15804. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  15805. } while (0)
  15806. #define HTT_PPDU_ID_MAC_ID_S 17
  15807. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  15808. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  15809. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  15810. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  15811. do { \
  15812. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  15813. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  15814. } while (0)
  15815. #define HTT_PPDU_ID_SEQ_IDX_S 19
  15816. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  15817. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  15818. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  15819. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  15820. do { \
  15821. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  15822. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  15823. } while (0)
  15824. #define HTT_PPDU_ID_TQM_CMD_S 23
  15825. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  15826. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  15827. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  15828. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  15829. do { \
  15830. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  15831. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  15832. } while (0)
  15833. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  15834. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  15835. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  15836. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  15837. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  15838. do { \
  15839. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  15840. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  15841. } while (0)
  15842. /**
  15843. * @brief target -> RX PEER METADATA V0 format
  15844. * Host will know the peer metadata version from the wmi_service_ready_ext2
  15845. * message from target, and will confirm to the target which peer metadata
  15846. * version to use in the wmi_init message.
  15847. *
  15848. * The following diagram shows the format of the RX PEER METADATA.
  15849. *
  15850. * |31 24|23 16|15 8|7 0|
  15851. * |-----------------------------------------------------------------------|
  15852. * | Reserved | VDEV ID | PEER ID |
  15853. * |-----------------------------------------------------------------------|
  15854. */
  15855. PREPACK struct htt_rx_peer_metadata_v0 {
  15856. A_UINT32
  15857. peer_id: 16,
  15858. vdev_id: 8,
  15859. reserved1: 8;
  15860. } POSTPACK;
  15861. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  15862. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  15863. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  15864. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  15865. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  15866. do { \
  15867. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  15868. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  15869. } while (0)
  15870. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  15871. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  15872. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  15873. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  15874. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  15875. do { \
  15876. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  15877. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  15878. } while (0)
  15879. /**
  15880. * @brief target -> RX PEER METADATA V1 format
  15881. * Host will know the peer metadata version from the wmi_service_ready_ext2
  15882. * message from target, and will confirm to the target which peer metadata
  15883. * version to use in the wmi_init message.
  15884. *
  15885. * The following diagram shows the format of the RX PEER METADATA V1 format.
  15886. *
  15887. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  15888. * |-----------------------------------------------------------------------|
  15889. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  15890. * |-----------------------------------------------------------------------|
  15891. */
  15892. PREPACK struct htt_rx_peer_metadata_v1 {
  15893. A_UINT32
  15894. peer_id: 13,
  15895. ml_peer_valid: 1,
  15896. reserved1: 2,
  15897. vdev_id: 8,
  15898. lmac_id: 2,
  15899. chip_id: 3,
  15900. reserved2: 3;
  15901. } POSTPACK;
  15902. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  15903. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  15904. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  15905. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  15906. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  15907. do { \
  15908. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  15909. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  15910. } while (0)
  15911. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  15912. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  15913. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  15914. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  15915. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  15916. do { \
  15917. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  15918. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  15919. } while (0)
  15920. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  15921. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  15922. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  15923. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  15924. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  15925. do { \
  15926. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  15927. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  15928. } while (0)
  15929. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  15930. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  15931. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  15932. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  15933. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  15934. do { \
  15935. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  15936. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  15937. } while (0)
  15938. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  15939. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  15940. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  15941. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  15942. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  15943. do { \
  15944. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  15945. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  15946. } while (0)
  15947. /*
  15948. * In some systems, the host SW wants to specify priorities between
  15949. * different MSDU / flow queues within the same peer-TID.
  15950. * The below enums are used for the host to identify to the target
  15951. * which MSDU queue's priority it wants to adjust.
  15952. */
  15953. /*
  15954. * The MSDUQ index describe index of TCL HW, where each index is
  15955. * used for queuing particular types of MSDUs.
  15956. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  15957. */
  15958. enum HTT_MSDUQ_INDEX {
  15959. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  15960. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  15961. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  15962. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  15963. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  15964. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  15965. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  15966. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  15967. HTT_MSDUQ_MAX_INDEX,
  15968. };
  15969. /* MSDU qtype definition */
  15970. enum HTT_MSDU_QTYPE {
  15971. /*
  15972. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  15973. * relative priority. Instead, the relative priority of CRIT_0 versus
  15974. * CRIT_1 is controlled by the FW, through the configuration parameters
  15975. * it applies to the queues.
  15976. */
  15977. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  15978. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  15979. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  15980. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  15981. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  15982. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  15983. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  15984. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  15985. /* New MSDU_QTYPE should be added above this line */
  15986. /*
  15987. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  15988. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  15989. * any host/target message definitions. The QTYPE_MAX value can
  15990. * only be used internally within the host or within the target.
  15991. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  15992. * it must regard the unexpected value as a default qtype value,
  15993. * or ignore it.
  15994. */
  15995. HTT_MSDU_QTYPE_MAX,
  15996. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  15997. };
  15998. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  15999. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  16000. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  16001. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  16002. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  16003. };
  16004. /**
  16005. * @brief target -> host mlo timestamp offset indication
  16006. *
  16007. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16008. *
  16009. * @details
  16010. * The following field definitions describe the format of the HTT target
  16011. * to host mlo timestamp offset indication message.
  16012. *
  16013. *
  16014. * |31 16|15 12|11 10|9 8|7 0 |
  16015. * |----------------------------------------------------------------------|
  16016. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  16017. * |----------------------------------------------------------------------|
  16018. * | Sync time stamp lo in us |
  16019. * |----------------------------------------------------------------------|
  16020. * | Sync time stamp hi in us |
  16021. * |----------------------------------------------------------------------|
  16022. * | mlo time stamp offset lo in us |
  16023. * |----------------------------------------------------------------------|
  16024. * | mlo time stamp offset hi in us |
  16025. * |----------------------------------------------------------------------|
  16026. * | mlo time stamp offset clocks in clock ticks |
  16027. * |----------------------------------------------------------------------|
  16028. * |31 26|25 16|15 0 |
  16029. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  16030. * | | compensation in clks | |
  16031. * |----------------------------------------------------------------------|
  16032. * |31 22|21 0 |
  16033. * | rsvd 3 | mlo time stamp comp timer period |
  16034. * |----------------------------------------------------------------------|
  16035. * The message is interpreted as follows:
  16036. *
  16037. * dword0 - b'0:7 - msg_type: This will be set to
  16038. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16039. * value: 0x28
  16040. *
  16041. * dword0 - b'9:8 - pdev_id
  16042. *
  16043. * dword0 - b'11:10 - chip_id
  16044. *
  16045. * dword0 - b'15:12 - rsvd1: Reserved for future use
  16046. *
  16047. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  16048. *
  16049. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  16050. * which last sync interrupt was received
  16051. *
  16052. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  16053. * which last sync interrupt was received
  16054. *
  16055. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  16056. *
  16057. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  16058. *
  16059. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  16060. *
  16061. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  16062. *
  16063. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  16064. * for sub us resolution
  16065. *
  16066. * dword6 - b'31:26 - rsvd2: Reserved for future use
  16067. *
  16068. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  16069. * is applied, in us
  16070. *
  16071. * dword7 - b'31:22 - rsvd3: Reserved for future use
  16072. */
  16073. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  16074. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  16075. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  16076. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  16077. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  16078. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  16079. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  16080. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  16081. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  16082. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  16083. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  16084. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  16085. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  16086. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  16087. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  16088. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  16089. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  16090. do { \
  16091. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  16092. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  16093. } while (0)
  16094. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  16095. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  16096. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  16097. do { \
  16098. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  16099. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  16100. } while (0)
  16101. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  16102. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  16103. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  16104. do { \
  16105. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  16106. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  16107. } while (0)
  16108. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  16109. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  16110. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  16111. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  16112. do { \
  16113. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  16114. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  16115. } while (0)
  16116. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  16117. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  16118. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  16119. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  16120. do { \
  16121. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  16122. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  16123. } while (0)
  16124. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  16125. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  16126. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  16127. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  16128. do { \
  16129. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  16130. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  16131. } while (0)
  16132. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  16133. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  16134. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  16135. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  16136. do { \
  16137. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  16138. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  16139. } while (0)
  16140. typedef struct {
  16141. A_UINT32 msg_type: 8, /* bits 7:0 */
  16142. pdev_id: 2, /* bits 9:8 */
  16143. chip_id: 2, /* bits 11:10 */
  16144. reserved1: 4, /* bits 15:12 */
  16145. mac_clk_freq_mhz: 16; /* bits 31:16 */
  16146. A_UINT32 sync_timestamp_lo_us;
  16147. A_UINT32 sync_timestamp_hi_us;
  16148. A_UINT32 mlo_timestamp_offset_lo_us;
  16149. A_UINT32 mlo_timestamp_offset_hi_us;
  16150. A_UINT32 mlo_timestamp_offset_clks;
  16151. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  16152. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  16153. reserved2: 6; /* bits 31:26 */
  16154. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  16155. reserved3: 10; /* bits 31:22 */
  16156. } htt_t2h_mlo_offset_ind_t;
  16157. /*
  16158. * @brief target -> host VDEV TX RX STATS
  16159. *
  16160. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  16161. *
  16162. * @details
  16163. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  16164. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  16165. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  16166. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  16167. * periodically by target even in the absence of any further HTT request
  16168. * messages from host.
  16169. *
  16170. * The message is formatted as follows:
  16171. *
  16172. * |31 16|15 8|7 0|
  16173. * |---------------------------------+----------------+----------------|
  16174. * | payload_size | pdev_id | msg_type |
  16175. * |---------------------------------+----------------+----------------|
  16176. * | reserved0 |
  16177. * |-------------------------------------------------------------------|
  16178. * | reserved1 |
  16179. * |-------------------------------------------------------------------|
  16180. * | reserved2 |
  16181. * |-------------------------------------------------------------------|
  16182. * | |
  16183. * | VDEV specific Tx Rx stats info |
  16184. * | |
  16185. * |-------------------------------------------------------------------|
  16186. *
  16187. * The message is interpreted as follows:
  16188. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  16189. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  16190. * b'8:15 - pdev_id
  16191. * b'16:31 - size in bytes of the payload that follows the 16-byte
  16192. * message header fields (msg_type through reserved2)
  16193. * dword1 - b'0:31 - reserved0.
  16194. * dword2 - b'0:31 - reserved1.
  16195. * dword3 - b'0:31 - reserved2.
  16196. */
  16197. typedef struct {
  16198. A_UINT32 msg_type: 8,
  16199. pdev_id: 8,
  16200. payload_size: 16;
  16201. A_UINT32 reserved0;
  16202. A_UINT32 reserved1;
  16203. A_UINT32 reserved2;
  16204. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  16205. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  16206. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  16207. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  16208. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  16209. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  16210. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  16211. do { \
  16212. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  16213. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  16214. } while (0)
  16215. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  16216. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  16217. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  16218. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  16219. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  16220. do { \
  16221. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  16222. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  16223. } while (0)
  16224. /* SOC related stats */
  16225. typedef struct {
  16226. htt_tlv_hdr_t tlv_hdr;
  16227. /* When TQM is not able to find the peers during Tx, then it drops the packets
  16228. * This can be due to either the peer is deleted or deletion is ongoing
  16229. * */
  16230. A_UINT32 inv_peers_msdu_drop_count_lo;
  16231. A_UINT32 inv_peers_msdu_drop_count_hi;
  16232. } htt_t2h_soc_txrx_stats_common_tlv;
  16233. /* VDEV HW Tx/Rx stats */
  16234. typedef struct {
  16235. htt_tlv_hdr_t tlv_hdr;
  16236. A_UINT32 vdev_id;
  16237. /* Rx msdu byte cnt */
  16238. A_UINT32 rx_msdu_byte_cnt_lo;
  16239. A_UINT32 rx_msdu_byte_cnt_hi;
  16240. /* Rx msdu cnt */
  16241. A_UINT32 rx_msdu_cnt_lo;
  16242. A_UINT32 rx_msdu_cnt_hi;
  16243. /* tx msdu byte cnt */
  16244. A_UINT32 tx_msdu_byte_cnt_lo;
  16245. A_UINT32 tx_msdu_byte_cnt_hi;
  16246. /* tx msdu cnt */
  16247. A_UINT32 tx_msdu_cnt_lo;
  16248. A_UINT32 tx_msdu_cnt_hi;
  16249. /* tx excessive retry discarded msdu cnt */
  16250. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  16251. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  16252. /* TX congestion ctrl msdu drop cnt */
  16253. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  16254. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  16255. /* discarded tx msdus cnt coz of time to live expiry */
  16256. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  16257. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  16258. /* tx excessive retry discarded msdu byte cnt */
  16259. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  16260. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  16261. /* TX congestion ctrl msdu drop byte cnt */
  16262. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  16263. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  16264. /* discarded tx msdus byte cnt coz of time to live expiry */
  16265. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  16266. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  16267. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  16268. /*
  16269. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  16270. *
  16271. * @details
  16272. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  16273. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  16274. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  16275. * the default MSDU queues of each of the specified TIDs for the peer
  16276. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  16277. * If the default MSDU queues of a given TID within the peer are not linked
  16278. * to a service class, the svc_class_id field for that TID will have a
  16279. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  16280. * queues for that TID are not mapped to any service class.
  16281. *
  16282. * |31 16|15 8|7 0|
  16283. * |------------------------------+--------------+--------------|
  16284. * | peer ID | reserved | msg type |
  16285. * |------------------------------+--------------+------+-------|
  16286. * | reserved | svc class ID | TID |
  16287. * |------------------------------------------------------------|
  16288. * ...
  16289. * |------------------------------------------------------------|
  16290. * | reserved | svc class ID | TID |
  16291. * |------------------------------------------------------------|
  16292. * Header fields:
  16293. * dword0 - b'7:0 - msg_type: This will be set to
  16294. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  16295. * b'31:16 - peer ID
  16296. * dword1 - b'7:0 - TID
  16297. * b'15:8 - svc class ID
  16298. * (dword2, etc. same format as dword1)
  16299. */
  16300. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  16301. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  16302. A_UINT32 msg_type :8,
  16303. reserved0 :8,
  16304. peer_id :16;
  16305. struct {
  16306. A_UINT32 tid :8,
  16307. svc_class_id :8,
  16308. reserved1 :16;
  16309. } tid_reports[1/*or more*/];
  16310. } POSTPACK;
  16311. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  16312. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  16313. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  16314. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  16315. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  16316. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  16317. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  16318. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  16319. do { \
  16320. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  16321. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  16322. } while (0)
  16323. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  16324. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  16325. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  16326. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  16327. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  16328. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  16329. do { \
  16330. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  16331. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  16332. } while (0)
  16333. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  16334. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  16335. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  16336. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  16337. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  16338. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  16339. do { \
  16340. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  16341. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  16342. } while (0)
  16343. /*
  16344. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  16345. *
  16346. * @details
  16347. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  16348. * flow if the flow is seen the associated service class is conveyed to the
  16349. * target via TCL Data Command. Target on the other hand internally creates the
  16350. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  16351. * of the newly created MSDUQ and some other identifiers to uniquely identity
  16352. * the newly created MSDUQ
  16353. *
  16354. * |31 27| 24|23 16|15 11|10|9 8|7 4|3 0|
  16355. * |------------------------------+----------------------+--------------|
  16356. * | peer ID | HTT qtype | msg type |
  16357. * |--------+---------------------+---------------+--+---+-------+------|
  16358. * |reserved| Ast Index |FO|WC | HLOS | remap|
  16359. * | | | | | TID | TID |
  16360. * |---------------------+----------------------------------------------|
  16361. * | reserved1 | tgt_opaque_id |
  16362. * |---------------------+----------------------------------------------|
  16363. *
  16364. * Header fields:
  16365. *
  16366. * dword0 - b'7:0 - msg_type: This will be set to
  16367. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  16368. * b'15:8 - HTT qtype
  16369. * b'31:16 - peer ID
  16370. *
  16371. * dword1 - b'3:0 - remap TID, as assigned in firmware
  16372. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  16373. * hlos_tid : Common to Lithium and Beryllium
  16374. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  16375. * TCL Data Command : Beryllium
  16376. * b10 - flow_override (FO), as sent by host in
  16377. * TCL Data Command: Beryllium
  16378. * b11:26 - ast_index
  16379. * Dummy AST Index in case of Lithium,
  16380. * Default AST Index in case of Beryllium
  16381. * b27:32 - reserved
  16382. *
  16383. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  16384. * unique MSDUQ id in firmware
  16385. * b'24:31 - reserved1
  16386. */
  16387. PREPACK struct htt_t2h_sawf_msduq_event {
  16388. A_UINT32 msg_type : 8,
  16389. htt_qtype : 8,
  16390. peer_id :16;
  16391. A_UINT32 remap_tid : 4,
  16392. hlos_tid : 4,
  16393. who_classify_info_sel : 2,
  16394. flow_override : 1,
  16395. ast_index :16,
  16396. reserved : 5;
  16397. A_UINT32 tgt_opaque_id :24,
  16398. reserved1 : 8;
  16399. } POSTPACK;
  16400. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  16401. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  16402. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  16403. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  16404. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  16405. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  16406. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  16407. do { \
  16408. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  16409. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  16410. } while (0)
  16411. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  16412. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  16413. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  16414. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  16415. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  16416. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  16417. do { \
  16418. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  16419. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  16420. } while (0)
  16421. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  16422. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  16423. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  16424. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  16425. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  16426. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  16427. do { \
  16428. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  16429. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  16430. } while (0)
  16431. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  16432. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  16433. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  16434. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  16435. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  16436. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  16437. do { \
  16438. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  16439. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  16440. } while (0)
  16441. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  16442. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  16443. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  16444. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  16445. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  16446. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  16447. do { \
  16448. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  16449. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  16450. } while (0)
  16451. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  16452. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  16453. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  16454. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  16455. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  16456. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  16457. do { \
  16458. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  16459. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  16460. } while (0)
  16461. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_M 0x07FFF800
  16462. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_S 11
  16463. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_GET(_var) \
  16464. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_M) >> \
  16465. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_S)
  16466. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_SET(_var, _val) \
  16467. do { \
  16468. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX, _val); \
  16469. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_S)); \
  16470. } while (0)
  16471. #endif