htt.h 822 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  168. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  169. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  170. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  171. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  172. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  173. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  174. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  175. * array to the end of HTT_T2H TX_COMPL_IND msg
  176. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  177. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  178. * for a MSDU.
  179. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  180. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  181. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  182. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  183. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  184. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  185. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  186. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  187. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  188. * htt_tx_data_hdr_information
  189. * 3.73 Add channel pre-calibration data upload and download messages defs for
  190. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  191. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  192. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  193. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  194. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  195. * 3.78 Add htt_ppdu_id def.
  196. * 3.79 Add HTT_NUM_AC_WMM def.
  197. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  198. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  199. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  200. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  201. * 3.84 Add fisa_control_bits_v2 def.
  202. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  203. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  204. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  205. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  206. * 3.89 Add MSDU queue enumerations.
  207. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  208. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  209. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  210. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  211. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  212. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  213. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  214. * 3.96 Modify HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  215. * 3.97 Add tx MSDU drop byte count fields in vdev_txrx_stats_hw_stats TLV.
  216. * 3.98 Add htt_tx_tcl_metadata_v2 def.
  217. * 3.99 Add HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ, _UNMAP_REQ, _MAP_REPORT_REQ and
  218. * HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF defs.
  219. * 3.100 Add htt_tx_wbm_completion_v3 def.
  220. * 3.101 Add HTT_UL_OFDMA_USER_INFO_V1_BITMAP defs.
  221. * 3.102 Add HTT_H2T_MSG_TYPE_MSI_SETUP def.
  222. * 3.103 Add HTT_T2H_SAWF_MSDUQ_INFO_IND defs.
  223. */
  224. #define HTT_CURRENT_VERSION_MAJOR 3
  225. #define HTT_CURRENT_VERSION_MINOR 103
  226. #define HTT_NUM_TX_FRAG_DESC 1024
  227. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  228. #define HTT_CHECK_SET_VAL(field, val) \
  229. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  230. /* macros to assist in sign-extending fields from HTT messages */
  231. #define HTT_SIGN_BIT_MASK(field) \
  232. ((field ## _M + (1 << field ## _S)) >> 1)
  233. #define HTT_SIGN_BIT(_val, field) \
  234. (_val & HTT_SIGN_BIT_MASK(field))
  235. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  236. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  237. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  238. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  239. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  240. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  241. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  242. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  243. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  244. /*
  245. * TEMPORARY:
  246. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  247. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  248. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  249. * updated.
  250. */
  251. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  252. /*
  253. * TEMPORARY:
  254. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  255. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  256. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  257. * updated.
  258. */
  259. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  260. /*
  261. * htt_dbg_stats_type -
  262. * bit positions for each stats type within a stats type bitmask
  263. * The bitmask contains 24 bits.
  264. */
  265. enum htt_dbg_stats_type {
  266. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  267. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  268. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  269. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  270. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  271. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  272. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  273. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  274. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  275. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  276. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  277. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  278. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  279. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  280. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  281. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  282. /* bits 16-23 currently reserved */
  283. /* keep this last */
  284. HTT_DBG_NUM_STATS
  285. };
  286. /*=== HTT option selection TLVs ===
  287. * Certain HTT messages have alternatives or options.
  288. * For such cases, the host and target need to agree on which option to use.
  289. * Option specification TLVs can be appended to the VERSION_REQ and
  290. * VERSION_CONF messages to select options other than the default.
  291. * These TLVs are entirely optional - if they are not provided, there is a
  292. * well-defined default for each option. If they are provided, they can be
  293. * provided in any order. Each TLV can be present or absent independent of
  294. * the presence / absence of other TLVs.
  295. *
  296. * The HTT option selection TLVs use the following format:
  297. * |31 16|15 8|7 0|
  298. * |---------------------------------+----------------+----------------|
  299. * | value (payload) | length | tag |
  300. * |-------------------------------------------------------------------|
  301. * The value portion need not be only 2 bytes; it can be extended by any
  302. * integer number of 4-byte units. The total length of the TLV, including
  303. * the tag and length fields, must be a multiple of 4 bytes. The length
  304. * field specifies the total TLV size in 4-byte units. Thus, the typical
  305. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  306. * field, would store 0x1 in its length field, to show that the TLV occupies
  307. * a single 4-byte unit.
  308. */
  309. /*--- TLV header format - applies to all HTT option TLVs ---*/
  310. enum HTT_OPTION_TLV_TAGS {
  311. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  312. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  313. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  314. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  315. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  316. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  317. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  318. };
  319. PREPACK struct htt_option_tlv_header_t {
  320. A_UINT8 tag;
  321. A_UINT8 length;
  322. } POSTPACK;
  323. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  324. #define HTT_OPTION_TLV_TAG_S 0
  325. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  326. #define HTT_OPTION_TLV_LENGTH_S 8
  327. /*
  328. * value0 - 16 bit value field stored in word0
  329. * The TLV's value field may be longer than 2 bytes, in which case
  330. * the remainder of the value is stored in word1, word2, etc.
  331. */
  332. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  333. #define HTT_OPTION_TLV_VALUE0_S 16
  334. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  335. do { \
  336. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  337. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  338. } while (0)
  339. #define HTT_OPTION_TLV_TAG_GET(word) \
  340. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  341. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  342. do { \
  343. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  344. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  345. } while (0)
  346. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  347. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  348. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  349. do { \
  350. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  351. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  352. } while (0)
  353. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  354. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  355. /*--- format of specific HTT option TLVs ---*/
  356. /*
  357. * HTT option TLV for specifying LL bus address size
  358. * Some chips require bus addresses used by the target to access buffers
  359. * within the host's memory to be 32 bits; others require bus addresses
  360. * used by the target to access buffers within the host's memory to be
  361. * 64 bits.
  362. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  363. * a suffix to the VERSION_CONF message to specify which bus address format
  364. * the target requires.
  365. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  366. * default to providing bus addresses to the target in 32-bit format.
  367. */
  368. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  369. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  370. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  371. };
  372. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  373. struct htt_option_tlv_header_t hdr;
  374. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  375. } POSTPACK;
  376. /*
  377. * HTT option TLV for specifying whether HL systems should indicate
  378. * over-the-air tx completion for individual frames, or should instead
  379. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  380. * requests an OTA tx completion for a particular tx frame.
  381. * This option does not apply to LL systems, where the TX_COMPL_IND
  382. * is mandatory.
  383. * This option is primarily intended for HL systems in which the tx frame
  384. * downloads over the host --> target bus are as slow as or slower than
  385. * the transmissions over the WLAN PHY. For cases where the bus is faster
  386. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  387. * and consquently will send one TX_COMPL_IND message that covers several
  388. * tx frames. For cases where the WLAN PHY is faster than the bus,
  389. * the target will end up transmitting very short A-MPDUs, and consequently
  390. * sending many TX_COMPL_IND messages, which each cover a very small number
  391. * of tx frames.
  392. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  393. * a suffix to the VERSION_REQ message to request whether the host desires to
  394. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  395. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  396. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  397. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  398. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  399. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  400. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  401. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  402. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  403. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  404. * TLV.
  405. */
  406. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  407. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  408. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  409. };
  410. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  411. struct htt_option_tlv_header_t hdr;
  412. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  413. } POSTPACK;
  414. /*
  415. * HTT option TLV for specifying how many tx queue groups the target
  416. * may establish.
  417. * This TLV specifies the maximum value the target may send in the
  418. * txq_group_id field of any TXQ_GROUP information elements sent by
  419. * the target to the host. This allows the host to pre-allocate an
  420. * appropriate number of tx queue group structs.
  421. *
  422. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  423. * a suffix to the VERSION_REQ message to specify whether the host supports
  424. * tx queue groups at all, and if so if there is any limit on the number of
  425. * tx queue groups that the host supports.
  426. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  427. * a suffix to the VERSION_CONF message. If the host has specified in the
  428. * VER_REQ message a limit on the number of tx queue groups the host can
  429. * supprt, the target shall limit its specification of the maximum tx groups
  430. * to be no larger than this host-specified limit.
  431. *
  432. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  433. * shall preallocate 4 tx queue group structs, and the target shall not
  434. * specify a txq_group_id larger than 3.
  435. */
  436. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  437. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  438. /*
  439. * values 1 through N specify the max number of tx queue groups
  440. * the sender supports
  441. */
  442. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  443. };
  444. /* TEMPORARY backwards-compatibility alias for a typo fix -
  445. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  446. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  447. * to support the old name (with the typo) until all references to the
  448. * old name are replaced with the new name.
  449. */
  450. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  451. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  452. struct htt_option_tlv_header_t hdr;
  453. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  454. } POSTPACK;
  455. /*
  456. * HTT option TLV for specifying whether the target supports an extended
  457. * version of the HTT tx descriptor. If the target provides this TLV
  458. * and specifies in the TLV that the target supports an extended version
  459. * of the HTT tx descriptor, the target must check the "extension" bit in
  460. * the HTT tx descriptor, and if the extension bit is set, to expect a
  461. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  462. * descriptor. Furthermore, the target must provide room for the HTT
  463. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  464. * This option is intended for systems where the host needs to explicitly
  465. * control the transmission parameters such as tx power for individual
  466. * tx frames.
  467. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  468. * as a suffix to the VERSION_CONF message to explicitly specify whether
  469. * the target supports the HTT tx MSDU extension descriptor.
  470. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  471. * by the host as lack of target support for the HTT tx MSDU extension
  472. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  473. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  474. * the HTT tx MSDU extension descriptor.
  475. * The host is not required to provide the HTT tx MSDU extension descriptor
  476. * just because the target supports it; the target must check the
  477. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  478. * extension descriptor is present.
  479. */
  480. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  481. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  482. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  483. };
  484. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  485. struct htt_option_tlv_header_t hdr;
  486. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  487. } POSTPACK;
  488. /*
  489. * For the tcl data command V2 and higher support added a new
  490. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  491. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  492. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  493. * HTT option TLV for specifying which version of the TCL metadata struct
  494. * should be used:
  495. * V1 -> use htt_tx_tcl_metadata struct
  496. * V2 -> use htt_tx_tcl_metadata_v2 struct
  497. * Old FW will only support V1.
  498. * New FW will support V2. New FW will still support V1, at least during
  499. * a transition period.
  500. * Similarly, old host will only support V1, and new host will support V1 + V2.
  501. *
  502. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  503. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  504. * of TCL metadata the host supports. If the host doesn't provide a
  505. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  506. * is implicitly understood that the host only supports V1.
  507. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  508. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  509. * the host shall use. The target shall only select one of the versions
  510. * supported by the host. If the target doesn't provide a
  511. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  512. * is implicitly understood that the V1 TCL metadata shall be used.
  513. */
  514. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  515. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  516. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  517. };
  518. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  519. struct htt_option_tlv_header_t hdr;
  520. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  521. } POSTPACK;
  522. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  523. HTT_OPTION_TLV_VALUE0_SET(word, value)
  524. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  525. HTT_OPTION_TLV_VALUE0_GET(word)
  526. typedef struct {
  527. union {
  528. /* BIT [11 : 0] :- tag
  529. * BIT [23 : 12] :- length
  530. * BIT [31 : 24] :- reserved
  531. */
  532. A_UINT32 tag__length;
  533. /*
  534. * The following struct is not endian-portable.
  535. * It is suitable for use within the target, which is known to be
  536. * little-endian.
  537. * The host should use the above endian-portable macros to access
  538. * the tag and length bitfields in an endian-neutral manner.
  539. */
  540. struct {
  541. A_UINT32 tag : 12, /* BIT [11 : 0] */
  542. length : 12, /* BIT [23 : 12] */
  543. reserved : 8; /* BIT [31 : 24] */
  544. };
  545. };
  546. } htt_tlv_hdr_t;
  547. typedef enum {
  548. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  549. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  550. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  551. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  552. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  553. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  554. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  555. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  556. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  557. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  558. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  559. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  560. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  561. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  562. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  563. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  564. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  565. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  566. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  567. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  568. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  569. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  570. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  571. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  572. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  573. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  574. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  575. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  576. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  577. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  578. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  579. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  580. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  581. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  582. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  583. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  584. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  585. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  586. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  587. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  588. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  589. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  590. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  591. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  592. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  593. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  594. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  595. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  596. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  597. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  598. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  599. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  600. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  601. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  602. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  603. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  604. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  605. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  606. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  607. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  608. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  609. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  610. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  611. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  612. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  613. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  614. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  615. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  616. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  617. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  618. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  619. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  620. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  621. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  622. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  623. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  624. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  625. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  626. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  627. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  628. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  629. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  630. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  631. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  632. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  633. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  634. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  635. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  636. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  637. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  638. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  639. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  640. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  641. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  642. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  643. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  644. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  645. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  646. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  647. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  648. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  649. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  650. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  651. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  652. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  653. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  654. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  655. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  656. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  657. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  658. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  659. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  660. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  661. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv */
  662. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv */
  663. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv */
  664. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv */
  665. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  666. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  667. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  668. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  669. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  670. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  671. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  672. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  673. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  674. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  675. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  676. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  677. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  678. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  679. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  680. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  681. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  682. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  683. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  684. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  685. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  686. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  687. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  688. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  689. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  690. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  691. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  692. HTT_STATS_MAX_TAG,
  693. } htt_tlv_tag_t;
  694. #define HTT_STATS_TLV_TAG_M 0x00000fff
  695. #define HTT_STATS_TLV_TAG_S 0
  696. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  697. #define HTT_STATS_TLV_LENGTH_S 12
  698. #define HTT_STATS_TLV_TAG_GET(_var) \
  699. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  700. HTT_STATS_TLV_TAG_S)
  701. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  702. do { \
  703. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  704. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  705. } while (0)
  706. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  707. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  708. HTT_STATS_TLV_LENGTH_S)
  709. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  710. do { \
  711. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  712. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  713. } while (0)
  714. /*=== host -> target messages ===============================================*/
  715. enum htt_h2t_msg_type {
  716. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  717. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  718. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  719. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  720. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  721. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  722. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  723. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  724. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  725. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  726. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  727. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  728. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  729. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  730. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  731. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  732. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  733. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  734. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  735. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  736. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  737. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  738. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  739. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  740. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  741. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  742. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  743. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  744. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  745. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  746. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  747. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  748. /* keep this last */
  749. HTT_H2T_NUM_MSGS
  750. };
  751. /*
  752. * HTT host to target message type -
  753. * stored in bits 7:0 of the first word of the message
  754. */
  755. #define HTT_H2T_MSG_TYPE_M 0xff
  756. #define HTT_H2T_MSG_TYPE_S 0
  757. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  758. do { \
  759. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  760. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  761. } while (0)
  762. #define HTT_H2T_MSG_TYPE_GET(word) \
  763. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  764. /**
  765. * @brief host -> target version number request message definition
  766. *
  767. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  768. *
  769. *
  770. * |31 24|23 16|15 8|7 0|
  771. * |----------------+----------------+----------------+----------------|
  772. * | reserved | msg type |
  773. * |-------------------------------------------------------------------|
  774. * : option request TLV (optional) |
  775. * :...................................................................:
  776. *
  777. * The VER_REQ message may consist of a single 4-byte word, or may be
  778. * extended with TLVs that specify which HTT options the host is requesting
  779. * from the target.
  780. * The following option TLVs may be appended to the VER_REQ message:
  781. * - HL_SUPPRESS_TX_COMPL_IND
  782. * - HL_MAX_TX_QUEUE_GROUPS
  783. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  784. * may be appended to the VER_REQ message (but only one TLV of each type).
  785. *
  786. * Header fields:
  787. * - MSG_TYPE
  788. * Bits 7:0
  789. * Purpose: identifies this as a version number request message
  790. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  791. */
  792. #define HTT_VER_REQ_BYTES 4
  793. /* TBDXXX: figure out a reasonable number */
  794. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  795. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  796. /**
  797. * @brief HTT tx MSDU descriptor
  798. *
  799. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  800. *
  801. * @details
  802. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  803. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  804. * the target firmware needs for the FW's tx processing, particularly
  805. * for creating the HW msdu descriptor.
  806. * The same HTT tx descriptor is used for HL and LL systems, though
  807. * a few fields within the tx descriptor are used only by LL or
  808. * only by HL.
  809. * The HTT tx descriptor is defined in two manners: by a struct with
  810. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  811. * definitions.
  812. * The target should use the struct def, for simplicitly and clarity,
  813. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  814. * neutral. Specifically, the host shall use the get/set macros built
  815. * around the mask + shift defs.
  816. */
  817. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  818. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  819. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  820. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  821. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  822. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  823. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  824. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  825. #define HTT_TX_VDEV_ID_WORD 0
  826. #define HTT_TX_VDEV_ID_MASK 0x3f
  827. #define HTT_TX_VDEV_ID_SHIFT 16
  828. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  829. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  830. #define HTT_TX_MSDU_LEN_DWORD 1
  831. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  832. /*
  833. * HTT_VAR_PADDR macros
  834. * Allow physical / bus addresses to be either a single 32-bit value,
  835. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  836. */
  837. #define HTT_VAR_PADDR32(var_name) \
  838. A_UINT32 var_name
  839. #define HTT_VAR_PADDR64_LE(var_name) \
  840. struct { \
  841. /* little-endian: lo precedes hi */ \
  842. A_UINT32 lo; \
  843. A_UINT32 hi; \
  844. } var_name
  845. /*
  846. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  847. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  848. * addresses are stored in a XXX-bit field.
  849. * This macro is used to define both htt_tx_msdu_desc32_t and
  850. * htt_tx_msdu_desc64_t structs.
  851. */
  852. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  853. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  854. { \
  855. /* DWORD 0: flags and meta-data */ \
  856. A_UINT32 \
  857. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  858. \
  859. /* pkt_subtype - \
  860. * Detailed specification of the tx frame contents, extending the \
  861. * general specification provided by pkt_type. \
  862. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  863. * pkt_type | pkt_subtype \
  864. * ============================================================== \
  865. * 802.3 | bit 0:3 - Reserved \
  866. * | bit 4: 0x0 - Copy-Engine Classification Results \
  867. * | not appended to the HTT message \
  868. * | 0x1 - Copy-Engine Classification Results \
  869. * | appended to the HTT message in the \
  870. * | format: \
  871. * | [HTT tx desc, frame header, \
  872. * | CE classification results] \
  873. * | The CE classification results begin \
  874. * | at the next 4-byte boundary after \
  875. * | the frame header. \
  876. * ------------+------------------------------------------------- \
  877. * Eth2 | bit 0:3 - Reserved \
  878. * | bit 4: 0x0 - Copy-Engine Classification Results \
  879. * | not appended to the HTT message \
  880. * | 0x1 - Copy-Engine Classification Results \
  881. * | appended to the HTT message. \
  882. * | See the above specification of the \
  883. * | CE classification results location. \
  884. * ------------+------------------------------------------------- \
  885. * native WiFi | bit 0:3 - Reserved \
  886. * | bit 4: 0x0 - Copy-Engine Classification Results \
  887. * | not appended to the HTT message \
  888. * | 0x1 - Copy-Engine Classification Results \
  889. * | appended to the HTT message. \
  890. * | See the above specification of the \
  891. * | CE classification results location. \
  892. * ------------+------------------------------------------------- \
  893. * mgmt | 0x0 - 802.11 MAC header absent \
  894. * | 0x1 - 802.11 MAC header present \
  895. * ------------+------------------------------------------------- \
  896. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  897. * | 0x1 - 802.11 MAC header present \
  898. * | bit 1: 0x0 - allow aggregation \
  899. * | 0x1 - don't allow aggregation \
  900. * | bit 2: 0x0 - perform encryption \
  901. * | 0x1 - don't perform encryption \
  902. * | bit 3: 0x0 - perform tx classification / queuing \
  903. * | 0x1 - don't perform tx classification; \
  904. * | insert the frame into the "misc" \
  905. * | tx queue \
  906. * | bit 4: 0x0 - Copy-Engine Classification Results \
  907. * | not appended to the HTT message \
  908. * | 0x1 - Copy-Engine Classification Results \
  909. * | appended to the HTT message. \
  910. * | See the above specification of the \
  911. * | CE classification results location. \
  912. */ \
  913. pkt_subtype: 5, \
  914. \
  915. /* pkt_type - \
  916. * General specification of the tx frame contents. \
  917. * The htt_pkt_type enum should be used to specify and check the \
  918. * value of this field. \
  919. */ \
  920. pkt_type: 3, \
  921. \
  922. /* vdev_id - \
  923. * ID for the vdev that is sending this tx frame. \
  924. * For certain non-standard packet types, e.g. pkt_type == raw \
  925. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  926. * This field is used primarily for determining where to queue \
  927. * broadcast and multicast frames. \
  928. */ \
  929. vdev_id: 6, \
  930. /* ext_tid - \
  931. * The extended traffic ID. \
  932. * If the TID is unknown, the extended TID is set to \
  933. * HTT_TX_EXT_TID_INVALID. \
  934. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  935. * value of the QoS TID. \
  936. * If the tx frame is non-QoS data, then the extended TID is set to \
  937. * HTT_TX_EXT_TID_NON_QOS. \
  938. * If the tx frame is multicast or broadcast, then the extended TID \
  939. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  940. */ \
  941. ext_tid: 5, \
  942. \
  943. /* postponed - \
  944. * This flag indicates whether the tx frame has been downloaded to \
  945. * the target before but discarded by the target, and now is being \
  946. * downloaded again; or if this is a new frame that is being \
  947. * downloaded for the first time. \
  948. * This flag allows the target to determine the correct order for \
  949. * transmitting new vs. old frames. \
  950. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  951. * This flag only applies to HL systems, since in LL systems, \
  952. * the tx flow control is handled entirely within the target. \
  953. */ \
  954. postponed: 1, \
  955. \
  956. /* extension - \
  957. * This flag indicates whether a HTT tx MSDU extension descriptor \
  958. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  959. * \
  960. * 0x0 - no extension MSDU descriptor is present \
  961. * 0x1 - an extension MSDU descriptor immediately follows the \
  962. * regular MSDU descriptor \
  963. */ \
  964. extension: 1, \
  965. \
  966. /* cksum_offload - \
  967. * This flag indicates whether checksum offload is enabled or not \
  968. * for this frame. Target FW use this flag to turn on HW checksumming \
  969. * 0x0 - No checksum offload \
  970. * 0x1 - L3 header checksum only \
  971. * 0x2 - L4 checksum only \
  972. * 0x3 - L3 header checksum + L4 checksum \
  973. */ \
  974. cksum_offload: 2, \
  975. \
  976. /* tx_comp_req - \
  977. * This flag indicates whether Tx Completion \
  978. * from fw is required or not. \
  979. * This flag is only relevant if tx completion is not \
  980. * universally enabled. \
  981. * For all LL systems, tx completion is mandatory, \
  982. * so this flag will be irrelevant. \
  983. * For HL systems tx completion is optional, but HL systems in which \
  984. * the bus throughput exceeds the WLAN throughput will \
  985. * probably want to always use tx completion, and thus \
  986. * would not check this flag. \
  987. * This flag is required when tx completions are not used universally, \
  988. * but are still required for certain tx frames for which \
  989. * an OTA delivery acknowledgment is needed by the host. \
  990. * In practice, this would be for HL systems in which the \
  991. * bus throughput is less than the WLAN throughput. \
  992. * \
  993. * 0x0 - Tx Completion Indication from Fw not required \
  994. * 0x1 - Tx Completion Indication from Fw is required \
  995. */ \
  996. tx_compl_req: 1; \
  997. \
  998. \
  999. /* DWORD 1: MSDU length and ID */ \
  1000. A_UINT32 \
  1001. len: 16, /* MSDU length, in bytes */ \
  1002. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1003. * and this id is used to calculate fragmentation \
  1004. * descriptor pointer inside the target based on \
  1005. * the base address, configured inside the target. \
  1006. */ \
  1007. \
  1008. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1009. /* frags_desc_ptr - \
  1010. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1011. * where the tx frame's fragments reside in memory. \
  1012. * This field only applies to LL systems, since in HL systems the \
  1013. * (degenerate single-fragment) fragmentation descriptor is created \
  1014. * within the target. \
  1015. */ \
  1016. _paddr__frags_desc_ptr_; \
  1017. \
  1018. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1019. /* \
  1020. * Peer ID : Target can use this value to know which peer-id packet \
  1021. * destined to. \
  1022. * It's intended to be specified by host in case of NAWDS. \
  1023. */ \
  1024. A_UINT16 peerid; \
  1025. \
  1026. /* \
  1027. * Channel frequency: This identifies the desired channel \
  1028. * frequency (in mhz) for tx frames. This is used by FW to help \
  1029. * determine when it is safe to transmit or drop frames for \
  1030. * off-channel operation. \
  1031. * The default value of zero indicates to FW that the corresponding \
  1032. * VDEV's home channel (if there is one) is the desired channel \
  1033. * frequency. \
  1034. */ \
  1035. A_UINT16 chanfreq; \
  1036. \
  1037. /* Reason reserved is commented is increasing the htt structure size \
  1038. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  1039. * A_UINT32 reserved_dword3_bits0_31; \
  1040. */ \
  1041. } POSTPACK
  1042. /* define a htt_tx_msdu_desc32_t type */
  1043. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1044. /* define a htt_tx_msdu_desc64_t type */
  1045. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1046. /*
  1047. * Make htt_tx_msdu_desc_t be an alias for either
  1048. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1049. */
  1050. #if HTT_PADDR64
  1051. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1052. #else
  1053. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1054. #endif
  1055. /* decriptor information for Management frame*/
  1056. /*
  1057. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1058. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1059. */
  1060. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1061. extern A_UINT32 mgmt_hdr_len;
  1062. PREPACK struct htt_mgmt_tx_desc_t {
  1063. A_UINT32 msg_type;
  1064. #if HTT_PADDR64
  1065. A_UINT64 frag_paddr; /* DMAble address of the data */
  1066. #else
  1067. A_UINT32 frag_paddr; /* DMAble address of the data */
  1068. #endif
  1069. A_UINT32 desc_id; /* returned to host during completion
  1070. * to free the meory*/
  1071. A_UINT32 len; /* Fragment length */
  1072. A_UINT32 vdev_id; /* virtual device ID*/
  1073. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1074. } POSTPACK;
  1075. PREPACK struct htt_mgmt_tx_compl_ind {
  1076. A_UINT32 desc_id;
  1077. A_UINT32 status;
  1078. } POSTPACK;
  1079. /*
  1080. * This SDU header size comes from the summation of the following:
  1081. * 1. Max of:
  1082. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1083. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1084. * b. 802.11 header, for raw frames: 36 bytes
  1085. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1086. * QoS header, HT header)
  1087. * c. 802.3 header, for ethernet frames: 14 bytes
  1088. * (destination address, source address, ethertype / length)
  1089. * 2. Max of:
  1090. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1091. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1092. * 3. 802.1Q VLAN header: 4 bytes
  1093. * 4. LLC/SNAP header: 8 bytes
  1094. */
  1095. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1096. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1097. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1098. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1099. A_COMPILE_TIME_ASSERT(
  1100. htt_encap_hdr_size_max_check_nwifi,
  1101. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1102. A_COMPILE_TIME_ASSERT(
  1103. htt_encap_hdr_size_max_check_enet,
  1104. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1105. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1106. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1107. #define HTT_TX_HDR_SIZE_802_1Q 4
  1108. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1109. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1110. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1111. HTT_TX_HDR_SIZE_802_1Q + \
  1112. HTT_TX_HDR_SIZE_LLC_SNAP)
  1113. #define HTT_HL_TX_FRM_HDR_LEN \
  1114. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1115. #define HTT_LL_TX_FRM_HDR_LEN \
  1116. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1117. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1118. /* dword 0 */
  1119. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1120. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1121. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1122. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1123. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1124. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1125. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1126. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1127. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1128. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1129. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1130. #define HTT_TX_DESC_PKT_TYPE_S 13
  1131. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1132. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1133. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1134. #define HTT_TX_DESC_VDEV_ID_S 16
  1135. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1136. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1137. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1138. #define HTT_TX_DESC_EXT_TID_S 22
  1139. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1140. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1141. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1142. #define HTT_TX_DESC_POSTPONED_S 27
  1143. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1144. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1145. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1146. #define HTT_TX_DESC_EXTENSION_S 28
  1147. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1148. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1149. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1150. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1151. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1152. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1153. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1154. #define HTT_TX_DESC_TX_COMP_S 31
  1155. /* dword 1 */
  1156. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1157. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1158. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1159. #define HTT_TX_DESC_FRM_LEN_S 0
  1160. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1161. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1162. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1163. #define HTT_TX_DESC_FRM_ID_S 16
  1164. /* dword 2 */
  1165. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1166. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1167. /* for systems using 64-bit format for bus addresses */
  1168. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1169. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1170. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1171. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1172. /* for systems using 32-bit format for bus addresses */
  1173. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1174. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1175. /* dword 3 */
  1176. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1177. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1178. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1179. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1180. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1181. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1182. #if HTT_PADDR64
  1183. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1184. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1185. #else
  1186. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1187. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1188. #endif
  1189. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1190. #define HTT_TX_DESC_PEER_ID_S 0
  1191. /*
  1192. * TEMPORARY:
  1193. * The original definitions for the PEER_ID fields contained typos
  1194. * (with _DESC_PADDR appended to this PEER_ID field name).
  1195. * Retain deprecated original names for PEER_ID fields until all code that
  1196. * refers to them has been updated.
  1197. */
  1198. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1199. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1200. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1201. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1202. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1203. HTT_TX_DESC_PEER_ID_M
  1204. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1205. HTT_TX_DESC_PEER_ID_S
  1206. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1207. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1208. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1209. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1210. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1211. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1212. #if HTT_PADDR64
  1213. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1214. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1215. #else
  1216. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1217. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1218. #endif
  1219. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1220. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1221. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1222. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1223. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1224. do { \
  1225. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1226. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1227. } while (0)
  1228. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1229. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1230. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1231. do { \
  1232. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1233. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1234. } while (0)
  1235. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1236. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1237. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1238. do { \
  1239. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1240. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1241. } while (0)
  1242. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1243. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1244. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1245. do { \
  1246. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1247. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1248. } while (0)
  1249. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1250. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1251. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1252. do { \
  1253. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1254. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1255. } while (0)
  1256. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1257. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1258. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1259. do { \
  1260. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1261. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1262. } while (0)
  1263. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1264. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1265. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1266. do { \
  1267. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1268. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1269. } while (0)
  1270. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1271. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1272. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1273. do { \
  1274. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1275. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1276. } while (0)
  1277. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1278. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1279. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1280. do { \
  1281. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1282. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1283. } while (0)
  1284. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1285. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1286. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1287. do { \
  1288. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1289. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1290. } while (0)
  1291. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1292. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1293. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1294. do { \
  1295. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1296. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1297. } while (0)
  1298. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1299. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1300. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1301. do { \
  1302. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1303. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1304. } while (0)
  1305. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1306. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1307. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1308. do { \
  1309. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1310. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1311. } while (0)
  1312. /* enums used in the HTT tx MSDU extension descriptor */
  1313. enum {
  1314. htt_tx_guard_interval_regular = 0,
  1315. htt_tx_guard_interval_short = 1,
  1316. };
  1317. enum {
  1318. htt_tx_preamble_type_ofdm = 0,
  1319. htt_tx_preamble_type_cck = 1,
  1320. htt_tx_preamble_type_ht = 2,
  1321. htt_tx_preamble_type_vht = 3,
  1322. };
  1323. enum {
  1324. htt_tx_bandwidth_5MHz = 0,
  1325. htt_tx_bandwidth_10MHz = 1,
  1326. htt_tx_bandwidth_20MHz = 2,
  1327. htt_tx_bandwidth_40MHz = 3,
  1328. htt_tx_bandwidth_80MHz = 4,
  1329. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1330. };
  1331. /**
  1332. * @brief HTT tx MSDU extension descriptor
  1333. * @details
  1334. * If the target supports HTT tx MSDU extension descriptors, the host has
  1335. * the option of appending the following struct following the regular
  1336. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1337. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1338. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1339. * tx specs for each frame.
  1340. */
  1341. PREPACK struct htt_tx_msdu_desc_ext_t {
  1342. /* DWORD 0: flags */
  1343. A_UINT32
  1344. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1345. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1346. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1347. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1348. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1349. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1350. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1351. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1352. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1353. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1354. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1355. /* DWORD 1: tx power, tx rate, tx BW */
  1356. A_UINT32
  1357. /* pwr -
  1358. * Specify what power the tx frame needs to be transmitted at.
  1359. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1360. * The value needs to be appropriately sign-extended when extracting
  1361. * the value from the message and storing it in a variable that is
  1362. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1363. * automatically handles this sign-extension.)
  1364. * If the transmission uses multiple tx chains, this power spec is
  1365. * the total transmit power, assuming incoherent combination of
  1366. * per-chain power to produce the total power.
  1367. */
  1368. pwr: 8,
  1369. /* mcs_mask -
  1370. * Specify the allowable values for MCS index (modulation and coding)
  1371. * to use for transmitting the frame.
  1372. *
  1373. * For HT / VHT preamble types, this mask directly corresponds to
  1374. * the HT or VHT MCS indices that are allowed. For each bit N set
  1375. * within the mask, MCS index N is allowed for transmitting the frame.
  1376. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1377. * rates versus OFDM rates, so the host has the option of specifying
  1378. * that the target must transmit the frame with CCK or OFDM rates
  1379. * (not HT or VHT), but leaving the decision to the target whether
  1380. * to use CCK or OFDM.
  1381. *
  1382. * For CCK and OFDM, the bits within this mask are interpreted as
  1383. * follows:
  1384. * bit 0 -> CCK 1 Mbps rate is allowed
  1385. * bit 1 -> CCK 2 Mbps rate is allowed
  1386. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1387. * bit 3 -> CCK 11 Mbps rate is allowed
  1388. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1389. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1390. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1391. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1392. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1393. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1394. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1395. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1396. *
  1397. * The MCS index specification needs to be compatible with the
  1398. * bandwidth mask specification. For example, a MCS index == 9
  1399. * specification is inconsistent with a preamble type == VHT,
  1400. * Nss == 1, and channel bandwidth == 20 MHz.
  1401. *
  1402. * Furthermore, the host has only a limited ability to specify to
  1403. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1404. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1405. */
  1406. mcs_mask: 12,
  1407. /* nss_mask -
  1408. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1409. * Each bit in this mask corresponds to a Nss value:
  1410. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1411. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1412. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1413. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1414. * The values in the Nss mask must be suitable for the recipient, e.g.
  1415. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1416. * recipient which only supports 2x2 MIMO.
  1417. */
  1418. nss_mask: 4,
  1419. /* guard_interval -
  1420. * Specify a htt_tx_guard_interval enum value to indicate whether
  1421. * the transmission should use a regular guard interval or a
  1422. * short guard interval.
  1423. */
  1424. guard_interval: 1,
  1425. /* preamble_type_mask -
  1426. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1427. * may choose from for transmitting this frame.
  1428. * The bits in this mask correspond to the values in the
  1429. * htt_tx_preamble_type enum. For example, to allow the target
  1430. * to transmit the frame as either CCK or OFDM, this field would
  1431. * be set to
  1432. * (1 << htt_tx_preamble_type_ofdm) |
  1433. * (1 << htt_tx_preamble_type_cck)
  1434. */
  1435. preamble_type_mask: 4,
  1436. reserved1_31_29: 3; /* unused, set to 0x0 */
  1437. /* DWORD 2: tx chain mask, tx retries */
  1438. A_UINT32
  1439. /* chain_mask - specify which chains to transmit from */
  1440. chain_mask: 4,
  1441. /* retry_limit -
  1442. * Specify the maximum number of transmissions, including the
  1443. * initial transmission, to attempt before giving up if no ack
  1444. * is received.
  1445. * If the tx rate is specified, then all retries shall use the
  1446. * same rate as the initial transmission.
  1447. * If no tx rate is specified, the target can choose whether to
  1448. * retain the original rate during the retransmissions, or to
  1449. * fall back to a more robust rate.
  1450. */
  1451. retry_limit: 4,
  1452. /* bandwidth_mask -
  1453. * Specify what channel widths may be used for the transmission.
  1454. * A value of zero indicates "don't care" - the target may choose
  1455. * the transmission bandwidth.
  1456. * The bits within this mask correspond to the htt_tx_bandwidth
  1457. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1458. * The bandwidth_mask must be consistent with the preamble_type_mask
  1459. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1460. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1461. */
  1462. bandwidth_mask: 6,
  1463. reserved2_31_14: 18; /* unused, set to 0x0 */
  1464. /* DWORD 3: tx expiry time (TSF) LSBs */
  1465. A_UINT32 expire_tsf_lo;
  1466. /* DWORD 4: tx expiry time (TSF) MSBs */
  1467. A_UINT32 expire_tsf_hi;
  1468. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1469. } POSTPACK;
  1470. /* DWORD 0 */
  1471. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1472. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1473. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1474. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1475. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1476. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1477. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1478. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1479. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1480. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1481. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1482. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1483. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1484. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1485. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1486. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1487. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1488. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1489. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1490. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1491. /* DWORD 1 */
  1492. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1493. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1494. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1495. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1496. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1497. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1498. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1499. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1500. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1501. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1502. /* DWORD 2 */
  1503. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1504. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1505. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1506. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1507. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1508. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1509. /* DWORD 0 */
  1510. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1511. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1512. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1513. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1514. do { \
  1515. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1516. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1517. } while (0)
  1518. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1519. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1520. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1521. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1522. do { \
  1523. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1524. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1525. } while (0)
  1526. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1527. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1528. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1529. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1530. do { \
  1531. HTT_CHECK_SET_VAL( \
  1532. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1533. ((_var) |= ((_val) \
  1534. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1535. } while (0)
  1536. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1537. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1538. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1539. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1540. do { \
  1541. HTT_CHECK_SET_VAL( \
  1542. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1543. ((_var) |= ((_val) \
  1544. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1545. } while (0)
  1546. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1547. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1548. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1549. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1550. do { \
  1551. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1552. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1553. } while (0)
  1554. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1555. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1556. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1557. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1558. do { \
  1559. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1560. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1561. } while (0)
  1562. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1563. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1564. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1565. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1566. do { \
  1567. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1568. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1569. } while (0)
  1570. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1571. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1572. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1573. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1574. do { \
  1575. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1576. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1577. } while (0)
  1578. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1579. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1580. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1581. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1582. do { \
  1583. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1584. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1585. } while (0)
  1586. /* DWORD 1 */
  1587. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1588. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1589. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1590. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1591. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1592. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1593. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1594. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1595. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1596. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1597. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1598. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1599. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1600. do { \
  1601. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1602. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1603. } while (0)
  1604. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1605. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1606. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1607. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1608. do { \
  1609. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1610. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1611. } while (0)
  1612. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1613. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1614. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1615. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1616. do { \
  1617. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1618. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1619. } while (0)
  1620. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1621. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1622. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1623. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1624. do { \
  1625. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1626. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1627. } while (0)
  1628. /* DWORD 2 */
  1629. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1630. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1631. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1632. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1633. do { \
  1634. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1635. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1636. } while (0)
  1637. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1638. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1639. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1640. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1641. do { \
  1642. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1643. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1644. } while (0)
  1645. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1646. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1647. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1648. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1649. do { \
  1650. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1651. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1652. } while (0)
  1653. typedef enum {
  1654. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1655. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1656. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1657. } htt_11ax_ltf_subtype_t;
  1658. typedef enum {
  1659. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1660. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1661. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1662. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1663. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1664. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1665. } htt_tx_ext2_preamble_type_t;
  1666. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1667. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1668. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1669. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1670. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1671. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1672. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1673. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1674. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1675. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1676. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1677. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1678. /**
  1679. * @brief HTT tx MSDU extension descriptor v2
  1680. * @details
  1681. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1682. * is received as tcl_exit_base->host_meta_info in firmware.
  1683. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1684. * are already part of tcl_exit_base.
  1685. */
  1686. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1687. /* DWORD 0: flags */
  1688. A_UINT32
  1689. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1690. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1691. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1692. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1693. valid_retries : 1, /* if set, tx retries spec is valid */
  1694. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1695. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1696. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1697. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1698. valid_key_flags : 1, /* if set, key flags is valid */
  1699. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1700. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1701. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1702. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1703. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1704. 1 = ENCRYPT,
  1705. 2 ~ 3 - Reserved */
  1706. /* retry_limit -
  1707. * Specify the maximum number of transmissions, including the
  1708. * initial transmission, to attempt before giving up if no ack
  1709. * is received.
  1710. * If the tx rate is specified, then all retries shall use the
  1711. * same rate as the initial transmission.
  1712. * If no tx rate is specified, the target can choose whether to
  1713. * retain the original rate during the retransmissions, or to
  1714. * fall back to a more robust rate.
  1715. */
  1716. retry_limit : 4,
  1717. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1718. * Valid only for 11ax preamble types HE_SU
  1719. * and HE_EXT_SU
  1720. */
  1721. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1722. * Valid only for 11ax preamble types HE_SU
  1723. * and HE_EXT_SU
  1724. */
  1725. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1726. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1727. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1728. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1729. */
  1730. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1731. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1732. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1733. * Use cases:
  1734. * Any time firmware uses TQM-BYPASS for Data
  1735. * TID, firmware expect host to set this bit.
  1736. */
  1737. /* DWORD 1: tx power, tx rate */
  1738. A_UINT32
  1739. power : 8, /* unit of the power field is 0.5 dbm
  1740. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1741. * signed value ranging from -64dbm to 63.5 dbm
  1742. */
  1743. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1744. * Setting more than one MCS isn't currently
  1745. * supported by the target (but is supported
  1746. * in the interface in case in the future
  1747. * the target supports specifications of
  1748. * a limited set of MCS values.
  1749. */
  1750. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1751. * Setting more than one Nss isn't currently
  1752. * supported by the target (but is supported
  1753. * in the interface in case in the future
  1754. * the target supports specifications of
  1755. * a limited set of Nss values.
  1756. */
  1757. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1758. update_peer_cache : 1; /* When set these custom values will be
  1759. * used for all packets, until the next
  1760. * update via this ext header.
  1761. * This is to make sure not all packets
  1762. * need to include this header.
  1763. */
  1764. /* DWORD 2: tx chain mask, tx retries */
  1765. A_UINT32
  1766. /* chain_mask - specify which chains to transmit from */
  1767. chain_mask : 8,
  1768. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1769. * TODO: Update Enum values for key_flags
  1770. */
  1771. /*
  1772. * Channel frequency: This identifies the desired channel
  1773. * frequency (in MHz) for tx frames. This is used by FW to help
  1774. * determine when it is safe to transmit or drop frames for
  1775. * off-channel operation.
  1776. * The default value of zero indicates to FW that the corresponding
  1777. * VDEV's home channel (if there is one) is the desired channel
  1778. * frequency.
  1779. */
  1780. chanfreq : 16;
  1781. /* DWORD 3: tx expiry time (TSF) LSBs */
  1782. A_UINT32 expire_tsf_lo;
  1783. /* DWORD 4: tx expiry time (TSF) MSBs */
  1784. A_UINT32 expire_tsf_hi;
  1785. /* DWORD 5: flags to control routing / processing of the MSDU */
  1786. A_UINT32
  1787. /* learning_frame
  1788. * When this flag is set, this frame will be dropped by FW
  1789. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1790. */
  1791. learning_frame : 1,
  1792. /* send_as_standalone
  1793. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1794. * i.e. with no A-MSDU or A-MPDU aggregation.
  1795. * The scope is extended to other use-cases.
  1796. */
  1797. send_as_standalone : 1,
  1798. /* is_host_opaque_valid
  1799. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1800. * with valid information.
  1801. */
  1802. is_host_opaque_valid : 1,
  1803. rsvd0 : 29;
  1804. /* DWORD 6 : Host opaque cookie for special frames */
  1805. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1806. rsvd1 : 16;
  1807. /*
  1808. * This structure can be expanded further up to 40 bytes
  1809. * by adding further DWORDs as needed.
  1810. */
  1811. } POSTPACK;
  1812. /* DWORD 0 */
  1813. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1814. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1815. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1816. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1817. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1818. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1819. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1820. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1821. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1822. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1823. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1824. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1825. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1826. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1827. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1828. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1829. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1830. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1831. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1832. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1833. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1834. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1835. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1836. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1837. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1838. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1839. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1840. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1841. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1842. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1843. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1844. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1845. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1846. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1847. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1848. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1849. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1850. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1851. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1852. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1853. /* DWORD 1 */
  1854. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1855. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1856. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1857. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1858. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1859. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1860. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1861. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1862. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1863. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1864. /* DWORD 2 */
  1865. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1866. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1867. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1868. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1869. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1870. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1871. /* DWORD 5 */
  1872. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1878. /* DWORD 6 */
  1879. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1880. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1881. /* DWORD 0 */
  1882. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1883. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1884. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1885. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1886. do { \
  1887. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1888. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1889. } while (0)
  1890. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1891. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1892. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1893. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1894. do { \
  1895. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1896. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1897. } while (0)
  1898. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1899. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1900. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1901. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1902. do { \
  1903. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1904. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1905. } while (0)
  1906. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1907. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1908. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1909. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1910. do { \
  1911. HTT_CHECK_SET_VAL( \
  1912. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1913. ((_var) |= ((_val) \
  1914. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1915. } while (0)
  1916. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1917. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1918. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1919. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1920. do { \
  1921. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1922. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1923. } while (0)
  1924. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1925. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1926. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1927. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1928. do { \
  1929. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1930. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1931. } while (0)
  1932. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1933. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1934. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1935. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1936. do { \
  1937. HTT_CHECK_SET_VAL( \
  1938. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1939. ((_var) |= ((_val) \
  1940. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1941. } while (0)
  1942. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1943. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1944. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1945. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1946. do { \
  1947. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1948. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1949. } while (0)
  1950. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1951. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1952. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1953. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1954. do { \
  1955. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1956. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1957. } while (0)
  1958. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1959. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1960. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1961. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1962. do { \
  1963. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1964. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1965. } while (0)
  1966. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1967. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1968. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1969. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1970. do { \
  1971. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1972. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1973. } while (0)
  1974. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1975. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1976. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1977. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1978. do { \
  1979. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1980. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1981. } while (0)
  1982. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1983. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1984. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1985. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1986. do { \
  1987. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1988. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1989. } while (0)
  1990. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1991. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1992. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1993. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1994. do { \
  1995. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1996. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1997. } while (0)
  1998. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1999. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2000. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2001. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2002. do { \
  2003. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2004. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2005. } while (0)
  2006. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2007. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2008. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2009. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2010. do { \
  2011. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2012. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2013. } while (0)
  2014. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2015. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2016. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2017. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2018. do { \
  2019. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2020. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2021. } while (0)
  2022. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2023. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2024. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2025. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2026. do { \
  2027. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2028. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2029. } while (0)
  2030. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2031. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2032. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2033. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2034. do { \
  2035. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2036. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2037. } while (0)
  2038. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2039. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2040. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2041. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2042. do { \
  2043. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2044. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2045. } while (0)
  2046. /* DWORD 1 */
  2047. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2048. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2049. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2050. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2051. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2052. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2053. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2054. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2055. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2056. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2057. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2058. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2059. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2060. do { \
  2061. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2062. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2063. } while (0)
  2064. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2065. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2066. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2067. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2068. do { \
  2069. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2070. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2071. } while (0)
  2072. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2073. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2074. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2075. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2076. do { \
  2077. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2078. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2079. } while (0)
  2080. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2081. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2082. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2083. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2084. do { \
  2085. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2086. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2087. } while (0)
  2088. /* DWORD 2 */
  2089. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2090. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2091. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2092. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2093. do { \
  2094. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2095. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2096. } while (0)
  2097. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2098. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2099. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2100. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2101. do { \
  2102. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2103. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2104. } while (0)
  2105. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2106. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2107. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2108. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2109. do { \
  2110. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2111. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2112. } while (0)
  2113. /* DWORD 5 */
  2114. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2115. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2116. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2117. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2118. do { \
  2119. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2120. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2121. } while (0)
  2122. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2123. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2124. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2125. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2126. do { \
  2127. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2128. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2129. } while (0)
  2130. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2131. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2132. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2133. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2134. do { \
  2135. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2136. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2137. } while (0)
  2138. /* DWORD 6 */
  2139. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2140. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2141. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2142. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2143. do { \
  2144. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2145. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2146. } while (0)
  2147. typedef enum {
  2148. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2149. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2150. } htt_tcl_metadata_type;
  2151. /**
  2152. * @brief HTT TCL command number format
  2153. * @details
  2154. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2155. * available to firmware as tcl_exit_base->tcl_status_number.
  2156. * For regular / multicast packets host will send vdev and mac id and for
  2157. * NAWDS packets, host will send peer id.
  2158. * A_UINT32 is used to avoid endianness conversion problems.
  2159. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2160. */
  2161. typedef struct {
  2162. A_UINT32
  2163. type: 1, /* vdev_id based or peer_id based */
  2164. rsvd: 31;
  2165. } htt_tx_tcl_vdev_or_peer_t;
  2166. typedef struct {
  2167. A_UINT32
  2168. type: 1, /* vdev_id based or peer_id based */
  2169. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2170. vdev_id: 8,
  2171. pdev_id: 2,
  2172. host_inspected:1,
  2173. rsvd: 19;
  2174. } htt_tx_tcl_vdev_metadata;
  2175. typedef struct {
  2176. A_UINT32
  2177. type: 1, /* vdev_id based or peer_id based */
  2178. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2179. peer_id: 14,
  2180. rsvd: 16;
  2181. } htt_tx_tcl_peer_metadata;
  2182. PREPACK struct htt_tx_tcl_metadata {
  2183. union {
  2184. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2185. htt_tx_tcl_vdev_metadata vdev_meta;
  2186. htt_tx_tcl_peer_metadata peer_meta;
  2187. };
  2188. } POSTPACK;
  2189. /* DWORD 0 */
  2190. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2191. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2192. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2193. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2194. /* VDEV metadata */
  2195. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2196. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2197. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2198. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2199. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2200. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2201. /* PEER metadata */
  2202. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2203. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2204. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2205. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2206. HTT_TX_TCL_METADATA_TYPE_S)
  2207. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2208. do { \
  2209. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2210. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2211. } while (0)
  2212. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2213. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2214. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2215. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2216. do { \
  2217. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2218. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2219. } while (0)
  2220. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2221. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2222. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2223. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2224. do { \
  2225. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2226. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2227. } while (0)
  2228. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2229. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2230. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2231. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2232. do { \
  2233. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2234. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2235. } while (0)
  2236. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2237. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2238. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2239. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2240. do { \
  2241. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2242. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2243. } while (0)
  2244. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2245. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2246. HTT_TX_TCL_METADATA_PEER_ID_S)
  2247. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2248. do { \
  2249. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2250. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2251. } while (0)
  2252. /*------------------------------------------------------------------
  2253. * V2 Version of TCL Data Command
  2254. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2255. * MLO global_seq all flavours of TCL Data Cmd.
  2256. *-----------------------------------------------------------------*/
  2257. typedef enum {
  2258. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2259. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2260. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2261. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2262. } htt_tcl_metadata_type_v2;
  2263. /**
  2264. * @brief HTT TCL command number format
  2265. * @details
  2266. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2267. * available to firmware as tcl_exit_base->tcl_status_number.
  2268. * A_UINT32 is used to avoid endianness conversion problems.
  2269. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2270. */
  2271. typedef struct {
  2272. A_UINT32
  2273. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2274. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2275. vdev_id: 8,
  2276. pdev_id: 2,
  2277. host_inspected:1,
  2278. rsvd: 2,
  2279. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2280. } htt_tx_tcl_vdev_metadata_v2;
  2281. typedef struct {
  2282. A_UINT32
  2283. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2284. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2285. peer_id: 13,
  2286. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2287. } htt_tx_tcl_peer_metadata_v2;
  2288. typedef struct {
  2289. A_UINT32
  2290. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2291. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2292. svc_class_id: 8,
  2293. rsvd: 5,
  2294. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2295. } htt_tx_tcl_svc_class_id_metadata;
  2296. typedef struct {
  2297. A_UINT32
  2298. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2299. host_inspected: 1,
  2300. global_seq_no: 12,
  2301. rsvd: 1,
  2302. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2303. } htt_tx_tcl_global_seq_metadata;
  2304. PREPACK struct htt_tx_tcl_metadata_v2 {
  2305. union {
  2306. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2307. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2308. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2309. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2310. };
  2311. } POSTPACK;
  2312. /* DWORD 0 */
  2313. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2314. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2315. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2316. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2317. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2318. /* VDEV V2 metadata */
  2319. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2320. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2321. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2322. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2323. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2324. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2325. /* PEER V2 metadata */
  2326. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2327. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2328. /* SVC_CLASS_ID metadata */
  2329. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2330. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2331. /* Global Seq no metadata */
  2332. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2333. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2334. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2335. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2336. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2337. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2338. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2339. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2340. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2341. do { \
  2342. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2343. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2344. } while (0)
  2345. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2346. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2347. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2348. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2349. do { \
  2350. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2351. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2352. } while (0)
  2353. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2354. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2355. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2356. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2357. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2358. do { \
  2359. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2360. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2361. } while (0)
  2362. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2363. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2364. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2365. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2366. do { \
  2367. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2368. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2369. } while (0)
  2370. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2371. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2372. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2373. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2374. do { \
  2375. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2376. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2377. } while (0)
  2378. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2379. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2380. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2381. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2382. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2383. do { \
  2384. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2385. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2386. } while (0)
  2387. /*----- Get and Set V2 type field in Service Class fields ----*/
  2388. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2389. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2390. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2391. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2392. do { \
  2393. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2394. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2395. } while (0)
  2396. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2397. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2398. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2399. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2400. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2401. do { \
  2402. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2403. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2404. } while (0)
  2405. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2406. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2407. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2408. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2409. do { \
  2410. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2411. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2412. } while (0)
  2413. /*------------------------------------------------------------------
  2414. * End V2 Version of TCL Data Command
  2415. *-----------------------------------------------------------------*/
  2416. typedef enum {
  2417. HTT_TX_FW2WBM_TX_STATUS_OK,
  2418. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2419. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2420. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2421. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2422. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2423. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2424. HTT_TX_FW2WBM_TX_STATUS_MAX
  2425. } htt_tx_fw2wbm_tx_status_t;
  2426. typedef enum {
  2427. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2428. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2429. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2430. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2431. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2432. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2433. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2434. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2435. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2436. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2437. } htt_tx_fw2wbm_reinject_reason_t;
  2438. /**
  2439. * @brief HTT TX WBM Completion from firmware to host
  2440. * @details
  2441. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2442. * DWORD 3 and 4 for software based completions (Exception frames and
  2443. * TQM bypass frames)
  2444. * For software based completions, wbm_release_ring->release_source_module will
  2445. * be set to release_source_fw
  2446. */
  2447. PREPACK struct htt_tx_wbm_completion {
  2448. A_UINT32
  2449. sch_cmd_id: 24,
  2450. exception_frame: 1, /* If set, this packet was queued via exception path */
  2451. rsvd0_31_25: 7;
  2452. A_UINT32
  2453. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2454. * reception of an ACK or BA, this field indicates
  2455. * the RSSI of the received ACK or BA frame.
  2456. * When the frame is removed as result of a direct
  2457. * remove command from the SW, this field is set
  2458. * to 0x0 (which is never a valid value when real
  2459. * RSSI is available).
  2460. * Units: dB w.r.t noise floor
  2461. */
  2462. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2463. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2464. rsvd1_31_16: 16;
  2465. } POSTPACK;
  2466. /* DWORD 0 */
  2467. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2468. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2469. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2470. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2471. /* DWORD 1 */
  2472. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2473. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2474. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2475. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2476. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2477. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2478. /* DWORD 0 */
  2479. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2480. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2481. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2482. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2483. do { \
  2484. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2485. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2486. } while (0)
  2487. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2488. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2489. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2490. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2491. do { \
  2492. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2493. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2494. } while (0)
  2495. /* DWORD 1 */
  2496. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2497. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2498. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2499. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2500. do { \
  2501. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2502. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2503. } while (0)
  2504. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2505. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2506. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2507. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2508. do { \
  2509. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2510. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2511. } while (0)
  2512. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2513. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2514. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2515. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2516. do { \
  2517. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2518. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2519. } while (0)
  2520. /**
  2521. * @brief HTT TX WBM Completion from firmware to host
  2522. * @details
  2523. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2524. * (WBM) offload HW.
  2525. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2526. * For software based completions, release_source_module will
  2527. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2528. * struct wbm_release_ring and then switch to this after looking at
  2529. * release_source_module.
  2530. */
  2531. PREPACK struct htt_tx_wbm_completion_v2 {
  2532. A_UINT32
  2533. used_by_hw0; /* Refer to struct wbm_release_ring */
  2534. A_UINT32
  2535. used_by_hw1; /* Refer to struct wbm_release_ring */
  2536. A_UINT32
  2537. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2538. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2539. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2540. exception_frame: 1,
  2541. rsvd0: 12, /* For future use */
  2542. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2543. rsvd1: 1; /* For future use */
  2544. A_UINT32
  2545. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2546. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2547. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2548. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2549. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2550. */
  2551. A_UINT32
  2552. data1: 32;
  2553. A_UINT32
  2554. data2: 32;
  2555. A_UINT32
  2556. used_by_hw3; /* Refer to struct wbm_release_ring */
  2557. } POSTPACK;
  2558. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2559. /* DWORD 3 */
  2560. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2561. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2562. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2563. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2564. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2565. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2566. /* DWORD 3 */
  2567. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2568. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2569. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2570. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2571. do { \
  2572. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2573. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2574. } while (0)
  2575. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2576. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2577. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2578. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2579. do { \
  2580. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2581. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2582. } while (0)
  2583. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2584. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2585. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2586. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2587. do { \
  2588. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2589. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2590. } while (0)
  2591. /**
  2592. * @brief HTT TX WBM Completion from firmware to host (V3)
  2593. * @details
  2594. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2595. * (WBM) offload HW.
  2596. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2597. * For software based completions, release_source_module will
  2598. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2599. * struct wbm_release_ring and then switch to this after looking at
  2600. * release_source_module.
  2601. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2602. * by new generations of targets.
  2603. */
  2604. PREPACK struct htt_tx_wbm_completion_v3 {
  2605. A_UINT32
  2606. used_by_hw0; /* Refer to struct wbm_release_ring */
  2607. A_UINT32
  2608. used_by_hw1; /* Refer to struct wbm_release_ring */
  2609. A_UINT32
  2610. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2611. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2612. used_by_hw3: 15;
  2613. A_UINT32
  2614. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2615. exception_frame: 1,
  2616. rsvd0: 27; /* For future use */
  2617. A_UINT32
  2618. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2619. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2620. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2621. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2622. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2623. */
  2624. A_UINT32
  2625. data1: 32;
  2626. A_UINT32
  2627. data2: 32;
  2628. A_UINT32
  2629. rsvd1: 20,
  2630. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2631. } POSTPACK;
  2632. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2633. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2634. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2635. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2636. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2637. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2638. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2639. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2640. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2641. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2642. do { \
  2643. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2644. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2645. } while (0)
  2646. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2647. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2648. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2649. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2650. do { \
  2651. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2652. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2653. } while (0)
  2654. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2655. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2656. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2657. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2658. do { \
  2659. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2660. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2661. } while (0)
  2662. typedef enum {
  2663. TX_FRAME_TYPE_UNDEFINED = 0,
  2664. TX_FRAME_TYPE_EAPOL = 1,
  2665. } htt_tx_wbm_status_frame_type;
  2666. /**
  2667. * @brief HTT TX WBM transmit status from firmware to host
  2668. * @details
  2669. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2670. * (WBM) offload HW.
  2671. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2672. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2673. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2674. */
  2675. PREPACK struct htt_tx_wbm_transmit_status {
  2676. A_UINT32
  2677. sch_cmd_id: 24,
  2678. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2679. * reception of an ACK or BA, this field indicates
  2680. * the RSSI of the received ACK or BA frame.
  2681. * When the frame is removed as result of a direct
  2682. * remove command from the SW, this field is set
  2683. * to 0x0 (which is never a valid value when real
  2684. * RSSI is available).
  2685. * Units: dB w.r.t noise floor
  2686. */
  2687. A_UINT32
  2688. sw_peer_id: 16,
  2689. tid_num: 5,
  2690. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2691. * and tid_num fields contain valid data.
  2692. * If this "valid" flag is not set, the
  2693. * sw_peer_id and tid_num fields must be ignored.
  2694. */
  2695. mcast: 1,
  2696. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2697. * contains valid data.
  2698. */
  2699. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2700. reserved: 4;
  2701. A_UINT32
  2702. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2703. * packets in the wbm completion path
  2704. */
  2705. } POSTPACK;
  2706. /* DWORD 4 */
  2707. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2708. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2709. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2710. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2711. /* DWORD 5 */
  2712. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2713. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2714. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2715. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2716. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2717. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2718. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2719. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2720. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2721. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2722. /* DWORD 4 */
  2723. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2724. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2725. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2726. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2727. do { \
  2728. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2729. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2730. } while (0)
  2731. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2732. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2733. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2734. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2735. do { \
  2736. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2737. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2738. } while (0)
  2739. /* DWORD 5 */
  2740. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2741. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2742. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2743. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2744. do { \
  2745. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2746. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2747. } while (0)
  2748. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2749. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2750. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2751. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2752. do { \
  2753. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2754. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2755. } while (0)
  2756. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2757. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2758. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2759. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2760. do { \
  2761. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2762. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2763. } while (0)
  2764. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2765. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2766. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2767. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2768. do { \
  2769. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2770. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2771. } while (0)
  2772. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2773. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2774. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2775. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2776. do { \
  2777. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2778. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2779. } while (0)
  2780. /**
  2781. * @brief HTT TX WBM reinject status from firmware to host
  2782. * @details
  2783. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2784. * (WBM) offload HW.
  2785. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2786. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2787. */
  2788. PREPACK struct htt_tx_wbm_reinject_status {
  2789. A_UINT32
  2790. reserved0: 32;
  2791. A_UINT32
  2792. reserved1: 32;
  2793. A_UINT32
  2794. reserved2: 32;
  2795. } POSTPACK;
  2796. /**
  2797. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2798. * @details
  2799. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2800. * (WBM) offload HW.
  2801. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2802. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2803. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2804. * STA side.
  2805. */
  2806. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2807. A_UINT32
  2808. mec_sa_addr_31_0;
  2809. A_UINT32
  2810. mec_sa_addr_47_32: 16,
  2811. sa_ast_index: 16;
  2812. A_UINT32
  2813. vdev_id: 8,
  2814. reserved0: 24;
  2815. } POSTPACK;
  2816. /* DWORD 4 - mec_sa_addr_31_0 */
  2817. /* DWORD 5 */
  2818. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2819. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2820. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2821. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2822. /* DWORD 6 */
  2823. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2824. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2825. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2826. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2827. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2828. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2829. do { \
  2830. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2831. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2832. } while (0)
  2833. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2834. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2835. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2836. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2837. do { \
  2838. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2839. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2840. } while (0)
  2841. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2842. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2843. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2844. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2845. do { \
  2846. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2847. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2848. } while (0)
  2849. typedef enum {
  2850. TX_FLOW_PRIORITY_BE,
  2851. TX_FLOW_PRIORITY_HIGH,
  2852. TX_FLOW_PRIORITY_LOW,
  2853. } htt_tx_flow_priority_t;
  2854. typedef enum {
  2855. TX_FLOW_LATENCY_SENSITIVE,
  2856. TX_FLOW_LATENCY_INSENSITIVE,
  2857. } htt_tx_flow_latency_t;
  2858. typedef enum {
  2859. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2860. TX_FLOW_INTERACTIVE_TRAFFIC,
  2861. TX_FLOW_PERIODIC_TRAFFIC,
  2862. TX_FLOW_BURSTY_TRAFFIC,
  2863. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2864. } htt_tx_flow_traffic_pattern_t;
  2865. /**
  2866. * @brief HTT TX Flow search metadata format
  2867. * @details
  2868. * Host will set this metadata in flow table's flow search entry along with
  2869. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2870. * firmware and TQM ring if the flow search entry wins.
  2871. * This metadata is available to firmware in that first MSDU's
  2872. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2873. * to one of the available flows for specific tid and returns the tqm flow
  2874. * pointer as part of htt_tx_map_flow_info message.
  2875. */
  2876. PREPACK struct htt_tx_flow_metadata {
  2877. A_UINT32
  2878. rsvd0_1_0: 2,
  2879. tid: 4,
  2880. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2881. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2882. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2883. * Else choose final tid based on latency, priority.
  2884. */
  2885. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2886. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2887. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2888. } POSTPACK;
  2889. /* DWORD 0 */
  2890. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2891. #define HTT_TX_FLOW_METADATA_TID_S 2
  2892. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2893. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2894. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2895. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2896. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2897. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2898. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2899. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2900. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2901. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2902. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2903. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2904. /* DWORD 0 */
  2905. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2906. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2907. HTT_TX_FLOW_METADATA_TID_S)
  2908. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2909. do { \
  2910. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2911. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2912. } while (0)
  2913. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2914. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2915. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2916. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2917. do { \
  2918. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2919. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2920. } while (0)
  2921. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2922. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2923. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2924. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2925. do { \
  2926. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2927. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2928. } while (0)
  2929. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2930. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2931. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2932. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2933. do { \
  2934. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2935. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2936. } while (0)
  2937. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2938. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2939. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2940. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2941. do { \
  2942. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2943. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2944. } while (0)
  2945. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2946. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2947. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2948. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2949. do { \
  2950. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2951. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2952. } while (0)
  2953. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2954. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2955. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2956. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2957. do { \
  2958. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2959. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2960. } while (0)
  2961. /**
  2962. * @brief host -> target ADD WDS Entry
  2963. *
  2964. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2965. *
  2966. * @brief host -> target DELETE WDS Entry
  2967. *
  2968. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2969. *
  2970. * @details
  2971. * HTT wds entry from source port learning
  2972. * Host will learn wds entries from rx and send this message to firmware
  2973. * to enable firmware to configure/delete AST entries for wds clients.
  2974. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2975. * and when SA's entry is deleted, firmware removes this AST entry
  2976. *
  2977. * The message would appear as follows:
  2978. *
  2979. * |31 30|29 |17 16|15 8|7 0|
  2980. * |----------------+----------------+----------------+----------------|
  2981. * | rsvd0 |PDVID| vdev_id | msg_type |
  2982. * |-------------------------------------------------------------------|
  2983. * | sa_addr_31_0 |
  2984. * |-------------------------------------------------------------------|
  2985. * | | ta_peer_id | sa_addr_47_32 |
  2986. * |-------------------------------------------------------------------|
  2987. * Where PDVID = pdev_id
  2988. *
  2989. * The message is interpreted as follows:
  2990. *
  2991. * dword0 - b'0:7 - msg_type: This will be set to
  2992. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2993. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  2994. *
  2995. * dword0 - b'8:15 - vdev_id
  2996. *
  2997. * dword0 - b'16:17 - pdev_id
  2998. *
  2999. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3000. *
  3001. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3002. *
  3003. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3004. *
  3005. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3006. */
  3007. PREPACK struct htt_wds_entry {
  3008. A_UINT32
  3009. msg_type: 8,
  3010. vdev_id: 8,
  3011. pdev_id: 2,
  3012. rsvd0: 14;
  3013. A_UINT32 sa_addr_31_0;
  3014. A_UINT32
  3015. sa_addr_47_32: 16,
  3016. ta_peer_id: 14,
  3017. rsvd2: 2;
  3018. } POSTPACK;
  3019. /* DWORD 0 */
  3020. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3021. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3022. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3023. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3024. /* DWORD 2 */
  3025. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3026. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3027. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3028. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3029. /* DWORD 0 */
  3030. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3031. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3032. HTT_WDS_ENTRY_VDEV_ID_S)
  3033. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3034. do { \
  3035. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3036. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3037. } while (0)
  3038. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3039. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3040. HTT_WDS_ENTRY_PDEV_ID_S)
  3041. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3042. do { \
  3043. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3044. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3045. } while (0)
  3046. /* DWORD 2 */
  3047. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3048. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3049. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3050. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3051. do { \
  3052. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3053. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3054. } while (0)
  3055. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3056. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3057. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3058. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3059. do { \
  3060. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3061. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3062. } while (0)
  3063. /**
  3064. * @brief MAC DMA rx ring setup specification
  3065. *
  3066. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3067. *
  3068. * @details
  3069. * To allow for dynamic rx ring reconfiguration and to avoid race
  3070. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3071. * it uses. Instead, it sends this message to the target, indicating how
  3072. * the rx ring used by the host should be set up and maintained.
  3073. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3074. * specifications.
  3075. *
  3076. * |31 16|15 8|7 0|
  3077. * |---------------------------------------------------------------|
  3078. * header: | reserved | num rings | msg type |
  3079. * |---------------------------------------------------------------|
  3080. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3081. #if HTT_PADDR64
  3082. * | FW_IDX shadow register physical address (bits 63:32) |
  3083. #endif
  3084. * |---------------------------------------------------------------|
  3085. * | rx ring base physical address (bits 31:0) |
  3086. #if HTT_PADDR64
  3087. * | rx ring base physical address (bits 63:32) |
  3088. #endif
  3089. * |---------------------------------------------------------------|
  3090. * | rx ring buffer size | rx ring length |
  3091. * |---------------------------------------------------------------|
  3092. * | FW_IDX initial value | enabled flags |
  3093. * |---------------------------------------------------------------|
  3094. * | MSDU payload offset | 802.11 header offset |
  3095. * |---------------------------------------------------------------|
  3096. * | PPDU end offset | PPDU start offset |
  3097. * |---------------------------------------------------------------|
  3098. * | MPDU end offset | MPDU start offset |
  3099. * |---------------------------------------------------------------|
  3100. * | MSDU end offset | MSDU start offset |
  3101. * |---------------------------------------------------------------|
  3102. * | frag info offset | rx attention offset |
  3103. * |---------------------------------------------------------------|
  3104. * payload 2, if present, has the same format as payload 1
  3105. * Header fields:
  3106. * - MSG_TYPE
  3107. * Bits 7:0
  3108. * Purpose: identifies this as an rx ring configuration message
  3109. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3110. * - NUM_RINGS
  3111. * Bits 15:8
  3112. * Purpose: indicates whether the host is setting up one rx ring or two
  3113. * Value: 1 or 2
  3114. * Payload:
  3115. * for systems using 64-bit format for bus addresses:
  3116. * - IDX_SHADOW_REG_PADDR_LO
  3117. * Bits 31:0
  3118. * Value: lower 4 bytes of physical address of the host's
  3119. * FW_IDX shadow register
  3120. * - IDX_SHADOW_REG_PADDR_HI
  3121. * Bits 31:0
  3122. * Value: upper 4 bytes of physical address of the host's
  3123. * FW_IDX shadow register
  3124. * - RING_BASE_PADDR_LO
  3125. * Bits 31:0
  3126. * Value: lower 4 bytes of physical address of the host's rx ring
  3127. * - RING_BASE_PADDR_HI
  3128. * Bits 31:0
  3129. * Value: uppper 4 bytes of physical address of the host's rx ring
  3130. * for systems using 32-bit format for bus addresses:
  3131. * - IDX_SHADOW_REG_PADDR
  3132. * Bits 31:0
  3133. * Value: physical address of the host's FW_IDX shadow register
  3134. * - RING_BASE_PADDR
  3135. * Bits 31:0
  3136. * Value: physical address of the host's rx ring
  3137. * - RING_LEN
  3138. * Bits 15:0
  3139. * Value: number of elements in the rx ring
  3140. * - RING_BUF_SZ
  3141. * Bits 31:16
  3142. * Value: size of the buffers referenced by the rx ring, in byte units
  3143. * - ENABLED_FLAGS
  3144. * Bits 15:0
  3145. * Value: 1-bit flags to show whether different rx fields are enabled
  3146. * bit 0: 802.11 header enabled (1) or disabled (0)
  3147. * bit 1: MSDU payload enabled (1) or disabled (0)
  3148. * bit 2: PPDU start enabled (1) or disabled (0)
  3149. * bit 3: PPDU end enabled (1) or disabled (0)
  3150. * bit 4: MPDU start enabled (1) or disabled (0)
  3151. * bit 5: MPDU end enabled (1) or disabled (0)
  3152. * bit 6: MSDU start enabled (1) or disabled (0)
  3153. * bit 7: MSDU end enabled (1) or disabled (0)
  3154. * bit 8: rx attention enabled (1) or disabled (0)
  3155. * bit 9: frag info enabled (1) or disabled (0)
  3156. * bit 10: unicast rx enabled (1) or disabled (0)
  3157. * bit 11: multicast rx enabled (1) or disabled (0)
  3158. * bit 12: ctrl rx enabled (1) or disabled (0)
  3159. * bit 13: mgmt rx enabled (1) or disabled (0)
  3160. * bit 14: null rx enabled (1) or disabled (0)
  3161. * bit 15: phy data rx enabled (1) or disabled (0)
  3162. * - IDX_INIT_VAL
  3163. * Bits 31:16
  3164. * Purpose: Specify the initial value for the FW_IDX.
  3165. * Value: the number of buffers initially present in the host's rx ring
  3166. * - OFFSET_802_11_HDR
  3167. * Bits 15:0
  3168. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3169. * - OFFSET_MSDU_PAYLOAD
  3170. * Bits 31:16
  3171. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3172. * - OFFSET_PPDU_START
  3173. * Bits 15:0
  3174. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3175. * - OFFSET_PPDU_END
  3176. * Bits 31:16
  3177. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3178. * - OFFSET_MPDU_START
  3179. * Bits 15:0
  3180. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3181. * - OFFSET_MPDU_END
  3182. * Bits 31:16
  3183. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3184. * - OFFSET_MSDU_START
  3185. * Bits 15:0
  3186. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3187. * - OFFSET_MSDU_END
  3188. * Bits 31:16
  3189. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3190. * - OFFSET_RX_ATTN
  3191. * Bits 15:0
  3192. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3193. * - OFFSET_FRAG_INFO
  3194. * Bits 31:16
  3195. * Value: offset in QUAD-bytes of frag info table
  3196. */
  3197. /* header fields */
  3198. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3199. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3200. /* payload fields */
  3201. /* for systems using a 64-bit format for bus addresses */
  3202. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3203. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3204. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3205. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3206. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3207. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3208. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3209. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3210. /* for systems using a 32-bit format for bus addresses */
  3211. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3212. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3213. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3214. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3215. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3216. #define HTT_RX_RING_CFG_LEN_S 0
  3217. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3218. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3219. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3220. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3221. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3222. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3223. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3224. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3225. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3226. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3227. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3228. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3229. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3230. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3231. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3232. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3233. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3234. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3235. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3236. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3237. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3238. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3239. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3240. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3241. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3242. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3243. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3244. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3245. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3246. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3247. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3248. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3249. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3250. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3251. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3252. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3253. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3254. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3255. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3256. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3257. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3258. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3259. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3260. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3261. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3262. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3263. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3264. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3265. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3266. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3267. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3268. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3269. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3270. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3271. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3272. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3273. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3274. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3275. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3276. #if HTT_PADDR64
  3277. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3278. #else
  3279. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3280. #endif
  3281. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3282. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3283. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3284. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3285. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3286. do { \
  3287. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3288. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3289. } while (0)
  3290. /* degenerate case for 32-bit fields */
  3291. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3292. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3293. ((_var) = (_val))
  3294. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3295. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3296. ((_var) = (_val))
  3297. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3298. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3299. ((_var) = (_val))
  3300. /* degenerate case for 32-bit fields */
  3301. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3302. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3303. ((_var) = (_val))
  3304. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3305. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3306. ((_var) = (_val))
  3307. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3308. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3309. ((_var) = (_val))
  3310. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3311. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3312. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3313. do { \
  3314. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3315. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3316. } while (0)
  3317. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3318. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3319. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3320. do { \
  3321. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3322. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3323. } while (0)
  3324. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3325. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3326. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3327. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3328. do { \
  3329. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3330. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3331. } while (0)
  3332. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3333. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3334. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3335. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3336. do { \
  3337. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3338. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3339. } while (0)
  3340. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3341. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3342. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3343. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3344. do { \
  3345. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3346. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3347. } while (0)
  3348. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3349. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3350. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3351. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3352. do { \
  3353. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3354. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3355. } while (0)
  3356. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3357. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3358. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3359. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3360. do { \
  3361. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3362. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3363. } while (0)
  3364. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3365. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3366. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3367. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3368. do { \
  3369. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3370. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3371. } while (0)
  3372. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3373. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3374. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3375. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3376. do { \
  3377. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3378. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3379. } while (0)
  3380. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3381. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3382. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3383. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3384. do { \
  3385. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3386. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3387. } while (0)
  3388. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3389. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3390. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3391. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3392. do { \
  3393. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3394. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3395. } while (0)
  3396. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3397. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3398. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3399. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3400. do { \
  3401. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3402. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3403. } while (0)
  3404. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3405. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3406. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3407. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3408. do { \
  3409. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3410. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3411. } while (0)
  3412. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3413. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3414. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3415. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3416. do { \
  3417. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3418. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3419. } while (0)
  3420. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3421. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3422. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3423. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3424. do { \
  3425. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3426. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3427. } while (0)
  3428. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3429. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3430. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3431. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3432. do { \
  3433. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3434. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3435. } while (0)
  3436. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3437. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3438. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3439. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3440. do { \
  3441. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3442. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3443. } while (0)
  3444. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3445. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3446. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3447. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3448. do { \
  3449. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3450. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3451. } while (0)
  3452. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3453. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3454. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3455. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3456. do { \
  3457. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3458. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3459. } while (0)
  3460. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3461. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3462. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3463. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3464. do { \
  3465. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3466. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3467. } while (0)
  3468. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3469. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3470. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3471. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3472. do { \
  3473. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3474. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3475. } while (0)
  3476. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3477. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3478. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3479. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3480. do { \
  3481. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3482. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3483. } while (0)
  3484. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3485. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3486. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3487. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3488. do { \
  3489. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3490. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3491. } while (0)
  3492. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3493. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3494. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3495. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3496. do { \
  3497. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3498. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3499. } while (0)
  3500. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3501. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3502. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3503. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3504. do { \
  3505. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3506. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3507. } while (0)
  3508. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3509. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3510. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3511. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3512. do { \
  3513. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3514. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3515. } while (0)
  3516. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3517. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3518. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3519. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3520. do { \
  3521. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3522. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3523. } while (0)
  3524. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3525. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3526. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3527. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3528. do { \
  3529. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3530. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3531. } while (0)
  3532. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3533. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3534. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3535. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3536. do { \
  3537. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3538. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3539. } while (0)
  3540. /**
  3541. * @brief host -> target FW statistics retrieve
  3542. *
  3543. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3544. *
  3545. * @details
  3546. * The following field definitions describe the format of the HTT host
  3547. * to target FW stats retrieve message. The message specifies the type of
  3548. * stats host wants to retrieve.
  3549. *
  3550. * |31 24|23 16|15 8|7 0|
  3551. * |-----------------------------------------------------------|
  3552. * | stats types request bitmask | msg type |
  3553. * |-----------------------------------------------------------|
  3554. * | stats types reset bitmask | reserved |
  3555. * |-----------------------------------------------------------|
  3556. * | stats type | config value |
  3557. * |-----------------------------------------------------------|
  3558. * | cookie LSBs |
  3559. * |-----------------------------------------------------------|
  3560. * | cookie MSBs |
  3561. * |-----------------------------------------------------------|
  3562. * Header fields:
  3563. * - MSG_TYPE
  3564. * Bits 7:0
  3565. * Purpose: identifies this is a stats upload request message
  3566. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3567. * - UPLOAD_TYPES
  3568. * Bits 31:8
  3569. * Purpose: identifies which types of FW statistics to upload
  3570. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3571. * - RESET_TYPES
  3572. * Bits 31:8
  3573. * Purpose: identifies which types of FW statistics to reset
  3574. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3575. * - CFG_VAL
  3576. * Bits 23:0
  3577. * Purpose: give an opaque configuration value to the specified stats type
  3578. * Value: stats-type specific configuration value
  3579. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3580. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3581. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3582. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3583. * - CFG_STAT_TYPE
  3584. * Bits 31:24
  3585. * Purpose: specify which stats type (if any) the config value applies to
  3586. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3587. * a valid configuration specification
  3588. * - COOKIE_LSBS
  3589. * Bits 31:0
  3590. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3591. * message with its preceding host->target stats request message.
  3592. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3593. * - COOKIE_MSBS
  3594. * Bits 31:0
  3595. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3596. * message with its preceding host->target stats request message.
  3597. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3598. */
  3599. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3600. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3601. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3602. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3603. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3604. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3605. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3606. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3607. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3608. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3609. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3610. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3611. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3612. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3613. do { \
  3614. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3615. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3616. } while (0)
  3617. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3618. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3619. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3620. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3621. do { \
  3622. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3623. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3624. } while (0)
  3625. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3626. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3627. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3628. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3629. do { \
  3630. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3631. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3632. } while (0)
  3633. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3634. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3635. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3636. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3637. do { \
  3638. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3639. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3640. } while (0)
  3641. /**
  3642. * @brief host -> target HTT out-of-band sync request
  3643. *
  3644. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3645. *
  3646. * @details
  3647. * The HTT SYNC tells the target to suspend processing of subsequent
  3648. * HTT host-to-target messages until some other target agent locally
  3649. * informs the target HTT FW that the current sync counter is equal to
  3650. * or greater than (in a modulo sense) the sync counter specified in
  3651. * the SYNC message.
  3652. * This allows other host-target components to synchronize their operation
  3653. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3654. * security key has been downloaded to and activated by the target.
  3655. * In the absence of any explicit synchronization counter value
  3656. * specification, the target HTT FW will use zero as the default current
  3657. * sync value.
  3658. *
  3659. * |31 24|23 16|15 8|7 0|
  3660. * |-----------------------------------------------------------|
  3661. * | reserved | sync count | msg type |
  3662. * |-----------------------------------------------------------|
  3663. * Header fields:
  3664. * - MSG_TYPE
  3665. * Bits 7:0
  3666. * Purpose: identifies this as a sync message
  3667. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3668. * - SYNC_COUNT
  3669. * Bits 15:8
  3670. * Purpose: specifies what sync value the HTT FW will wait for from
  3671. * an out-of-band specification to resume its operation
  3672. * Value: in-band sync counter value to compare against the out-of-band
  3673. * counter spec.
  3674. * The HTT target FW will suspend its host->target message processing
  3675. * as long as
  3676. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3677. */
  3678. #define HTT_H2T_SYNC_MSG_SZ 4
  3679. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3680. #define HTT_H2T_SYNC_COUNT_S 8
  3681. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3682. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3683. HTT_H2T_SYNC_COUNT_S)
  3684. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3685. do { \
  3686. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3687. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3688. } while (0)
  3689. /**
  3690. * @brief host -> target HTT aggregation configuration
  3691. *
  3692. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3693. */
  3694. #define HTT_AGGR_CFG_MSG_SZ 4
  3695. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3696. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3697. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3698. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3699. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3700. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3701. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3702. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3703. do { \
  3704. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3705. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3706. } while (0)
  3707. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3708. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3709. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3710. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3711. do { \
  3712. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3713. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3714. } while (0)
  3715. /**
  3716. * @brief host -> target HTT configure max amsdu info per vdev
  3717. *
  3718. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3719. *
  3720. * @details
  3721. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3722. *
  3723. * |31 21|20 16|15 8|7 0|
  3724. * |-----------------------------------------------------------|
  3725. * | reserved | vdev id | max amsdu | msg type |
  3726. * |-----------------------------------------------------------|
  3727. * Header fields:
  3728. * - MSG_TYPE
  3729. * Bits 7:0
  3730. * Purpose: identifies this as a aggr cfg ex message
  3731. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3732. * - MAX_NUM_AMSDU_SUBFRM
  3733. * Bits 15:8
  3734. * Purpose: max MSDUs per A-MSDU
  3735. * - VDEV_ID
  3736. * Bits 20:16
  3737. * Purpose: ID of the vdev to which this limit is applied
  3738. */
  3739. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3740. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3741. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3742. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3743. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3744. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3745. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3746. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3747. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3748. do { \
  3749. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3750. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3751. } while (0)
  3752. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3753. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3754. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3755. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3756. do { \
  3757. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3758. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3759. } while (0)
  3760. /**
  3761. * @brief HTT WDI_IPA Config Message
  3762. *
  3763. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3764. *
  3765. * @details
  3766. * The HTT WDI_IPA config message is created/sent by host at driver
  3767. * init time. It contains information about data structures used on
  3768. * WDI_IPA TX and RX path.
  3769. * TX CE ring is used for pushing packet metadata from IPA uC
  3770. * to WLAN FW
  3771. * TX Completion ring is used for generating TX completions from
  3772. * WLAN FW to IPA uC
  3773. * RX Indication ring is used for indicating RX packets from FW
  3774. * to IPA uC
  3775. * RX Ring2 is used as either completion ring or as second
  3776. * indication ring. when Ring2 is used as completion ring, IPA uC
  3777. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3778. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3779. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3780. * indicated in RX Indication ring. Please see WDI_IPA specification
  3781. * for more details.
  3782. * |31 24|23 16|15 8|7 0|
  3783. * |----------------+----------------+----------------+----------------|
  3784. * | tx pkt pool size | Rsvd | msg_type |
  3785. * |-------------------------------------------------------------------|
  3786. * | tx comp ring base (bits 31:0) |
  3787. #if HTT_PADDR64
  3788. * | tx comp ring base (bits 63:32) |
  3789. #endif
  3790. * |-------------------------------------------------------------------|
  3791. * | tx comp ring size |
  3792. * |-------------------------------------------------------------------|
  3793. * | tx comp WR_IDX physical address (bits 31:0) |
  3794. #if HTT_PADDR64
  3795. * | tx comp WR_IDX physical address (bits 63:32) |
  3796. #endif
  3797. * |-------------------------------------------------------------------|
  3798. * | tx CE WR_IDX physical address (bits 31:0) |
  3799. #if HTT_PADDR64
  3800. * | tx CE WR_IDX physical address (bits 63:32) |
  3801. #endif
  3802. * |-------------------------------------------------------------------|
  3803. * | rx indication ring base (bits 31:0) |
  3804. #if HTT_PADDR64
  3805. * | rx indication ring base (bits 63:32) |
  3806. #endif
  3807. * |-------------------------------------------------------------------|
  3808. * | rx indication ring size |
  3809. * |-------------------------------------------------------------------|
  3810. * | rx ind RD_IDX physical address (bits 31:0) |
  3811. #if HTT_PADDR64
  3812. * | rx ind RD_IDX physical address (bits 63:32) |
  3813. #endif
  3814. * |-------------------------------------------------------------------|
  3815. * | rx ind WR_IDX physical address (bits 31:0) |
  3816. #if HTT_PADDR64
  3817. * | rx ind WR_IDX physical address (bits 63:32) |
  3818. #endif
  3819. * |-------------------------------------------------------------------|
  3820. * |-------------------------------------------------------------------|
  3821. * | rx ring2 base (bits 31:0) |
  3822. #if HTT_PADDR64
  3823. * | rx ring2 base (bits 63:32) |
  3824. #endif
  3825. * |-------------------------------------------------------------------|
  3826. * | rx ring2 size |
  3827. * |-------------------------------------------------------------------|
  3828. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3829. #if HTT_PADDR64
  3830. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3831. #endif
  3832. * |-------------------------------------------------------------------|
  3833. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3834. #if HTT_PADDR64
  3835. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3836. #endif
  3837. * |-------------------------------------------------------------------|
  3838. *
  3839. * Header fields:
  3840. * Header fields:
  3841. * - MSG_TYPE
  3842. * Bits 7:0
  3843. * Purpose: Identifies this as WDI_IPA config message
  3844. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3845. * - TX_PKT_POOL_SIZE
  3846. * Bits 15:0
  3847. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3848. * WDI_IPA TX path
  3849. * For systems using 32-bit format for bus addresses:
  3850. * - TX_COMP_RING_BASE_ADDR
  3851. * Bits 31:0
  3852. * Purpose: TX Completion Ring base address in DDR
  3853. * - TX_COMP_RING_SIZE
  3854. * Bits 31:0
  3855. * Purpose: TX Completion Ring size (must be power of 2)
  3856. * - TX_COMP_WR_IDX_ADDR
  3857. * Bits 31:0
  3858. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3859. * updates the Write Index for WDI_IPA TX completion ring
  3860. * - TX_CE_WR_IDX_ADDR
  3861. * Bits 31:0
  3862. * Purpose: DDR address where IPA uC
  3863. * updates the WR Index for TX CE ring
  3864. * (needed for fusion platforms)
  3865. * - RX_IND_RING_BASE_ADDR
  3866. * Bits 31:0
  3867. * Purpose: RX Indication Ring base address in DDR
  3868. * - RX_IND_RING_SIZE
  3869. * Bits 31:0
  3870. * Purpose: RX Indication Ring size
  3871. * - RX_IND_RD_IDX_ADDR
  3872. * Bits 31:0
  3873. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3874. * RX indication ring
  3875. * - RX_IND_WR_IDX_ADDR
  3876. * Bits 31:0
  3877. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3878. * updates the Write Index for WDI_IPA RX indication ring
  3879. * - RX_RING2_BASE_ADDR
  3880. * Bits 31:0
  3881. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3882. * - RX_RING2_SIZE
  3883. * Bits 31:0
  3884. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3885. * - RX_RING2_RD_IDX_ADDR
  3886. * Bits 31:0
  3887. * Purpose: If Second RX ring is Indication ring, DDR address where
  3888. * IPA uC updates the Read Index for Ring2.
  3889. * If Second RX ring is completion ring, this is NOT used
  3890. * - RX_RING2_WR_IDX_ADDR
  3891. * Bits 31:0
  3892. * Purpose: If Second RX ring is Indication ring, DDR address where
  3893. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3894. * If second RX ring is completion ring, DDR address where
  3895. * IPA uC updates the Write Index for Ring 2.
  3896. * For systems using 64-bit format for bus addresses:
  3897. * - TX_COMP_RING_BASE_ADDR_LO
  3898. * Bits 31:0
  3899. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3900. * - TX_COMP_RING_BASE_ADDR_HI
  3901. * Bits 31:0
  3902. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3903. * - TX_COMP_RING_SIZE
  3904. * Bits 31:0
  3905. * Purpose: TX Completion Ring size (must be power of 2)
  3906. * - TX_COMP_WR_IDX_ADDR_LO
  3907. * Bits 31:0
  3908. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3909. * Lower 4 bytes of DDR address where WIFI FW
  3910. * updates the Write Index for WDI_IPA TX completion ring
  3911. * - TX_COMP_WR_IDX_ADDR_HI
  3912. * Bits 31:0
  3913. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3914. * Higher 4 bytes of DDR address where WIFI FW
  3915. * updates the Write Index for WDI_IPA TX completion ring
  3916. * - TX_CE_WR_IDX_ADDR_LO
  3917. * Bits 31:0
  3918. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3919. * updates the WR Index for TX CE ring
  3920. * (needed for fusion platforms)
  3921. * - TX_CE_WR_IDX_ADDR_HI
  3922. * Bits 31:0
  3923. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3924. * updates the WR Index for TX CE ring
  3925. * (needed for fusion platforms)
  3926. * - RX_IND_RING_BASE_ADDR_LO
  3927. * Bits 31:0
  3928. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3929. * - RX_IND_RING_BASE_ADDR_HI
  3930. * Bits 31:0
  3931. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3932. * - RX_IND_RING_SIZE
  3933. * Bits 31:0
  3934. * Purpose: RX Indication Ring size
  3935. * - RX_IND_RD_IDX_ADDR_LO
  3936. * Bits 31:0
  3937. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3938. * for WDI_IPA RX indication ring
  3939. * - RX_IND_RD_IDX_ADDR_HI
  3940. * Bits 31:0
  3941. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3942. * for WDI_IPA RX indication ring
  3943. * - RX_IND_WR_IDX_ADDR_LO
  3944. * Bits 31:0
  3945. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3946. * Lower 4 bytes of DDR address where WIFI FW
  3947. * updates the Write Index for WDI_IPA RX indication ring
  3948. * - RX_IND_WR_IDX_ADDR_HI
  3949. * Bits 31:0
  3950. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3951. * Higher 4 bytes of DDR address where WIFI FW
  3952. * updates the Write Index for WDI_IPA RX indication ring
  3953. * - RX_RING2_BASE_ADDR_LO
  3954. * Bits 31:0
  3955. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3956. * - RX_RING2_BASE_ADDR_HI
  3957. * Bits 31:0
  3958. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3959. * - RX_RING2_SIZE
  3960. * Bits 31:0
  3961. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3962. * - RX_RING2_RD_IDX_ADDR_LO
  3963. * Bits 31:0
  3964. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3965. * DDR address where IPA uC updates the Read Index for Ring2.
  3966. * If Second RX ring is completion ring, this is NOT used
  3967. * - RX_RING2_RD_IDX_ADDR_HI
  3968. * Bits 31:0
  3969. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3970. * DDR address where IPA uC updates the Read Index for Ring2.
  3971. * If Second RX ring is completion ring, this is NOT used
  3972. * - RX_RING2_WR_IDX_ADDR_LO
  3973. * Bits 31:0
  3974. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3975. * DDR address where WIFI FW updates the Write Index
  3976. * for WDI_IPA RX ring2
  3977. * If second RX ring is completion ring, lower 4 bytes of
  3978. * DDR address where IPA uC updates the Write Index for Ring 2.
  3979. * - RX_RING2_WR_IDX_ADDR_HI
  3980. * Bits 31:0
  3981. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3982. * DDR address where WIFI FW updates the Write Index
  3983. * for WDI_IPA RX ring2
  3984. * If second RX ring is completion ring, higher 4 bytes of
  3985. * DDR address where IPA uC updates the Write Index for Ring 2.
  3986. */
  3987. #if HTT_PADDR64
  3988. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3989. #else
  3990. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3991. #endif
  3992. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3993. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3994. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3995. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3996. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3997. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3998. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3999. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4000. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4001. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4002. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4003. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4004. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4005. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4006. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4007. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4008. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4009. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4010. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4011. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4012. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4013. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4014. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4015. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4016. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4017. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4018. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4019. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4020. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4021. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4022. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4023. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4024. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4025. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4026. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4027. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4028. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4029. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4030. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4031. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4032. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4033. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4034. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4035. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4036. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4037. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4038. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4039. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4040. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4041. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4042. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4043. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4044. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4045. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4046. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4047. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4048. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4049. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4050. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4051. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4052. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4053. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4054. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4055. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4056. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4057. do { \
  4058. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4059. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4060. } while (0)
  4061. /* for systems using 32-bit format for bus addr */
  4062. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4063. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4064. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4065. do { \
  4066. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4067. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4068. } while (0)
  4069. /* for systems using 64-bit format for bus addr */
  4070. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4071. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4072. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4073. do { \
  4074. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4075. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4076. } while (0)
  4077. /* for systems using 64-bit format for bus addr */
  4078. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4079. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4080. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4081. do { \
  4082. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4083. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4084. } while (0)
  4085. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4086. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4087. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4088. do { \
  4089. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4090. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4091. } while (0)
  4092. /* for systems using 32-bit format for bus addr */
  4093. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4094. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4095. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4096. do { \
  4097. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4098. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4099. } while (0)
  4100. /* for systems using 64-bit format for bus addr */
  4101. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4102. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4103. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4104. do { \
  4105. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4106. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4107. } while (0)
  4108. /* for systems using 64-bit format for bus addr */
  4109. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4110. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4111. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4112. do { \
  4113. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4114. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4115. } while (0)
  4116. /* for systems using 32-bit format for bus addr */
  4117. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4118. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4119. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4120. do { \
  4121. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4122. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4123. } while (0)
  4124. /* for systems using 64-bit format for bus addr */
  4125. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4126. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4127. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4128. do { \
  4129. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4130. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4131. } while (0)
  4132. /* for systems using 64-bit format for bus addr */
  4133. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4134. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4135. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4136. do { \
  4137. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4138. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4139. } while (0)
  4140. /* for systems using 32-bit format for bus addr */
  4141. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4142. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4143. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4144. do { \
  4145. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4146. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4147. } while (0)
  4148. /* for systems using 64-bit format for bus addr */
  4149. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4150. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4151. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4152. do { \
  4153. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4154. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4155. } while (0)
  4156. /* for systems using 64-bit format for bus addr */
  4157. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4158. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4159. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4160. do { \
  4161. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4162. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4163. } while (0)
  4164. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4165. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4166. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4167. do { \
  4168. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4169. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4170. } while (0)
  4171. /* for systems using 32-bit format for bus addr */
  4172. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4173. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4174. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4175. do { \
  4176. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4177. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4178. } while (0)
  4179. /* for systems using 64-bit format for bus addr */
  4180. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4181. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4182. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4183. do { \
  4184. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4185. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4186. } while (0)
  4187. /* for systems using 64-bit format for bus addr */
  4188. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4189. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4190. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4191. do { \
  4192. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4193. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4194. } while (0)
  4195. /* for systems using 32-bit format for bus addr */
  4196. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4197. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4198. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4199. do { \
  4200. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4201. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4202. } while (0)
  4203. /* for systems using 64-bit format for bus addr */
  4204. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4205. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4206. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4207. do { \
  4208. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4209. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4210. } while (0)
  4211. /* for systems using 64-bit format for bus addr */
  4212. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4213. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4214. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4215. do { \
  4216. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4217. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4218. } while (0)
  4219. /* for systems using 32-bit format for bus addr */
  4220. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4221. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4222. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4223. do { \
  4224. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4225. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4226. } while (0)
  4227. /* for systems using 64-bit format for bus addr */
  4228. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4229. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4230. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4231. do { \
  4232. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4233. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4234. } while (0)
  4235. /* for systems using 64-bit format for bus addr */
  4236. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4237. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4238. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4239. do { \
  4240. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4241. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4242. } while (0)
  4243. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4244. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4245. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4246. do { \
  4247. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4248. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4249. } while (0)
  4250. /* for systems using 32-bit format for bus addr */
  4251. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4252. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4253. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4254. do { \
  4255. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4256. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4257. } while (0)
  4258. /* for systems using 64-bit format for bus addr */
  4259. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4260. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4261. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4262. do { \
  4263. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4264. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4265. } while (0)
  4266. /* for systems using 64-bit format for bus addr */
  4267. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4268. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4269. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4270. do { \
  4271. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4272. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4273. } while (0)
  4274. /* for systems using 32-bit format for bus addr */
  4275. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4276. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4277. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4278. do { \
  4279. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4280. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4281. } while (0)
  4282. /* for systems using 64-bit format for bus addr */
  4283. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4284. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4285. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4286. do { \
  4287. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4288. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4289. } while (0)
  4290. /* for systems using 64-bit format for bus addr */
  4291. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4292. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4293. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4294. do { \
  4295. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4296. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4297. } while (0)
  4298. /*
  4299. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4300. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4301. * addresses are stored in a XXX-bit field.
  4302. * This macro is used to define both htt_wdi_ipa_config32_t and
  4303. * htt_wdi_ipa_config64_t structs.
  4304. */
  4305. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4306. _paddr__tx_comp_ring_base_addr_, \
  4307. _paddr__tx_comp_wr_idx_addr_, \
  4308. _paddr__tx_ce_wr_idx_addr_, \
  4309. _paddr__rx_ind_ring_base_addr_, \
  4310. _paddr__rx_ind_rd_idx_addr_, \
  4311. _paddr__rx_ind_wr_idx_addr_, \
  4312. _paddr__rx_ring2_base_addr_,\
  4313. _paddr__rx_ring2_rd_idx_addr_,\
  4314. _paddr__rx_ring2_wr_idx_addr_) \
  4315. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4316. { \
  4317. /* DWORD 0: flags and meta-data */ \
  4318. A_UINT32 \
  4319. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4320. reserved: 8, \
  4321. tx_pkt_pool_size: 16;\
  4322. /* DWORD 1 */\
  4323. _paddr__tx_comp_ring_base_addr_;\
  4324. /* DWORD 2 (or 3)*/\
  4325. A_UINT32 tx_comp_ring_size;\
  4326. /* DWORD 3 (or 4)*/\
  4327. _paddr__tx_comp_wr_idx_addr_;\
  4328. /* DWORD 4 (or 6)*/\
  4329. _paddr__tx_ce_wr_idx_addr_;\
  4330. /* DWORD 5 (or 8)*/\
  4331. _paddr__rx_ind_ring_base_addr_;\
  4332. /* DWORD 6 (or 10)*/\
  4333. A_UINT32 rx_ind_ring_size;\
  4334. /* DWORD 7 (or 11)*/\
  4335. _paddr__rx_ind_rd_idx_addr_;\
  4336. /* DWORD 8 (or 13)*/\
  4337. _paddr__rx_ind_wr_idx_addr_;\
  4338. /* DWORD 9 (or 15)*/\
  4339. _paddr__rx_ring2_base_addr_;\
  4340. /* DWORD 10 (or 17) */\
  4341. A_UINT32 rx_ring2_size;\
  4342. /* DWORD 11 (or 18) */\
  4343. _paddr__rx_ring2_rd_idx_addr_;\
  4344. /* DWORD 12 (or 20) */\
  4345. _paddr__rx_ring2_wr_idx_addr_;\
  4346. } POSTPACK
  4347. /* define a htt_wdi_ipa_config32_t type */
  4348. 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));
  4349. /* define a htt_wdi_ipa_config64_t type */
  4350. 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));
  4351. #if HTT_PADDR64
  4352. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4353. #else
  4354. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4355. #endif
  4356. enum htt_wdi_ipa_op_code {
  4357. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4358. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4359. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4360. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4361. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4362. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4363. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4364. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4365. /* keep this last */
  4366. HTT_WDI_IPA_OPCODE_MAX
  4367. };
  4368. /**
  4369. * @brief HTT WDI_IPA Operation Request Message
  4370. *
  4371. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4372. *
  4373. * @details
  4374. * HTT WDI_IPA Operation Request message is sent by host
  4375. * to either suspend or resume WDI_IPA TX or RX path.
  4376. * |31 24|23 16|15 8|7 0|
  4377. * |----------------+----------------+----------------+----------------|
  4378. * | op_code | Rsvd | msg_type |
  4379. * |-------------------------------------------------------------------|
  4380. *
  4381. * Header fields:
  4382. * - MSG_TYPE
  4383. * Bits 7:0
  4384. * Purpose: Identifies this as WDI_IPA Operation Request message
  4385. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4386. * - OP_CODE
  4387. * Bits 31:16
  4388. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4389. * value: = enum htt_wdi_ipa_op_code
  4390. */
  4391. PREPACK struct htt_wdi_ipa_op_request_t
  4392. {
  4393. /* DWORD 0: flags and meta-data */
  4394. A_UINT32
  4395. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4396. reserved: 8,
  4397. op_code: 16;
  4398. } POSTPACK;
  4399. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4400. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4401. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4402. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4403. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4404. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4405. do { \
  4406. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4407. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4408. } while (0)
  4409. /*
  4410. * @brief host -> target HTT_MSI_SETUP message
  4411. *
  4412. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4413. *
  4414. * @details
  4415. * After target is booted up, host can send MSI setup message so that
  4416. * target sets up HW registers based on setup message.
  4417. *
  4418. * The message would appear as follows:
  4419. * |31 24|23 16|15|14 8|7 0|
  4420. * |---------------+-----------------+-----------------+-----------------|
  4421. * | reserved | msi_type | pdev_id | msg_type |
  4422. * |---------------------------------------------------------------------|
  4423. * | msi_addr_lo |
  4424. * |---------------------------------------------------------------------|
  4425. * | msi_addr_hi |
  4426. * |---------------------------------------------------------------------|
  4427. * | msi_data |
  4428. * |---------------------------------------------------------------------|
  4429. *
  4430. * The message is interpreted as follows:
  4431. * dword0 - b'0:7 - msg_type: This will be set to
  4432. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4433. * b'8:15 - pdev_id:
  4434. * 0 (for rings at SOC/UMAC level),
  4435. * 1/2/3 mac id (for rings at LMAC level)
  4436. * b'16:23 - msi_type: identify which msi registers need to be setup
  4437. * more details can be got from enum htt_msi_setup_type
  4438. * b'24:31 - reserved
  4439. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4440. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4441. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4442. */
  4443. PREPACK struct htt_msi_setup_t {
  4444. A_UINT32 msg_type: 8,
  4445. pdev_id: 8,
  4446. msi_type: 8,
  4447. reserved: 8;
  4448. A_UINT32 msi_addr_lo;
  4449. A_UINT32 msi_addr_hi;
  4450. A_UINT32 msi_data;
  4451. } POSTPACK;
  4452. enum htt_msi_setup_type {
  4453. HTT_PPDU_END_MSI_SETUP_TYPE,
  4454. /* Insert new types here*/
  4455. };
  4456. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4457. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4458. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4459. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4460. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4461. HTT_MSI_SETUP_PDEV_ID_S)
  4462. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4463. do { \
  4464. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4465. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4466. } while (0)
  4467. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4468. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4469. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4470. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4471. HTT_MSI_SETUP_MSI_TYPE_S)
  4472. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4473. do { \
  4474. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4475. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4476. } while (0)
  4477. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4478. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4479. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4480. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4481. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4482. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4483. do { \
  4484. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4485. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4486. } while (0)
  4487. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4488. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4489. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4490. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4491. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4492. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4493. do { \
  4494. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4495. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4496. } while (0)
  4497. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4498. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4499. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4500. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4501. HTT_MSI_SETUP_MSI_DATA_S)
  4502. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4503. do { \
  4504. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4505. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4506. } while (0)
  4507. /*
  4508. * @brief host -> target HTT_SRING_SETUP message
  4509. *
  4510. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4511. *
  4512. * @details
  4513. * After target is booted up, Host can send SRING setup message for
  4514. * each host facing LMAC SRING. Target setups up HW registers based
  4515. * on setup message and confirms back to Host if response_required is set.
  4516. * Host should wait for confirmation message before sending new SRING
  4517. * setup message
  4518. *
  4519. * The message would appear as follows:
  4520. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4521. * |--------------- +-----------------+-----------------+-----------------|
  4522. * | ring_type | ring_id | pdev_id | msg_type |
  4523. * |----------------------------------------------------------------------|
  4524. * | ring_base_addr_lo |
  4525. * |----------------------------------------------------------------------|
  4526. * | ring_base_addr_hi |
  4527. * |----------------------------------------------------------------------|
  4528. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4529. * |----------------------------------------------------------------------|
  4530. * | ring_head_offset32_remote_addr_lo |
  4531. * |----------------------------------------------------------------------|
  4532. * | ring_head_offset32_remote_addr_hi |
  4533. * |----------------------------------------------------------------------|
  4534. * | ring_tail_offset32_remote_addr_lo |
  4535. * |----------------------------------------------------------------------|
  4536. * | ring_tail_offset32_remote_addr_hi |
  4537. * |----------------------------------------------------------------------|
  4538. * | ring_msi_addr_lo |
  4539. * |----------------------------------------------------------------------|
  4540. * | ring_msi_addr_hi |
  4541. * |----------------------------------------------------------------------|
  4542. * | ring_msi_data |
  4543. * |----------------------------------------------------------------------|
  4544. * | intr_timer_th |IM| intr_batch_counter_th |
  4545. * |----------------------------------------------------------------------|
  4546. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4547. * |----------------------------------------------------------------------|
  4548. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4549. * |----------------------------------------------------------------------|
  4550. * Where
  4551. * IM = sw_intr_mode
  4552. * RR = response_required
  4553. * PTCF = prefetch_timer_cfg
  4554. * IP = IPA drop flag
  4555. *
  4556. * The message is interpreted as follows:
  4557. * dword0 - b'0:7 - msg_type: This will be set to
  4558. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4559. * b'8:15 - pdev_id:
  4560. * 0 (for rings at SOC/UMAC level),
  4561. * 1/2/3 mac id (for rings at LMAC level)
  4562. * b'16:23 - ring_id: identify which ring is to setup,
  4563. * more details can be got from enum htt_srng_ring_id
  4564. * b'24:31 - ring_type: identify type of host rings,
  4565. * more details can be got from enum htt_srng_ring_type
  4566. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4567. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4568. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4569. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4570. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4571. * SW_TO_HW_RING.
  4572. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4573. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4574. * Lower 32 bits of memory address of the remote variable
  4575. * storing the 4-byte word offset that identifies the head
  4576. * element within the ring.
  4577. * (The head offset variable has type A_UINT32.)
  4578. * Valid for HW_TO_SW and SW_TO_SW rings.
  4579. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4580. * Upper 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. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4586. * Lower 32 bits of memory address of the remote variable
  4587. * storing the 4-byte word offset that identifies the tail
  4588. * element within the ring.
  4589. * (The tail offset variable has type A_UINT32.)
  4590. * Valid for HW_TO_SW and SW_TO_SW rings.
  4591. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4592. * Upper 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. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4598. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4599. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4600. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4601. * dword10 - b'0:31 - ring_msi_data: MSI data
  4602. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4603. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4604. * dword11 - b'0:14 - intr_batch_counter_th:
  4605. * batch counter threshold is in units of 4-byte words.
  4606. * HW internally maintains and increments batch count.
  4607. * (see SRING spec for detail description).
  4608. * When batch count reaches threshold value, an interrupt
  4609. * is generated by HW.
  4610. * b'15 - sw_intr_mode:
  4611. * This configuration shall be static.
  4612. * Only programmed at power up.
  4613. * 0: generate pulse style sw interrupts
  4614. * 1: generate level style sw interrupts
  4615. * b'16:31 - intr_timer_th:
  4616. * The timer init value when timer is idle or is
  4617. * initialized to start downcounting.
  4618. * In 8us units (to cover a range of 0 to 524 ms)
  4619. * dword12 - b'0:15 - intr_low_threshold:
  4620. * Used only by Consumer ring to generate ring_sw_int_p.
  4621. * Ring entries low threshold water mark, that is used
  4622. * in combination with the interrupt timer as well as
  4623. * the the clearing of the level interrupt.
  4624. * b'16:18 - prefetch_timer_cfg:
  4625. * Used only by Consumer ring to set timer mode to
  4626. * support Application prefetch handling.
  4627. * The external tail offset/pointer will be updated
  4628. * at following intervals:
  4629. * 3'b000: (Prefetch feature disabled; used only for debug)
  4630. * 3'b001: 1 usec
  4631. * 3'b010: 4 usec
  4632. * 3'b011: 8 usec (default)
  4633. * 3'b100: 16 usec
  4634. * Others: Reserverd
  4635. * b'19 - response_required:
  4636. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4637. * b'20 - ipa_drop_flag:
  4638. Indicates that host will config ipa drop threshold percentage
  4639. * b'21:31 - reserved: reserved for future use
  4640. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4641. * b'8:15 - ipa drop high threshold percentage:
  4642. * b'16:31 - Reserved
  4643. */
  4644. PREPACK struct htt_sring_setup_t {
  4645. A_UINT32 msg_type: 8,
  4646. pdev_id: 8,
  4647. ring_id: 8,
  4648. ring_type: 8;
  4649. A_UINT32 ring_base_addr_lo;
  4650. A_UINT32 ring_base_addr_hi;
  4651. A_UINT32 ring_size: 16,
  4652. ring_entry_size: 8,
  4653. ring_misc_cfg_flag: 8;
  4654. A_UINT32 ring_head_offset32_remote_addr_lo;
  4655. A_UINT32 ring_head_offset32_remote_addr_hi;
  4656. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4657. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4658. A_UINT32 ring_msi_addr_lo;
  4659. A_UINT32 ring_msi_addr_hi;
  4660. A_UINT32 ring_msi_data;
  4661. A_UINT32 intr_batch_counter_th: 15,
  4662. sw_intr_mode: 1,
  4663. intr_timer_th: 16;
  4664. A_UINT32 intr_low_threshold: 16,
  4665. prefetch_timer_cfg: 3,
  4666. response_required: 1,
  4667. ipa_drop_flag: 1,
  4668. reserved1: 11;
  4669. A_UINT32 ipa_drop_low_threshold: 8,
  4670. ipa_drop_high_threshold: 8,
  4671. reserved: 16;
  4672. } POSTPACK;
  4673. enum htt_srng_ring_type {
  4674. HTT_HW_TO_SW_RING = 0,
  4675. HTT_SW_TO_HW_RING,
  4676. HTT_SW_TO_SW_RING,
  4677. /* Insert new ring types above this line */
  4678. };
  4679. enum htt_srng_ring_id {
  4680. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4681. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4682. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4683. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4684. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4685. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4686. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4687. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4688. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4689. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4690. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4691. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4692. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4693. /* Add Other SRING which can't be directly configured by host software above this line */
  4694. };
  4695. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4696. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4697. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4698. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4699. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4700. HTT_SRING_SETUP_PDEV_ID_S)
  4701. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4702. do { \
  4703. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4704. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4705. } while (0)
  4706. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4707. #define HTT_SRING_SETUP_RING_ID_S 16
  4708. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4709. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4710. HTT_SRING_SETUP_RING_ID_S)
  4711. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4712. do { \
  4713. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4714. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4715. } while (0)
  4716. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4717. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4718. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4719. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4720. HTT_SRING_SETUP_RING_TYPE_S)
  4721. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4722. do { \
  4723. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4724. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4725. } while (0)
  4726. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4727. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4728. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4729. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4730. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4731. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4732. do { \
  4733. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4734. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4735. } while (0)
  4736. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4737. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4738. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4739. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4740. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4741. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4742. do { \
  4743. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4744. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4745. } while (0)
  4746. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4747. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4748. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4749. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4750. HTT_SRING_SETUP_RING_SIZE_S)
  4751. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4752. do { \
  4753. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4754. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4755. } while (0)
  4756. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4757. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4758. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4759. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4760. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4761. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4762. do { \
  4763. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4764. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4765. } while (0)
  4766. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4767. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4768. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4769. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4770. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4771. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4772. do { \
  4773. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4774. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4775. } while (0)
  4776. /* This control bit is applicable to only Producer, which updates Ring ID field
  4777. * of each descriptor before pushing into the ring.
  4778. * 0: updates ring_id(default)
  4779. * 1: ring_id updating disabled */
  4780. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4781. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4782. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4783. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4784. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4785. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4786. do { \
  4787. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4788. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4789. } while (0)
  4790. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4791. * of each descriptor before pushing into the ring.
  4792. * 0: updates Loopcnt(default)
  4793. * 1: Loopcnt updating disabled */
  4794. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4795. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4796. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4797. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4798. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4799. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4800. do { \
  4801. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4802. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4803. } while (0)
  4804. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4805. * into security_id port of GXI/AXI. */
  4806. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4807. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4808. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4809. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4810. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4811. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4812. do { \
  4813. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4814. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4815. } while (0)
  4816. /* During MSI write operation, SRNG drives value of this register bit into
  4817. * swap bit of GXI/AXI. */
  4818. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4819. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4820. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4821. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4822. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4823. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4824. do { \
  4825. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4826. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4827. } while (0)
  4828. /* During Pointer write operation, SRNG drives value of this register bit into
  4829. * swap bit of GXI/AXI. */
  4830. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4831. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4832. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4833. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4834. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4835. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4836. do { \
  4837. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4838. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4839. } while (0)
  4840. /* During any data or TLV write operation, SRNG drives value of this register
  4841. * bit into swap bit of GXI/AXI. */
  4842. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4843. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4844. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4845. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4846. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4847. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4848. do { \
  4849. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4850. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4851. } while (0)
  4852. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4853. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4854. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4855. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4856. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4857. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4858. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4859. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4860. do { \
  4861. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4862. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4863. } while (0)
  4864. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4865. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4866. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4867. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4868. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4869. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4870. do { \
  4871. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4872. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4873. } while (0)
  4874. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4875. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4876. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4877. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4878. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4879. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4880. do { \
  4881. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4882. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4883. } while (0)
  4884. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4885. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4886. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4887. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4888. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4889. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4890. do { \
  4891. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4892. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4893. } while (0)
  4894. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4895. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4896. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4897. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4898. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4899. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4900. do { \
  4901. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4902. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4903. } while (0)
  4904. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4905. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4906. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4907. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4908. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4909. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4910. do { \
  4911. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4912. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4913. } while (0)
  4914. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4915. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4916. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4917. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4918. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4919. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4920. do { \
  4921. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4922. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4923. } while (0)
  4924. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4925. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4926. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4927. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4928. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4929. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4930. do { \
  4931. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4932. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4933. } while (0)
  4934. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4935. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4936. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4937. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4938. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4939. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4940. do { \
  4941. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4942. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4943. } while (0)
  4944. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4945. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4946. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4947. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4948. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4949. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4950. do { \
  4951. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4952. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4953. } while (0)
  4954. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4955. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4956. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4957. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4958. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4959. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4960. do { \
  4961. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4962. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4963. } while (0)
  4964. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4965. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4966. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4967. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4968. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4969. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4970. do { \
  4971. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4972. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4973. } while (0)
  4974. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4975. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4976. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4977. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4978. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4979. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4980. do { \
  4981. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4982. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4983. } while (0)
  4984. /**
  4985. * @brief host -> target RX ring selection config message
  4986. *
  4987. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4988. *
  4989. * @details
  4990. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4991. * configure RXDMA rings.
  4992. * The configuration is per ring based and includes both packet subtypes
  4993. * and PPDU/MPDU TLVs.
  4994. *
  4995. * The message would appear as follows:
  4996. *
  4997. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4998. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4999. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5000. * |-------------------------------------------------------------------|
  5001. * | rsvd2 | ring_buffer_size |
  5002. * |-------------------------------------------------------------------|
  5003. * | packet_type_enable_flags_0 |
  5004. * |-------------------------------------------------------------------|
  5005. * | packet_type_enable_flags_1 |
  5006. * |-------------------------------------------------------------------|
  5007. * | packet_type_enable_flags_2 |
  5008. * |-------------------------------------------------------------------|
  5009. * | packet_type_enable_flags_3 |
  5010. * |-------------------------------------------------------------------|
  5011. * | tlv_filter_in_flags |
  5012. * |-------------------------------------------------------------------|
  5013. * | rx_header_offset | rx_packet_offset |
  5014. * |-------------------------------------------------------------------|
  5015. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5016. * |-------------------------------------------------------------------|
  5017. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5018. * |-------------------------------------------------------------------|
  5019. * | rsvd3 | rx_attention_offset |
  5020. * |-------------------------------------------------------------------|
  5021. * | rsvd4 | mo| fp| rx_drop_threshold |
  5022. * | |ndp|ndp| |
  5023. * |-------------------------------------------------------------------|
  5024. * Where:
  5025. * PS = pkt_swap
  5026. * SS = status_swap
  5027. * OV = rx_offsets_valid
  5028. * DT = drop_thresh_valid
  5029. * The message is interpreted as follows:
  5030. * dword0 - b'0:7 - msg_type: This will be set to
  5031. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5032. * b'8:15 - pdev_id:
  5033. * 0 (for rings at SOC/UMAC level),
  5034. * 1/2/3 mac id (for rings at LMAC level)
  5035. * b'16:23 - ring_id : Identify the ring to configure.
  5036. * More details can be got from enum htt_srng_ring_id
  5037. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5038. * BUF_RING_CFG_0 defs within HW .h files,
  5039. * e.g. wmac_top_reg_seq_hwioreg.h
  5040. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5041. * BUF_RING_CFG_0 defs within HW .h files,
  5042. * e.g. wmac_top_reg_seq_hwioreg.h
  5043. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5044. * configuration fields are valid
  5045. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5046. * rx_drop_threshold field is valid
  5047. * b'28:31 - rsvd1: reserved for future use
  5048. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  5049. * in byte units.
  5050. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5051. * - b'16:31 - rsvd2: Reserved for future use
  5052. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5053. * Enable MGMT packet from 0b0000 to 0b1001
  5054. * bits from low to high: FP, MD, MO - 3 bits
  5055. * FP: Filter_Pass
  5056. * MD: Monitor_Direct
  5057. * MO: Monitor_Other
  5058. * 10 mgmt subtypes * 3 bits -> 30 bits
  5059. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5060. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5061. * Enable MGMT packet from 0b1010 to 0b1111
  5062. * bits from low to high: FP, MD, MO - 3 bits
  5063. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5064. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5065. * Enable CTRL packet from 0b0000 to 0b1001
  5066. * bits from low to high: FP, MD, MO - 3 bits
  5067. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5068. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5069. * Enable CTRL packet from 0b1010 to 0b1111,
  5070. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5071. * bits from low to high: FP, MD, MO - 3 bits
  5072. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5073. * dword6 - b'0:31 - tlv_filter_in_flags:
  5074. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5075. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5076. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5077. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5078. * A value of 0 will be considered as ignore this config.
  5079. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5080. * e.g. wmac_top_reg_seq_hwioreg.h
  5081. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5082. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5083. * A value of 0 will be considered as ignore this config.
  5084. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5085. * e.g. wmac_top_reg_seq_hwioreg.h
  5086. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5087. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5088. * A value of 0 will be considered as ignore this config.
  5089. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5090. * e.g. wmac_top_reg_seq_hwioreg.h
  5091. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5092. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5093. * A value of 0 will be considered as ignore this config.
  5094. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5095. * e.g. wmac_top_reg_seq_hwioreg.h
  5096. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5097. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5098. * A value of 0 will be considered as ignore this config.
  5099. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5100. * e.g. wmac_top_reg_seq_hwioreg.h
  5101. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5102. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5103. * A value of 0 will be considered as ignore this config.
  5104. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5105. * e.g. wmac_top_reg_seq_hwioreg.h
  5106. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5107. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5108. * A value of 0 will be considered as ignore this config.
  5109. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5110. * e.g. wmac_top_reg_seq_hwioreg.h
  5111. * - b'16:31 - rsvd3 for future use
  5112. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5113. * to source rings. Consumer drops packets if the available
  5114. * words in the ring falls below the configured threshold
  5115. * value.
  5116. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5117. * by host. 1 -> subscribed
  5118. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5119. * by host. 1 -> subscribed
  5120. * - b`12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5121. * subscribed by host. 1 -> subscribed
  5122. * - b`13:14 - fp_phy_err_buf_src: This indicates the source ring
  5123. * selection for the FP PHY ERR status tlv.
  5124. * 0 - wbm2rxdma_buf_source_ring
  5125. * 1 - fw2rxdma_buf_source_ring
  5126. * 2 - sw2rxdma_buf_source_ring
  5127. * 3 - no_buffer_ring
  5128. * - b`15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5129. * selection for the FP PHY ERR status tlv.
  5130. * 0 - rxdma_release_ring
  5131. * 1 - rxdma2fw_ring
  5132. * 2 - rxdma2sw_ring
  5133. * 3 - rxdma2reo_ring
  5134. * dword12 - b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5135. * which have to be posted to host from phy.
  5136. * Corresponding to errors defined in
  5137. * phyrx_abort_request_reason enums 0 to 31.
  5138. * Refer to RXPCU register definition header files for the
  5139. * phyrx_abort_request_reason enum definition.
  5140. * dword13 - b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5141. * errors which have to be posted to host from phy.
  5142. * Corresponding to errors defined in
  5143. * phyrx_abort_request_reason enums 32 to 63.
  5144. * Refer to RXPCU register definition header files for the
  5145. * phyrx_abort_request_reason enum definition.
  5146. */
  5147. PREPACK struct htt_rx_ring_selection_cfg_t {
  5148. A_UINT32 msg_type: 8,
  5149. pdev_id: 8,
  5150. ring_id: 8,
  5151. status_swap: 1,
  5152. pkt_swap: 1,
  5153. rx_offsets_valid: 1,
  5154. drop_thresh_valid: 1,
  5155. rsvd1: 4;
  5156. A_UINT32 ring_buffer_size: 16,
  5157. rsvd2: 16;
  5158. A_UINT32 packet_type_enable_flags_0;
  5159. A_UINT32 packet_type_enable_flags_1;
  5160. A_UINT32 packet_type_enable_flags_2;
  5161. A_UINT32 packet_type_enable_flags_3;
  5162. A_UINT32 tlv_filter_in_flags;
  5163. A_UINT32 rx_packet_offset: 16,
  5164. rx_header_offset: 16;
  5165. A_UINT32 rx_mpdu_end_offset: 16,
  5166. rx_mpdu_start_offset: 16;
  5167. A_UINT32 rx_msdu_end_offset: 16,
  5168. rx_msdu_start_offset: 16;
  5169. A_UINT32 rx_attn_offset: 16,
  5170. rsvd3: 16;
  5171. A_UINT32 rx_drop_threshold: 10,
  5172. fp_ndp: 1,
  5173. mo_ndp: 1,
  5174. fp_phy_err: 1,
  5175. fp_phy_err_buf_src: 2,
  5176. fp_phy_err_buf_dest: 2,
  5177. rsvd4: 15;
  5178. A_UINT32 phy_err_mask;
  5179. A_UINT32 phy_err_mask_cont;
  5180. } POSTPACK;
  5181. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5182. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5183. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5184. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5185. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5186. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5187. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5188. do { \
  5189. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5190. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5191. } while (0)
  5192. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5193. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5194. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5195. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5196. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5197. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5198. do { \
  5199. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5200. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5201. } while (0)
  5202. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5203. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5204. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5205. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5206. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5207. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5208. do { \
  5209. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5210. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5211. } while (0)
  5212. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5213. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5214. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5215. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5216. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5217. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5218. do { \
  5219. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5220. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5221. } while (0)
  5222. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5223. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5224. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5225. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5226. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5227. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5228. do { \
  5229. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5230. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5231. } while (0)
  5232. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5233. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5234. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5235. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5236. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5237. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5238. do { \
  5239. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5240. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5241. } while (0)
  5242. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5243. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5244. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5245. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5246. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5247. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5248. do { \
  5249. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5250. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5251. } while (0)
  5252. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5253. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5254. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5255. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5256. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5257. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5258. do { \
  5259. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5260. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5261. } while (0)
  5262. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5263. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5264. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5265. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5266. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5267. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5268. do { \
  5269. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5270. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5271. } while (0)
  5272. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5273. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5274. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5275. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5276. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5277. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5278. do { \
  5279. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5280. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5281. } while (0)
  5282. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5283. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5284. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5285. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5286. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5287. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5288. do { \
  5289. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5290. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5291. } while (0)
  5292. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5293. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5294. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5295. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5296. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5297. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5298. do { \
  5299. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5300. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5301. } while (0)
  5302. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5303. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5304. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5305. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5306. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5307. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5308. do { \
  5309. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5310. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5311. } while (0)
  5312. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5313. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5314. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5315. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5316. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5317. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5318. do { \
  5319. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5320. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5321. } while (0)
  5322. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5323. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5324. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5325. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5326. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5327. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5328. do { \
  5329. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5330. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5331. } while (0)
  5332. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5333. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5334. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5335. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5336. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5337. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5338. do { \
  5339. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5340. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5341. } while (0)
  5342. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5343. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5344. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5345. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5346. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5347. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5348. do { \
  5349. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5350. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5351. } while (0)
  5352. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5353. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5354. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5355. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5356. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5357. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5358. do { \
  5359. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5360. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5361. } while (0)
  5362. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5363. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5364. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5365. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5366. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5367. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5368. do { \
  5369. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5370. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5371. } while (0)
  5372. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5373. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5374. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5375. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5376. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5377. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5378. do { \
  5379. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5380. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5381. } while (0)
  5382. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5383. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5384. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5385. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5386. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5387. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5388. do { \
  5389. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5390. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5391. } while (0)
  5392. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5393. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5394. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5395. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5396. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5397. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5398. do { \
  5399. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5400. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5401. } while (0)
  5402. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5403. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5404. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5405. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5406. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5407. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5408. do { \
  5409. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5410. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5411. } while (0)
  5412. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5413. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5414. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5415. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5416. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5417. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5418. do { \
  5419. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5420. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5421. } while (0)
  5422. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5423. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5424. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5425. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5426. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5427. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5428. do { \
  5429. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5430. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5431. } while (0)
  5432. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5433. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5434. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5435. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5436. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5437. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5438. do { \
  5439. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5440. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5441. } while (0)
  5442. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5443. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5444. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5445. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5446. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5447. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5448. do { \
  5449. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5450. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5451. } while (0)
  5452. /*
  5453. * Subtype based MGMT frames enable bits.
  5454. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5455. */
  5456. /* association request */
  5457. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5458. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5459. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5460. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5461. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5462. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5463. /* association response */
  5464. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5465. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5466. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5467. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5468. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5469. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5470. /* Reassociation request */
  5471. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5472. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5473. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5474. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5475. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5476. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5477. /* Reassociation response */
  5478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5479. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5480. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5481. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5482. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5483. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5484. /* Probe request */
  5485. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5486. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5487. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5488. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5489. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5490. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5491. /* Probe response */
  5492. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5493. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5494. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5495. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5496. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5497. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5498. /* Timing Advertisement */
  5499. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5500. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5501. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5502. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5503. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5504. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5505. /* Reserved */
  5506. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5507. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5509. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5510. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5511. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5512. /* Beacon */
  5513. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5514. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5515. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5516. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5517. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5518. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5519. /* ATIM */
  5520. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5521. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5522. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5523. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5524. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5525. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5526. /* Disassociation */
  5527. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5528. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5529. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5530. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5531. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5532. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5533. /* Authentication */
  5534. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5535. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5536. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5537. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5538. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5539. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5540. /* Deauthentication */
  5541. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5542. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5543. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5544. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5545. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5546. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5547. /* Action */
  5548. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5549. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5550. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5551. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5552. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5553. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5554. /* Action No Ack */
  5555. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5556. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5557. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5558. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5559. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5560. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5561. /* Reserved */
  5562. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5563. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5564. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5565. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5566. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5567. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5568. /*
  5569. * Subtype based CTRL frames enable bits.
  5570. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5571. */
  5572. /* Reserved */
  5573. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5574. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5575. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5576. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5577. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5578. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5579. /* Reserved */
  5580. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5581. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5582. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5583. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5584. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5585. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5586. /* Reserved */
  5587. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5588. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5589. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5590. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5591. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5592. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5593. /* Reserved */
  5594. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5595. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5596. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5597. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5598. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5599. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5600. /* Reserved */
  5601. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5602. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5603. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5604. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5607. /* Reserved */
  5608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5609. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5611. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5612. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5613. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5614. /* Reserved */
  5615. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5616. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5617. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5618. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5619. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5620. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5621. /* Control Wrapper */
  5622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5628. /* Block Ack Request */
  5629. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5635. /* Block Ack*/
  5636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5637. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5639. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5640. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5641. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5642. /* PS-POLL */
  5643. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5644. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5645. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5646. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5647. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5648. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5649. /* RTS */
  5650. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5651. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5652. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5653. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5654. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5655. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5656. /* CTS */
  5657. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5658. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5659. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5660. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5661. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5662. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5663. /* ACK */
  5664. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5665. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5666. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5667. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5668. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5669. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5670. /* CF-END */
  5671. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5672. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5673. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5674. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5675. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5676. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5677. /* CF-END + CF-ACK */
  5678. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5679. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5680. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5681. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5682. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5683. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5684. /* Multicast data */
  5685. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5686. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5687. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5688. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5689. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5690. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5691. /* Unicast data */
  5692. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5693. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5694. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5695. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5696. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5697. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5698. /* NULL data */
  5699. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5700. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5701. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5702. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5703. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5704. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5705. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5706. do { \
  5707. HTT_CHECK_SET_VAL(httsym, value); \
  5708. (word) |= (value) << httsym##_S; \
  5709. } while (0)
  5710. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5711. (((word) & httsym##_M) >> httsym##_S)
  5712. #define htt_rx_ring_pkt_enable_subtype_set( \
  5713. word, flag, mode, type, subtype, val) \
  5714. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5715. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5716. #define htt_rx_ring_pkt_enable_subtype_get( \
  5717. word, flag, mode, type, subtype) \
  5718. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5719. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5720. /* Definition to filter in TLVs */
  5721. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5722. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5723. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5724. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5725. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5726. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5727. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5728. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5729. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5730. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5731. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5732. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5733. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5734. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5735. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5736. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5737. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5738. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5739. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5740. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5741. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5742. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5743. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5744. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5745. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5746. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5747. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5748. do { \
  5749. HTT_CHECK_SET_VAL(httsym, enable); \
  5750. (word) |= (enable) << httsym##_S; \
  5751. } while (0)
  5752. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5753. (((word) & httsym##_M) >> httsym##_S)
  5754. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5755. HTT_RX_RING_TLV_ENABLE_SET( \
  5756. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5757. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5758. HTT_RX_RING_TLV_ENABLE_GET( \
  5759. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5760. /**
  5761. * @brief host -> target TX monitor config message
  5762. *
  5763. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  5764. *
  5765. * @details
  5766. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  5767. * configure RXDMA rings.
  5768. * The configuration is per ring based and includes both packet types
  5769. * and PPDU/MPDU TLVs.
  5770. *
  5771. * The message would appear as follows:
  5772. *
  5773. * |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|
  5774. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  5775. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  5776. * |-----------+--------+--------+-----+------------------------------------|
  5777. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  5778. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  5779. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  5780. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  5781. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  5782. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  5783. * |------------------------------------------------------------------------|
  5784. * | tlv_filter_mask_in0 |
  5785. * |------------------------------------------------------------------------|
  5786. * | tlv_filter_mask_in1 |
  5787. * |------------------------------------------------------------------------|
  5788. * | tlv_filter_mask_in2 |
  5789. * |------------------------------------------------------------------------|
  5790. * | tlv_filter_mask_in3 |
  5791. * |-----------------+-----------------+---------------------+--------------|
  5792. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  5793. * |------------------------------------------------------------------------|
  5794. * | pcu_ppdu_setup_word_mask |
  5795. * |--------------------+--+--+--+-----+---------------------+--------------|
  5796. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  5797. * |------------------------------------------------------------------------|
  5798. *
  5799. * Where:
  5800. * PS = pkt_swap
  5801. * SS = status_swap
  5802. * The message is interpreted as follows:
  5803. * dword0 - b'0:7 - msg_type: This will be set to
  5804. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  5805. * b'8:15 - pdev_id:
  5806. * 0 (for rings at SOC level),
  5807. * 1/2/3 mac id (for rings at LMAC level)
  5808. * b'16:23 - ring_id : Identify the ring to configure.
  5809. * More details can be got from enum htt_srng_ring_id
  5810. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5811. * BUF_RING_CFG_0 defs within HW .h files,
  5812. * e.g. wmac_top_reg_seq_hwioreg.h
  5813. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5814. * BUF_RING_CFG_0 defs within HW .h files,
  5815. * e.g. wmac_top_reg_seq_hwioreg.h
  5816. * b'26:31 - rsvd1: reserved for future use
  5817. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5818. * in byte units.
  5819. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5820. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  5821. * 64, 128, 256.
  5822. * If all 3 bits are set config length is > 256.
  5823. * if val is '0', then ignore this field.
  5824. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  5825. * 64, 128, 256.
  5826. * If all 3 bits are set config length is > 256.
  5827. * if val is '0', then ignore this field.
  5828. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  5829. * 64, 128, 256.
  5830. * If all 3 bits are set config length is > 256.
  5831. * If val is '0', then ignore this field.
  5832. * - b'25:31 - rsvd2: Reserved for future use
  5833. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  5834. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  5835. * If packet_type_enable_flags is '1' for MGMT type,
  5836. * monitor will ignore this bit and allow this TLV.
  5837. * If packet_type_enable_flags is '0' for MGMT type,
  5838. * monitor will use this bit to enable/disable logging
  5839. * of this TLV.
  5840. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  5841. * If packet_type_enable_flags is '1' for CTRL type,
  5842. * monitor will ignore this bit and allow this TLV.
  5843. * If packet_type_enable_flags is '0' for CTRL type,
  5844. * monitor will use this bit to enable/disable logging
  5845. * of this TLV.
  5846. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  5847. * If packet_type_enable_flags is '1' for DATA type,
  5848. * monitor will ignore this bit and allow this TLV.
  5849. * If packet_type_enable_flags is '0' for DATA type,
  5850. * monitor will use this bit to enable/disable logging
  5851. * of this TLV.
  5852. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  5853. * If packet_type_enable_flags is '1' for MGMT type,
  5854. * monitor will ignore this bit and allow this TLV.
  5855. * If packet_type_enable_flags is '0' for MGMT type,
  5856. * monitor will use this bit to enable/disable logging
  5857. * of this TLV.
  5858. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  5859. * If packet_type_enable_flags is '1' for CTRL type,
  5860. * monitor will ignore this bit and allow this TLV.
  5861. * If packet_type_enable_flags is '0' for CTRL type,
  5862. * monitor will use this bit to enable/disable logging
  5863. * of this TLV.
  5864. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  5865. * If packet_type_enable_flags is '1' for DATA type,
  5866. * monitor will ignore this bit and allow this TLV.
  5867. * If packet_type_enable_flags is '0' for DATA type,
  5868. * monitor will use this bit to enable/disable logging
  5869. * of this TLV.
  5870. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  5871. * If packet_type_enable_flags is '1' for MGMT type,
  5872. * monitor will ignore this bit and allow this TLV.
  5873. * If packet_type_enable_flags is '0' for MGMT type,
  5874. * monitor will use this bit to enable/disable logging
  5875. * of this TLV.
  5876. * If filter_in_TX_MPDU_START = 1 it is recommended
  5877. * to set this bit.
  5878. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  5879. * If packet_type_enable_flags is '1' for CTRL type,
  5880. * monitor will ignore this bit and allow this TLV.
  5881. * If packet_type_enable_flags is '0' for CTRL type,
  5882. * monitor will use this bit to enable/disable logging
  5883. * of this TLV.
  5884. * If filter_in_TX_MPDU_START = 1 it is recommended
  5885. * to set this bit.
  5886. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  5887. * If packet_type_enable_flags is '1' for DATA type,
  5888. * monitor will ignore this bit and allow this TLV.
  5889. * If packet_type_enable_flags is '0' for DATA type,
  5890. * monitor will use this bit to enable/disable logging
  5891. * of this TLV.
  5892. * If filter_in_TX_MPDU_START = 1 it is recommended
  5893. * to set this bit.
  5894. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  5895. * If packet_type_enable_flags is '1' for MGMT type,
  5896. * monitor will ignore this bit and allow this TLV.
  5897. * If packet_type_enable_flags is '0' for MGMT type,
  5898. * monitor will use this bit to enable/disable logging
  5899. * of this TLV.
  5900. * If filter_in_TX_MSDU_START = 1 it is recommended
  5901. * to set this bit.
  5902. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  5903. * If packet_type_enable_flags is '1' for CTRL type,
  5904. * monitor will ignore this bit and allow this TLV.
  5905. * If packet_type_enable_flags is '0' for CTRL type,
  5906. * monitor will use this bit to enable/disable logging
  5907. * of this TLV.
  5908. * If filter_in_TX_MSDU_START = 1 it is recommended
  5909. * to set this bit.
  5910. * b'14 - filter_in_tx_msdu_end_data(MSED)
  5911. * If packet_type_enable_flags is '1' for DATA type,
  5912. * monitor will ignore this bit and allow this TLV.
  5913. * If packet_type_enable_flags is '0' for DATA type,
  5914. * monitor will use this bit to enable/disable logging
  5915. * of this TLV.
  5916. * If filter_in_TX_MSDU_START = 1 it is recommended
  5917. * to set this bit.
  5918. * b'15:31 - rsvd3: Reserved for future use
  5919. * dword3 - b'0:31 - tlv_filter_mask_in0:
  5920. * dword4 - b'0:31 - tlv_filter_mask_in1:
  5921. * dword5 - b'0:31 - tlv_filter_mask_in2:
  5922. * dword6 - b'0:31 - tlv_filter_mask_in3:
  5923. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  5924. * - b'8:15 - tx_peer_entry_word_mask:
  5925. * - b'16:23 - tx_queue_ext_word_mask:
  5926. * - b'24:31 - tx_msdu_start_word_mask:
  5927. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  5928. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  5929. * - b'8:15 - rxpcu_user_setup_word_mask:
  5930. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  5931. * MGMT, CTRL, DATA
  5932. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  5933. * 0 -> MSDU level logging is enabled
  5934. * (valid only if bit is set in
  5935. * pkt_type_enable_msdu_or_mpdu_logging)
  5936. * 1 -> MPDU level logging is enabled
  5937. * (valid only if bit is set in
  5938. * pkt_type_enable_msdu_or_mpdu_logging)
  5939. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  5940. * 0 -> MSDU level logging is enabled
  5941. * (valid only if bit is set in
  5942. * pkt_type_enable_msdu_or_mpdu_logging)
  5943. * 1 -> MPDU level logging is enabled
  5944. * (valid only if bit is set in
  5945. * pkt_type_enable_msdu_or_mpdu_logging)
  5946. * - b'21 - dma_mpdu_data(D) : For DATA
  5947. * 0 -> MSDU level logging is enabled
  5948. * (valid only if bit is set in
  5949. * pkt_type_enable_msdu_or_mpdu_logging)
  5950. * 1 -> MPDU level logging is enabled
  5951. * (valid only if bit is set in
  5952. * pkt_type_enable_msdu_or_mpdu_logging)
  5953. * - b'22:31 - rsvd4 for future use
  5954. */
  5955. PREPACK struct htt_tx_monitor_cfg_t {
  5956. A_UINT32 msg_type: 8,
  5957. pdev_id: 8,
  5958. ring_id: 8,
  5959. status_swap: 1,
  5960. pkt_swap: 1,
  5961. rsvd1: 6;
  5962. A_UINT32 ring_buffer_size: 16,
  5963. config_length_mgmt: 3,
  5964. config_length_ctrl: 3,
  5965. config_length_data: 3,
  5966. rsvd2: 7;
  5967. A_UINT32 pkt_type_enable_flags: 3,
  5968. filter_in_tx_mpdu_start_mgmt: 1,
  5969. filter_in_tx_mpdu_start_ctrl: 1,
  5970. filter_in_tx_mpdu_start_data: 1,
  5971. filter_in_tx_msdu_start_mgmt: 1,
  5972. filter_in_tx_msdu_start_ctrl: 1,
  5973. filter_in_tx_msdu_start_data: 1,
  5974. filter_in_tx_mpdu_end_mgmt: 1,
  5975. filter_in_tx_mpdu_end_ctrl: 1,
  5976. filter_in_tx_mpdu_end_data: 1,
  5977. filter_in_tx_msdu_end_mgmt: 1,
  5978. filter_in_tx_msdu_end_ctrl: 1,
  5979. filter_in_tx_msdu_end_data: 1,
  5980. rsvd3: 17;
  5981. A_UINT32 tlv_filter_mask_in0;
  5982. A_UINT32 tlv_filter_mask_in1;
  5983. A_UINT32 tlv_filter_mask_in2;
  5984. A_UINT32 tlv_filter_mask_in3;
  5985. A_UINT32 tx_fes_setup_word_mask: 8,
  5986. tx_peer_entry_word_mask: 8,
  5987. tx_queue_ext_word_mask: 8,
  5988. tx_msdu_start_word_mask: 8;
  5989. A_UINT32 pcu_ppdu_setup_word_mask;
  5990. A_UINT32 tx_mpdu_start_word_mask: 8,
  5991. rxpcu_user_setup_word_mask: 8,
  5992. pkt_type_enable_msdu_or_mpdu_logging: 3,
  5993. dma_mpdu_mgmt: 1,
  5994. dma_mpdu_ctrl: 1,
  5995. dma_mpdu_data: 1,
  5996. rsvd4: 10;
  5997. } POSTPACK;
  5998. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  5999. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6000. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6001. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6002. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6003. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6004. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6005. do { \
  6006. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6007. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6008. } while (0)
  6009. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6010. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6011. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6012. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6013. HTT_TX_MONITOR_CFG_RING_ID_S)
  6014. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6015. do { \
  6016. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6017. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6018. } while (0)
  6019. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6020. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6021. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6022. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6023. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6024. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6025. do { \
  6026. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6027. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6028. } while (0)
  6029. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6030. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6031. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6032. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6033. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6034. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6035. do { \
  6036. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6037. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6038. } while (0)
  6039. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6040. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6041. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6042. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6043. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6044. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6045. do { \
  6046. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6047. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6048. } while (0)
  6049. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6050. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6051. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6052. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6053. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6054. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6055. do { \
  6056. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6057. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6058. } while (0)
  6059. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6060. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6061. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6062. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6063. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6064. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6065. do { \
  6066. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6067. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6068. } while (0)
  6069. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6070. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6071. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6072. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6073. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6074. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6075. do { \
  6076. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6077. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6078. } while (0)
  6079. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6080. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6081. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6082. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6083. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6084. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6085. do { \
  6086. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6087. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6088. } while (0)
  6089. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6090. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6091. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6092. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6093. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6094. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6095. do { \
  6096. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6097. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6098. } while (0)
  6099. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6100. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6101. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6102. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6103. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6104. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6105. do { \
  6106. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6107. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6108. } while (0
  6109. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6110. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6111. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6112. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6113. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6114. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6115. do { \
  6116. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6117. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6118. } while (0)
  6119. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6120. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6121. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6122. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6123. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6124. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6125. do { \
  6126. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6127. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6128. } while (0)
  6129. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6130. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6131. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6132. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6133. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6134. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6135. do { \
  6136. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6137. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6138. } while (0
  6139. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6140. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6141. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6142. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6143. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6144. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6145. do { \
  6146. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6147. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6148. } while (0)
  6149. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6150. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6151. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6152. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6153. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6154. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6155. do { \
  6156. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6157. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6158. } while (0)
  6159. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6160. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6161. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6162. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6163. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6164. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6165. do { \
  6166. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6167. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6168. } while (0
  6169. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6170. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6171. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6172. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6173. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6174. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6175. do { \
  6176. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6177. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6178. } while (0)
  6179. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6180. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6181. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6182. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6183. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6184. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6185. do { \
  6186. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6187. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6188. } while (0)
  6189. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6190. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6191. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6192. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6193. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6194. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6195. do { \
  6196. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6197. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6198. } while (0
  6199. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6200. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6201. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6202. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6203. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6204. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6205. do { \
  6206. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6207. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6208. } while (0)
  6209. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6210. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6211. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6212. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6213. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6214. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6215. do { \
  6216. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6217. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6218. } while (0)
  6219. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6220. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6221. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6222. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6223. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6224. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6225. do { \
  6226. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6227. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6228. } while (0)
  6229. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6230. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6231. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6232. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6233. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6234. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6235. do { \
  6236. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6237. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6238. } while (0)
  6239. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6240. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6241. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6242. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6243. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6244. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6245. do { \
  6246. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6247. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6248. } while (0)
  6249. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6250. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6251. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6252. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6253. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6254. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6255. do { \
  6256. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6257. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6258. } while (0)
  6259. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6260. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6261. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6262. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6263. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6264. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6265. do { \
  6266. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6267. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6268. } while (0)
  6269. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6270. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6271. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6272. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6273. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6274. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6275. do { \
  6276. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6277. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6278. } while (0)
  6279. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6280. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6281. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6282. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6283. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6284. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6285. do { \
  6286. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6287. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6288. } while (0)
  6289. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6290. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6291. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6292. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6293. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6294. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6295. do { \
  6296. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6297. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6298. } while (0)
  6299. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6300. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6301. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6302. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6303. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6304. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6305. do { \
  6306. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6307. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6308. } while (0)
  6309. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6310. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6311. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6312. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6313. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6314. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6315. do { \
  6316. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6317. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6318. } while (0)
  6319. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6320. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6321. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6322. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6323. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6324. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6325. do { \
  6326. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6327. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6328. } while (0)
  6329. /*
  6330. * pkt_type_enable_flags
  6331. */
  6332. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6333. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6334. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6335. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6336. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6337. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6338. /*
  6339. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6340. */
  6341. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6342. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6343. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6344. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6345. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6346. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6347. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6348. do { \
  6349. HTT_CHECK_SET_VAL(httsym, value); \
  6350. (word) |= (value) << httsym##_S; \
  6351. } while (0)
  6352. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6353. (((word) & httsym##_M) >> httsym##_S)
  6354. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6355. * type -> MGMT, CTRL, DATA*/
  6356. #define htt_tx_ring_pkt_type_set( \
  6357. word, mode, type, val) \
  6358. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6359. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6360. #define htt_tx_ring_pkt_type_get( \
  6361. word, mode, type) \
  6362. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6363. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6364. /* Definition to filter in TLVs */
  6365. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6366. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6367. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6368. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6369. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6370. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6371. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6372. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6373. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6374. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6375. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6376. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6377. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6378. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6379. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6380. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6381. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6382. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6383. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6384. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6385. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6386. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6387. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6388. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6389. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6390. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6391. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6392. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6393. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6394. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6395. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6396. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6397. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6398. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6399. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6400. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6401. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6402. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6403. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6404. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6405. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6406. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6407. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6408. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6409. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6410. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6411. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6412. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6413. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6414. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6415. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6416. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6417. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6418. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6419. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6420. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6421. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6422. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6423. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6424. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6425. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6426. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6427. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6428. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6429. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6430. do { \
  6431. HTT_CHECK_SET_VAL(httsym, enable); \
  6432. (word) |= (enable) << httsym##_S; \
  6433. } while (0)
  6434. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6435. (((word) & httsym##_M) >> httsym##_S)
  6436. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6437. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6438. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6439. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6440. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6441. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6442. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6443. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6444. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6445. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6446. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6447. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6448. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6449. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6450. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6451. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6452. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6453. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6454. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6455. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6456. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6457. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6458. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6459. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6460. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6461. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6462. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6463. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6464. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6465. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6466. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6467. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6468. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6469. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6470. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6471. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6472. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6473. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6474. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6475. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6476. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6477. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6478. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6479. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6480. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6481. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6482. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6483. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6484. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6485. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6486. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6487. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6488. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6489. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6490. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6491. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6492. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6493. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6494. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6495. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6496. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6497. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6498. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6499. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6500. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6501. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6502. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6503. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6504. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6505. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6506. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6507. do { \
  6508. HTT_CHECK_SET_VAL(httsym, enable); \
  6509. (word) |= (enable) << httsym##_S; \
  6510. } while (0)
  6511. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6512. (((word) & httsym##_M) >> httsym##_S)
  6513. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6514. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6515. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6516. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6517. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6518. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6519. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6520. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6521. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6522. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6523. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6524. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6525. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6526. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6527. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6528. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6529. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6530. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6531. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6532. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6533. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6534. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6535. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6536. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6537. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6538. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6539. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6540. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6541. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6542. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6543. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6544. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6545. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6546. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6547. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6548. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6549. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6550. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6551. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6552. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6553. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6554. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6555. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6556. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6557. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6558. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6559. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6560. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6561. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6562. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6563. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6564. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6565. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6566. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6567. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6568. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6569. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6570. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6571. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6572. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6573. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6574. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6575. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6576. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6577. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6578. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6579. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6580. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6581. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6582. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6583. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6584. do { \
  6585. HTT_CHECK_SET_VAL(httsym, enable); \
  6586. (word) |= (enable) << httsym##_S; \
  6587. } while (0)
  6588. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6589. (((word) & httsym##_M) >> httsym##_S)
  6590. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6591. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6592. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6593. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6594. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6595. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6596. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6597. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6598. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6599. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6600. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6601. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6602. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6603. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6604. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6605. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6606. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6607. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6608. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6609. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6610. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6611. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6612. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6613. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6614. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6615. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6616. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6617. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6618. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6619. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6620. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6621. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6622. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6623. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6624. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6625. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6626. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6627. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6628. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6629. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6630. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6631. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  6632. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  6633. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  6634. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  6635. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  6636. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  6637. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  6638. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  6639. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  6640. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  6641. do { \
  6642. HTT_CHECK_SET_VAL(httsym, enable); \
  6643. (word) |= (enable) << httsym##_S; \
  6644. } while (0)
  6645. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  6646. (((word) & httsym##_M) >> httsym##_S)
  6647. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  6648. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  6649. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  6650. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  6651. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  6652. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  6653. /**
  6654. * @brief host --> target Receive Flow Steering configuration message definition
  6655. *
  6656. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  6657. *
  6658. * host --> target Receive Flow Steering configuration message definition.
  6659. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6660. * The reason for this is we want RFS to be configured and ready before MAC
  6661. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6662. *
  6663. * |31 24|23 16|15 9|8|7 0|
  6664. * |----------------+----------------+----------------+----------------|
  6665. * | reserved |E| msg type |
  6666. * |-------------------------------------------------------------------|
  6667. * Where E = RFS enable flag
  6668. *
  6669. * The RFS_CONFIG message consists of a single 4-byte word.
  6670. *
  6671. * Header fields:
  6672. * - MSG_TYPE
  6673. * Bits 7:0
  6674. * Purpose: identifies this as a RFS config msg
  6675. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  6676. * - RFS_CONFIG
  6677. * Bit 8
  6678. * Purpose: Tells target whether to enable (1) or disable (0)
  6679. * flow steering feature when sending rx indication messages to host
  6680. */
  6681. #define HTT_H2T_RFS_CONFIG_M 0x100
  6682. #define HTT_H2T_RFS_CONFIG_S 8
  6683. #define HTT_RX_RFS_CONFIG_GET(_var) \
  6684. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  6685. HTT_H2T_RFS_CONFIG_S)
  6686. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  6687. do { \
  6688. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  6689. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  6690. } while (0)
  6691. #define HTT_RFS_CFG_REQ_BYTES 4
  6692. /**
  6693. * @brief host -> target FW extended statistics retrieve
  6694. *
  6695. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  6696. *
  6697. * @details
  6698. * The following field definitions describe the format of the HTT host
  6699. * to target FW extended stats retrieve message.
  6700. * The message specifies the type of stats the host wants to retrieve.
  6701. *
  6702. * |31 24|23 16|15 8|7 0|
  6703. * |-----------------------------------------------------------|
  6704. * | reserved | stats type | pdev_mask | msg type |
  6705. * |-----------------------------------------------------------|
  6706. * | config param [0] |
  6707. * |-----------------------------------------------------------|
  6708. * | config param [1] |
  6709. * |-----------------------------------------------------------|
  6710. * | config param [2] |
  6711. * |-----------------------------------------------------------|
  6712. * | config param [3] |
  6713. * |-----------------------------------------------------------|
  6714. * | reserved |
  6715. * |-----------------------------------------------------------|
  6716. * | cookie LSBs |
  6717. * |-----------------------------------------------------------|
  6718. * | cookie MSBs |
  6719. * |-----------------------------------------------------------|
  6720. * Header fields:
  6721. * - MSG_TYPE
  6722. * Bits 7:0
  6723. * Purpose: identifies this is a extended stats upload request message
  6724. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  6725. * - PDEV_MASK
  6726. * Bits 8:15
  6727. * Purpose: identifies the mask of PDEVs to retrieve stats from
  6728. * Value: This is a overloaded field, refer to usage and interpretation of
  6729. * PDEV in interface document.
  6730. * Bit 8 : Reserved for SOC stats
  6731. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6732. * Indicates MACID_MASK in DBS
  6733. * - STATS_TYPE
  6734. * Bits 23:16
  6735. * Purpose: identifies which FW statistics to upload
  6736. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  6737. * - Reserved
  6738. * Bits 31:24
  6739. * - CONFIG_PARAM [0]
  6740. * Bits 31:0
  6741. * Purpose: give an opaque configuration value to the specified stats type
  6742. * Value: stats-type specific configuration value
  6743. * Refer to htt_stats.h for interpretation for each stats sub_type
  6744. * - CONFIG_PARAM [1]
  6745. * Bits 31:0
  6746. * Purpose: give an opaque configuration value to the specified stats type
  6747. * Value: stats-type specific configuration value
  6748. * Refer to htt_stats.h for interpretation for each stats sub_type
  6749. * - CONFIG_PARAM [2]
  6750. * Bits 31:0
  6751. * Purpose: give an opaque configuration value to the specified stats type
  6752. * Value: stats-type specific configuration value
  6753. * Refer to htt_stats.h for interpretation for each stats sub_type
  6754. * - CONFIG_PARAM [3]
  6755. * Bits 31:0
  6756. * Purpose: give an opaque configuration value to the specified stats type
  6757. * Value: stats-type specific configuration value
  6758. * Refer to htt_stats.h for interpretation for each stats sub_type
  6759. * - Reserved [31:0] for future use.
  6760. * - COOKIE_LSBS
  6761. * Bits 31:0
  6762. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6763. * message with its preceding host->target stats request message.
  6764. * Value: LSBs of the opaque cookie specified by the host-side requestor
  6765. * - COOKIE_MSBS
  6766. * Bits 31:0
  6767. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6768. * message with its preceding host->target stats request message.
  6769. * Value: MSBs of the opaque cookie specified by the host-side requestor
  6770. */
  6771. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  6772. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  6773. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  6774. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  6775. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  6776. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  6777. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  6778. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  6779. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  6780. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  6781. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  6782. do { \
  6783. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  6784. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  6785. } while (0)
  6786. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  6787. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  6788. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  6789. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  6790. do { \
  6791. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  6792. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  6793. } while (0)
  6794. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  6795. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  6796. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  6797. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  6798. do { \
  6799. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  6800. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  6801. } while (0)
  6802. /**
  6803. * @brief host -> target FW PPDU_STATS request message
  6804. *
  6805. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  6806. *
  6807. * @details
  6808. * The following field definitions describe the format of the HTT host
  6809. * to target FW for PPDU_STATS_CFG msg.
  6810. * The message allows the host to configure the PPDU_STATS_IND messages
  6811. * produced by the target.
  6812. *
  6813. * |31 24|23 16|15 8|7 0|
  6814. * |-----------------------------------------------------------|
  6815. * | REQ bit mask | pdev_mask | msg type |
  6816. * |-----------------------------------------------------------|
  6817. * Header fields:
  6818. * - MSG_TYPE
  6819. * Bits 7:0
  6820. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  6821. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  6822. * - PDEV_MASK
  6823. * Bits 8:15
  6824. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  6825. * Value: This is a overloaded field, refer to usage and interpretation of
  6826. * PDEV in interface document.
  6827. * Bit 8 : Reserved for SOC stats
  6828. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6829. * Indicates MACID_MASK in DBS
  6830. * - REQ_TLV_BIT_MASK
  6831. * Bits 16:31
  6832. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  6833. * needs to be included in the target's PPDU_STATS_IND messages.
  6834. * Value: refer htt_ppdu_stats_tlv_tag_t
  6835. *
  6836. */
  6837. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  6838. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  6839. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  6840. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  6841. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  6842. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  6843. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  6844. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  6845. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  6846. do { \
  6847. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  6848. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  6849. } while (0)
  6850. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  6851. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  6852. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  6853. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  6854. do { \
  6855. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  6856. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  6857. } while (0)
  6858. /**
  6859. * @brief Host-->target HTT RX FSE setup message
  6860. *
  6861. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  6862. *
  6863. * @details
  6864. * Through this message, the host will provide details of the flow tables
  6865. * in host DDR along with hash keys.
  6866. * This message can be sent per SOC or per PDEV, which is differentiated
  6867. * by pdev id values.
  6868. * The host will allocate flow search table and sends table size,
  6869. * physical DMA address of flow table, and hash keys to firmware to
  6870. * program into the RXOLE FSE HW block.
  6871. *
  6872. * The following field definitions describe the format of the RX FSE setup
  6873. * message sent from the host to target
  6874. *
  6875. * Header fields:
  6876. * dword0 - b'7:0 - msg_type: This will be set to
  6877. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  6878. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6879. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6880. * pdev's LMAC ring.
  6881. * b'31:16 - reserved : Reserved for future use
  6882. * dword1 - b'19:0 - number of records: This field indicates the number of
  6883. * entries in the flow table. For example: 8k number of
  6884. * records is equivalent to
  6885. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  6886. * b'27:20 - max search: This field specifies the skid length to FSE
  6887. * parser HW module whenever match is not found at the
  6888. * exact index pointed by hash.
  6889. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  6890. * Refer htt_ip_da_sa_prefix below for more details.
  6891. * b'31:30 - reserved: Reserved for future use
  6892. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  6893. * table allocated by host in DDR
  6894. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  6895. * table allocated by host in DDR
  6896. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  6897. * entry hashing
  6898. *
  6899. *
  6900. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  6901. * |---------------------------------------------------------------|
  6902. * | reserved | pdev_id | MSG_TYPE |
  6903. * |---------------------------------------------------------------|
  6904. * |resvd|IPDSA| max_search | Number of records |
  6905. * |---------------------------------------------------------------|
  6906. * | base address lo |
  6907. * |---------------------------------------------------------------|
  6908. * | base address high |
  6909. * |---------------------------------------------------------------|
  6910. * | toeplitz key 31_0 |
  6911. * |---------------------------------------------------------------|
  6912. * | toeplitz key 63_32 |
  6913. * |---------------------------------------------------------------|
  6914. * | toeplitz key 95_64 |
  6915. * |---------------------------------------------------------------|
  6916. * | toeplitz key 127_96 |
  6917. * |---------------------------------------------------------------|
  6918. * | toeplitz key 159_128 |
  6919. * |---------------------------------------------------------------|
  6920. * | toeplitz key 191_160 |
  6921. * |---------------------------------------------------------------|
  6922. * | toeplitz key 223_192 |
  6923. * |---------------------------------------------------------------|
  6924. * | toeplitz key 255_224 |
  6925. * |---------------------------------------------------------------|
  6926. * | toeplitz key 287_256 |
  6927. * |---------------------------------------------------------------|
  6928. * | reserved | toeplitz key 314_288(26:0 bits) |
  6929. * |---------------------------------------------------------------|
  6930. * where:
  6931. * IPDSA = ip_da_sa
  6932. */
  6933. /**
  6934. * @brief: htt_ip_da_sa_prefix
  6935. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  6936. * IPv6 addresses beginning with 0x20010db8 are reserved for
  6937. * documentation per RFC3849
  6938. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  6939. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  6940. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  6941. */
  6942. enum htt_ip_da_sa_prefix {
  6943. HTT_RX_IPV6_20010db8,
  6944. HTT_RX_IPV4_MAPPED_IPV6,
  6945. HTT_RX_IPV4_COMPATIBLE_IPV6,
  6946. HTT_RX_IPV6_64FF9B,
  6947. };
  6948. /**
  6949. * @brief Host-->target HTT RX FISA configure and enable
  6950. *
  6951. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  6952. *
  6953. * @details
  6954. * The host will send this command down to configure and enable the FISA
  6955. * operational params.
  6956. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  6957. * register.
  6958. * Should configure both the MACs.
  6959. *
  6960. * dword0 - b'7:0 - msg_type:
  6961. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  6962. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6963. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6964. * pdev's LMAC ring.
  6965. * b'31:16 - reserved : Reserved for future use
  6966. *
  6967. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  6968. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  6969. * packets. 1 flow search will be skipped
  6970. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  6971. * tcp,udp packets
  6972. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  6973. * calculation
  6974. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  6975. * calculation
  6976. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  6977. * calculation
  6978. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  6979. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  6980. * length
  6981. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  6982. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  6983. * length
  6984. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  6985. * num jump
  6986. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  6987. * num jump
  6988. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  6989. * data type switch has happend for MPDU Sequence num jump
  6990. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  6991. * for MPDU Sequence num jump
  6992. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  6993. * for decrypt errors
  6994. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  6995. * while aggregating a msdu
  6996. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  6997. * The aggregation is done until (number of MSDUs aggregated
  6998. * < LIMIT + 1)
  6999. * b'31:18 - Reserved
  7000. *
  7001. * fisa_control_value - 32bit value FW can write to register
  7002. *
  7003. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7004. * Threshold value for FISA timeout (units are microseconds).
  7005. * When the global timestamp exceeds this threshold, FISA
  7006. * aggregation will be restarted.
  7007. * A value of 0 means timeout is disabled.
  7008. * Compare the threshold register with timestamp field in
  7009. * flow entry to generate timeout for the flow.
  7010. *
  7011. * |31 18 |17 16|15 8|7 0|
  7012. * |-------------------------------------------------------------|
  7013. * | reserved | pdev_mask | msg type |
  7014. * |-------------------------------------------------------------|
  7015. * | reserved | FISA_CTRL |
  7016. * |-------------------------------------------------------------|
  7017. * | FISA_TIMEOUT_THRESH |
  7018. * |-------------------------------------------------------------|
  7019. */
  7020. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7021. A_UINT32 msg_type:8,
  7022. pdev_id:8,
  7023. reserved0:16;
  7024. /**
  7025. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7026. * [17:0]
  7027. */
  7028. union {
  7029. /*
  7030. * fisa_control_bits structure is deprecated.
  7031. * Please use fisa_control_bits_v2 going forward.
  7032. */
  7033. struct {
  7034. A_UINT32 fisa_enable: 1,
  7035. ipsec_skip_search: 1,
  7036. nontcp_skip_search: 1,
  7037. add_ipv4_fixed_hdr_len: 1,
  7038. add_ipv6_fixed_hdr_len: 1,
  7039. add_tcp_fixed_hdr_len: 1,
  7040. add_udp_hdr_len: 1,
  7041. chksum_cum_ip_len_en: 1,
  7042. disable_tid_check: 1,
  7043. disable_ta_check: 1,
  7044. disable_qos_check: 1,
  7045. disable_raw_check: 1,
  7046. disable_decrypt_err_check: 1,
  7047. disable_msdu_drop_check: 1,
  7048. fisa_aggr_limit: 4,
  7049. reserved: 14;
  7050. } fisa_control_bits;
  7051. struct {
  7052. A_UINT32 fisa_enable: 1,
  7053. fisa_aggr_limit: 4,
  7054. reserved: 27;
  7055. } fisa_control_bits_v2;
  7056. A_UINT32 fisa_control_value;
  7057. } u_fisa_control;
  7058. /**
  7059. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7060. * timeout threshold for aggregation. Unit in usec.
  7061. * [31:0]
  7062. */
  7063. A_UINT32 fisa_timeout_threshold;
  7064. } POSTPACK;
  7065. /* DWord 0: pdev-ID */
  7066. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7067. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7068. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7069. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7070. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7071. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7072. do { \
  7073. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7074. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7075. } while (0)
  7076. /* Dword 1: fisa_control_value fisa config */
  7077. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7078. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7079. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7080. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7081. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7082. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7083. do { \
  7084. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7085. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7086. } while (0)
  7087. /* Dword 1: fisa_control_value ipsec_skip_search */
  7088. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7089. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7090. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7091. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7092. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7093. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7094. do { \
  7095. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7096. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7097. } while (0)
  7098. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7099. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7100. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7101. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7102. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7103. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7104. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7105. do { \
  7106. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7107. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7108. } while (0)
  7109. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7110. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7111. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7112. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7113. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7114. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7115. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7116. do { \
  7117. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7118. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7119. } while (0)
  7120. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7121. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7122. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7123. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7124. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7125. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7126. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7127. do { \
  7128. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7129. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7130. } while (0)
  7131. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7132. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7133. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7134. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7135. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7136. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7137. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7138. do { \
  7139. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7140. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7141. } while (0)
  7142. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7143. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7144. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7145. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7146. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7147. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7148. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7149. do { \
  7150. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7151. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7152. } while (0)
  7153. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7154. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7155. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7156. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7157. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7158. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7159. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7160. do { \
  7161. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7162. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7163. } while (0)
  7164. /* Dword 1: fisa_control_value disable_tid_check */
  7165. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7166. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7167. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7168. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7169. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7170. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7171. do { \
  7172. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7173. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7174. } while (0)
  7175. /* Dword 1: fisa_control_value disable_ta_check */
  7176. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7177. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7178. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7179. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7180. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7181. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7182. do { \
  7183. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7184. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7185. } while (0)
  7186. /* Dword 1: fisa_control_value disable_qos_check */
  7187. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7188. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7189. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7190. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7191. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7192. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7193. do { \
  7194. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7195. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7196. } while (0)
  7197. /* Dword 1: fisa_control_value disable_raw_check */
  7198. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7199. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7200. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7201. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7202. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7203. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7204. do { \
  7205. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7206. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7207. } while (0)
  7208. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7209. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7210. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7211. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7212. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7213. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7214. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7215. do { \
  7216. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7217. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7218. } while (0)
  7219. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7220. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7221. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7222. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7223. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7224. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7225. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7226. do { \
  7227. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7228. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7229. } while (0)
  7230. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7231. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7232. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7233. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7234. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7235. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7236. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7237. do { \
  7238. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7239. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7240. } while (0)
  7241. /* Dword 1: fisa_control_value fisa config */
  7242. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7243. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7244. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7245. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7246. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7247. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7248. do { \
  7249. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7250. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7251. } while (0)
  7252. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7253. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7254. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7255. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7256. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7257. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7258. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7259. do { \
  7260. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7261. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7262. } while (0)
  7263. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7264. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7265. pdev_id:8,
  7266. reserved0:16;
  7267. A_UINT32 num_records:20,
  7268. max_search:8,
  7269. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7270. reserved1:2;
  7271. A_UINT32 base_addr_lo;
  7272. A_UINT32 base_addr_hi;
  7273. A_UINT32 toeplitz31_0;
  7274. A_UINT32 toeplitz63_32;
  7275. A_UINT32 toeplitz95_64;
  7276. A_UINT32 toeplitz127_96;
  7277. A_UINT32 toeplitz159_128;
  7278. A_UINT32 toeplitz191_160;
  7279. A_UINT32 toeplitz223_192;
  7280. A_UINT32 toeplitz255_224;
  7281. A_UINT32 toeplitz287_256;
  7282. A_UINT32 toeplitz314_288:27,
  7283. reserved2:5;
  7284. } POSTPACK;
  7285. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7286. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7287. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7288. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7289. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7290. /* DWORD 0: Pdev ID */
  7291. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7292. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7293. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7294. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7295. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7296. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7297. do { \
  7298. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7299. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7300. } while (0)
  7301. /* DWORD 1:num of records */
  7302. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7303. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7304. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7305. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7306. HTT_RX_FSE_SETUP_NUM_REC_S)
  7307. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7308. do { \
  7309. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7310. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7311. } while (0)
  7312. /* DWORD 1:max_search */
  7313. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7314. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7315. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7316. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7317. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7318. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7319. do { \
  7320. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7321. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7322. } while (0)
  7323. /* DWORD 1:ip_da_sa prefix */
  7324. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7325. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7326. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7327. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7328. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7329. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7330. do { \
  7331. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7332. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7333. } while (0)
  7334. /* DWORD 2: Base Address LO */
  7335. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7336. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7337. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7338. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7339. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7340. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7341. do { \
  7342. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7343. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7344. } while (0)
  7345. /* DWORD 3: Base Address High */
  7346. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7347. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7348. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7349. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7350. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7351. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7352. do { \
  7353. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7354. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7355. } while (0)
  7356. /* DWORD 4-12: Hash Value */
  7357. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7358. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7359. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7360. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7361. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7362. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7363. do { \
  7364. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7365. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7366. } while (0)
  7367. /* DWORD 13: Hash Value 314:288 bits */
  7368. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7369. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7370. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7371. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7372. do { \
  7373. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7374. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7375. } while (0)
  7376. /**
  7377. * @brief Host-->target HTT RX FSE operation message
  7378. *
  7379. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7380. *
  7381. * @details
  7382. * The host will send this Flow Search Engine (FSE) operation message for
  7383. * every flow add/delete operation.
  7384. * The FSE operation includes FSE full cache invalidation or individual entry
  7385. * invalidation.
  7386. * This message can be sent per SOC or per PDEV which is differentiated
  7387. * by pdev id values.
  7388. *
  7389. * |31 16|15 8|7 1|0|
  7390. * |-------------------------------------------------------------|
  7391. * | reserved | pdev_id | MSG_TYPE |
  7392. * |-------------------------------------------------------------|
  7393. * | reserved | operation |I|
  7394. * |-------------------------------------------------------------|
  7395. * | ip_src_addr_31_0 |
  7396. * |-------------------------------------------------------------|
  7397. * | ip_src_addr_63_32 |
  7398. * |-------------------------------------------------------------|
  7399. * | ip_src_addr_95_64 |
  7400. * |-------------------------------------------------------------|
  7401. * | ip_src_addr_127_96 |
  7402. * |-------------------------------------------------------------|
  7403. * | ip_dst_addr_31_0 |
  7404. * |-------------------------------------------------------------|
  7405. * | ip_dst_addr_63_32 |
  7406. * |-------------------------------------------------------------|
  7407. * | ip_dst_addr_95_64 |
  7408. * |-------------------------------------------------------------|
  7409. * | ip_dst_addr_127_96 |
  7410. * |-------------------------------------------------------------|
  7411. * | l4_dst_port | l4_src_port |
  7412. * | (32-bit SPI incase of IPsec) |
  7413. * |-------------------------------------------------------------|
  7414. * | reserved | l4_proto |
  7415. * |-------------------------------------------------------------|
  7416. *
  7417. * where I is 1-bit ipsec_valid.
  7418. *
  7419. * The following field definitions describe the format of the RX FSE operation
  7420. * message sent from the host to target for every add/delete flow entry to flow
  7421. * table.
  7422. *
  7423. * Header fields:
  7424. * dword0 - b'7:0 - msg_type: This will be set to
  7425. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7426. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7427. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7428. * specified pdev's LMAC ring.
  7429. * b'31:16 - reserved : Reserved for future use
  7430. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7431. * (Internet Protocol Security).
  7432. * IPsec describes the framework for providing security at
  7433. * IP layer. IPsec is defined for both versions of IP:
  7434. * IPV4 and IPV6.
  7435. * Please refer to htt_rx_flow_proto enumeration below for
  7436. * more info.
  7437. * ipsec_valid = 1 for IPSEC packets
  7438. * ipsec_valid = 0 for IP Packets
  7439. * b'7:1 - operation: This indicates types of FSE operation.
  7440. * Refer to htt_rx_fse_operation enumeration:
  7441. * 0 - No Cache Invalidation required
  7442. * 1 - Cache invalidate only one entry given by IP
  7443. * src/dest address at DWORD[2:9]
  7444. * 2 - Complete FSE Cache Invalidation
  7445. * 3 - FSE Disable
  7446. * 4 - FSE Enable
  7447. * b'31:8 - reserved: Reserved for future use
  7448. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7449. * for per flow addition/deletion
  7450. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7451. * and the subsequent 3 A_UINT32 will be padding bytes.
  7452. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7453. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7454. * from 0 to 65535 but only 0 to 1023 are designated as
  7455. * well-known ports. Refer to [RFC1700] for more details.
  7456. * This field is valid only if
  7457. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7458. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7459. * range from 0 to 65535 but only 0 to 1023 are designated
  7460. * as well-known ports. Refer to [RFC1700] for more details.
  7461. * This field is valid only if
  7462. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7463. * - SPI (31:0): Security Parameters Index is an
  7464. * identification tag added to the header while using IPsec
  7465. * for tunneling the IP traffici.
  7466. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7467. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7468. * Assigned Internet Protocol Numbers.
  7469. * l4_proto numbers for standard protocol like UDP/TCP
  7470. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7471. * l4_proto = 17 for UDP etc.
  7472. * b'31:8 - reserved: Reserved for future use.
  7473. *
  7474. */
  7475. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7476. A_UINT32 msg_type:8,
  7477. pdev_id:8,
  7478. reserved0:16;
  7479. A_UINT32 ipsec_valid:1,
  7480. operation:7,
  7481. reserved1:24;
  7482. A_UINT32 ip_src_addr_31_0;
  7483. A_UINT32 ip_src_addr_63_32;
  7484. A_UINT32 ip_src_addr_95_64;
  7485. A_UINT32 ip_src_addr_127_96;
  7486. A_UINT32 ip_dest_addr_31_0;
  7487. A_UINT32 ip_dest_addr_63_32;
  7488. A_UINT32 ip_dest_addr_95_64;
  7489. A_UINT32 ip_dest_addr_127_96;
  7490. union {
  7491. A_UINT32 spi;
  7492. struct {
  7493. A_UINT32 l4_src_port:16,
  7494. l4_dest_port:16;
  7495. } ip;
  7496. } u;
  7497. A_UINT32 l4_proto:8,
  7498. reserved:24;
  7499. } POSTPACK;
  7500. /**
  7501. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7502. *
  7503. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7504. *
  7505. * @details
  7506. * The host will send this Full monitor mode register configuration message.
  7507. * This message can be sent per SOC or per PDEV which is differentiated
  7508. * by pdev id values.
  7509. *
  7510. * |31 16|15 11|10 8|7 3|2|1|0|
  7511. * |-------------------------------------------------------------|
  7512. * | reserved | pdev_id | MSG_TYPE |
  7513. * |-------------------------------------------------------------|
  7514. * | reserved |Release Ring |N|Z|E|
  7515. * |-------------------------------------------------------------|
  7516. *
  7517. * where E is 1-bit full monitor mode enable/disable.
  7518. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7519. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7520. *
  7521. * The following field definitions describe the format of the full monitor
  7522. * mode configuration message sent from the host to target for each pdev.
  7523. *
  7524. * Header fields:
  7525. * dword0 - b'7:0 - msg_type: This will be set to
  7526. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7527. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7528. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7529. * specified pdev's LMAC ring.
  7530. * b'31:16 - reserved : Reserved for future use.
  7531. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7532. * monitor mode rxdma register is to be enabled or disabled.
  7533. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7534. * additional descriptors at ppdu end for zero mpdus
  7535. * enabled or disabled.
  7536. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7537. * additional descriptors at ppdu end for non zero mpdus
  7538. * enabled or disabled.
  7539. * b'10:3 - release_ring: This indicates the destination ring
  7540. * selection for the descriptor at the end of PPDU
  7541. * 0 - REO ring select
  7542. * 1 - FW ring select
  7543. * 2 - SW ring select
  7544. * 3 - Release ring select
  7545. * Refer to htt_rx_full_mon_release_ring.
  7546. * b'31:11 - reserved for future use
  7547. */
  7548. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  7549. A_UINT32 msg_type:8,
  7550. pdev_id:8,
  7551. reserved0:16;
  7552. A_UINT32 full_monitor_mode_enable:1,
  7553. addnl_descs_zero_mpdus_end:1,
  7554. addnl_descs_non_zero_mpdus_end:1,
  7555. release_ring:8,
  7556. reserved1:21;
  7557. } POSTPACK;
  7558. /**
  7559. * Enumeration for full monitor mode destination ring select
  7560. * 0 - REO destination ring select
  7561. * 1 - FW destination ring select
  7562. * 2 - SW destination ring select
  7563. * 3 - Release destination ring select
  7564. */
  7565. enum htt_rx_full_mon_release_ring {
  7566. HTT_RX_MON_RING_REO,
  7567. HTT_RX_MON_RING_FW,
  7568. HTT_RX_MON_RING_SW,
  7569. HTT_RX_MON_RING_RELEASE,
  7570. };
  7571. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  7572. /* DWORD 0: Pdev ID */
  7573. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  7574. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  7575. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  7576. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  7577. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  7578. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  7579. do { \
  7580. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  7581. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  7582. } while (0)
  7583. /* DWORD 1:ENABLE */
  7584. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  7585. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  7586. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  7587. do { \
  7588. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  7589. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  7590. } while (0)
  7591. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  7592. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  7593. /* DWORD 1:ZERO_MPDU */
  7594. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  7595. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  7596. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  7597. do { \
  7598. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  7599. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  7600. } while (0)
  7601. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  7602. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  7603. /* DWORD 1:NON_ZERO_MPDU */
  7604. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  7605. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  7606. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  7607. do { \
  7608. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  7609. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  7610. } while (0)
  7611. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  7612. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  7613. /* DWORD 1:RELEASE_RINGS */
  7614. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  7615. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  7616. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  7617. do { \
  7618. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  7619. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  7620. } while (0)
  7621. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  7622. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  7623. /**
  7624. * Enumeration for IP Protocol or IPSEC Protocol
  7625. * IPsec describes the framework for providing security at IP layer.
  7626. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  7627. */
  7628. enum htt_rx_flow_proto {
  7629. HTT_RX_FLOW_IP_PROTO,
  7630. HTT_RX_FLOW_IPSEC_PROTO,
  7631. };
  7632. /**
  7633. * Enumeration for FSE Cache Invalidation
  7634. * 0 - No Cache Invalidation required
  7635. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  7636. * 2 - Complete FSE Cache Invalidation
  7637. * 3 - FSE Disable
  7638. * 4 - FSE Enable
  7639. */
  7640. enum htt_rx_fse_operation {
  7641. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  7642. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  7643. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  7644. HTT_RX_FSE_DISABLE,
  7645. HTT_RX_FSE_ENABLE,
  7646. };
  7647. /* DWORD 0: Pdev ID */
  7648. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  7649. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  7650. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  7651. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  7652. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  7653. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  7654. do { \
  7655. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  7656. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  7657. } while (0)
  7658. /* DWORD 1:IP PROTO or IPSEC */
  7659. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  7660. #define HTT_RX_FSE_IPSEC_VALID_S 0
  7661. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  7662. do { \
  7663. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  7664. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  7665. } while (0)
  7666. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  7667. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  7668. /* DWORD 1:FSE Operation */
  7669. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  7670. #define HTT_RX_FSE_OPERATION_S 1
  7671. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  7672. do { \
  7673. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  7674. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  7675. } while (0)
  7676. #define HTT_RX_FSE_OPERATION_GET(word) \
  7677. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  7678. /* DWORD 2-9:IP Address */
  7679. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  7680. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  7681. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  7682. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  7683. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  7684. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  7685. do { \
  7686. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  7687. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  7688. } while (0)
  7689. /* DWORD 10:Source Port Number */
  7690. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  7691. #define HTT_RX_FSE_SOURCEPORT_S 0
  7692. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  7693. do { \
  7694. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  7695. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  7696. } while (0)
  7697. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  7698. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  7699. /* DWORD 11:Destination Port Number */
  7700. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  7701. #define HTT_RX_FSE_DESTPORT_S 16
  7702. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  7703. do { \
  7704. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  7705. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  7706. } while (0)
  7707. #define HTT_RX_FSE_DESTPORT_GET(word) \
  7708. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  7709. /* DWORD 10-11:SPI (In case of IPSEC) */
  7710. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  7711. #define HTT_RX_FSE_OPERATION_SPI_S 0
  7712. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  7713. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  7714. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  7715. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  7716. do { \
  7717. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  7718. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  7719. } while (0)
  7720. /* DWORD 12:L4 PROTO */
  7721. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  7722. #define HTT_RX_FSE_L4_PROTO_S 0
  7723. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  7724. do { \
  7725. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  7726. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  7727. } while (0)
  7728. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  7729. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  7730. /**
  7731. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  7732. *
  7733. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  7734. *
  7735. * |31 24|23 |15 8|7 2|1|0|
  7736. * |----------------+----------------+----------------+----------------|
  7737. * | reserved | pdev_id | msg_type |
  7738. * |---------------------------------+----------------+----------------|
  7739. * | reserved |E|F|
  7740. * |---------------------------------+----------------+----------------|
  7741. * Where E = Configure the target to provide the 3-tuple hash value in
  7742. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  7743. * F = Configure the target to provide the 3-tuple hash value in
  7744. * flow_id_toeplitz field of rx_msdu_start tlv
  7745. *
  7746. * The following field definitions describe the format of the 3 tuple hash value
  7747. * message sent from the host to target as part of initialization sequence.
  7748. *
  7749. * Header fields:
  7750. * dword0 - b'7:0 - msg_type: This will be set to
  7751. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  7752. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7753. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7754. * specified pdev's LMAC ring.
  7755. * b'31:16 - reserved : Reserved for future use
  7756. * dword1 - b'0 - flow_id_toeplitz_field_enable
  7757. * b'1 - toeplitz_hash_2_or_4_field_enable
  7758. * b'31:2 - reserved : Reserved for future use
  7759. * ---------+------+----------------------------------------------------------
  7760. * bit1 | bit0 | Functionality
  7761. * ---------+------+----------------------------------------------------------
  7762. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  7763. * | | in flow_id_toeplitz field
  7764. * ---------+------+----------------------------------------------------------
  7765. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  7766. * | | in toeplitz_hash_2_or_4 field
  7767. * ---------+------+----------------------------------------------------------
  7768. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  7769. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  7770. * ---------+------+----------------------------------------------------------
  7771. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  7772. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  7773. * | | toeplitz_hash_2_or_4 field
  7774. *----------------------------------------------------------------------------
  7775. */
  7776. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  7777. A_UINT32 msg_type :8,
  7778. pdev_id :8,
  7779. reserved0 :16;
  7780. A_UINT32 flow_id_toeplitz_field_enable :1,
  7781. toeplitz_hash_2_or_4_field_enable :1,
  7782. reserved1 :30;
  7783. } POSTPACK;
  7784. /* DWORD0 : pdev_id configuration Macros */
  7785. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  7786. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  7787. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  7788. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  7789. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  7790. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  7791. do { \
  7792. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  7793. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  7794. } while (0)
  7795. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  7796. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  7797. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  7798. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  7799. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  7800. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  7801. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  7802. do { \
  7803. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  7804. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  7805. } while (0)
  7806. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  7807. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  7808. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  7809. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  7810. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  7811. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  7812. do { \
  7813. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  7814. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  7815. } while (0)
  7816. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  7817. /**
  7818. * @brief host --> target Host PA Address Size
  7819. *
  7820. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  7821. *
  7822. * @details
  7823. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  7824. * provide the physical start address and size of each of the memory
  7825. * areas within host DDR that the target FW may need to access.
  7826. *
  7827. * For example, the host can use this message to allow the target FW
  7828. * to set up access to the host's pools of TQM link descriptors.
  7829. * The message would appear as follows:
  7830. *
  7831. * |31 24|23 16|15 8|7 0|
  7832. * |----------------+----------------+----------------+----------------|
  7833. * | reserved | num_entries | msg_type |
  7834. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7835. * | mem area 0 size |
  7836. * |----------------+----------------+----------------+----------------|
  7837. * | mem area 0 physical_address_lo |
  7838. * |----------------+----------------+----------------+----------------|
  7839. * | mem area 0 physical_address_hi |
  7840. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7841. * | mem area 1 size |
  7842. * |----------------+----------------+----------------+----------------|
  7843. * | mem area 1 physical_address_lo |
  7844. * |----------------+----------------+----------------+----------------|
  7845. * | mem area 1 physical_address_hi |
  7846. * |----------------+----------------+----------------+----------------|
  7847. * ...
  7848. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7849. * | mem area N size |
  7850. * |----------------+----------------+----------------+----------------|
  7851. * | mem area N physical_address_lo |
  7852. * |----------------+----------------+----------------+----------------|
  7853. * | mem area N physical_address_hi |
  7854. * |----------------+----------------+----------------+----------------|
  7855. *
  7856. * The message is interpreted as follows:
  7857. * dword0 - b'0:7 - msg_type: This will be set to
  7858. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  7859. * b'8:15 - number_entries: Indicated the number of host memory
  7860. * areas specified within the remainder of the message
  7861. * b'16:31 - reserved.
  7862. * dword1 - b'0:31 - memory area 0 size in bytes
  7863. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  7864. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  7865. * and similar for memory area 1 through memory area N.
  7866. */
  7867. PREPACK struct htt_h2t_host_paddr_size {
  7868. A_UINT32 msg_type: 8,
  7869. num_entries: 8,
  7870. reserved: 16;
  7871. } POSTPACK;
  7872. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  7873. A_UINT32 size;
  7874. A_UINT32 physical_address_lo;
  7875. A_UINT32 physical_address_hi;
  7876. } POSTPACK;
  7877. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  7878. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  7879. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  7880. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  7881. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  7882. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  7883. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  7884. do { \
  7885. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  7886. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  7887. } while (0)
  7888. /**
  7889. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  7890. *
  7891. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  7892. *
  7893. * @details
  7894. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  7895. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  7896. *
  7897. * The message would appear as follows:
  7898. *
  7899. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  7900. * |---------------------------------+---+---+----------+-+-----------|
  7901. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  7902. * |---------------------+---+---+---+---+---+----------+-+-----------|
  7903. *
  7904. *
  7905. * The message is interpreted as follows:
  7906. * dword0 - b'0:7 - msg_type: This will be set to
  7907. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  7908. * b'8 - override bit to drive MSDUs to PPE ring
  7909. * b'9:13 - REO destination ring indication
  7910. * b'14 - Multi buffer msdu override enable bit
  7911. * b'15 - Intra BSS override
  7912. * b'16 - Decap raw override
  7913. * b'17 - Decap Native wifi override
  7914. * b'18 - IP frag override
  7915. * b'19:31 - reserved
  7916. */
  7917. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  7918. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  7919. override: 1,
  7920. reo_destination_indication: 5,
  7921. multi_buffer_msdu_override_en: 1,
  7922. intra_bss_override: 1,
  7923. decap_raw_override: 1,
  7924. decap_nwifi_override: 1,
  7925. ip_frag_override: 1,
  7926. reserved: 13;
  7927. } POSTPACK;
  7928. /* DWORD 0: Override */
  7929. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  7930. #define HTT_PPE_CFG_OVERRIDE_S 8
  7931. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  7932. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  7933. HTT_PPE_CFG_OVERRIDE_S)
  7934. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  7935. do { \
  7936. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  7937. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  7938. } while (0)
  7939. /* DWORD 0: REO Destination Indication*/
  7940. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  7941. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  7942. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  7943. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  7944. HTT_PPE_CFG_REO_DEST_IND_S)
  7945. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  7946. do { \
  7947. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  7948. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  7949. } while (0)
  7950. /* DWORD 0: Multi buffer MSDU override */
  7951. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  7952. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  7953. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  7954. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  7955. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  7956. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  7957. do { \
  7958. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  7959. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  7960. } while (0)
  7961. /* DWORD 0: Intra BSS override */
  7962. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  7963. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  7964. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  7965. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  7966. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  7967. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  7968. do { \
  7969. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  7970. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  7971. } while (0)
  7972. /* DWORD 0: Decap RAW override */
  7973. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  7974. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  7975. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  7976. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  7977. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  7978. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  7979. do { \
  7980. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  7981. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  7982. } while (0)
  7983. /* DWORD 0: Decap NWIFI override */
  7984. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  7985. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  7986. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  7987. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  7988. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  7989. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  7990. do { \
  7991. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  7992. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  7993. } while (0)
  7994. /* DWORD 0: IP frag override */
  7995. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  7996. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  7997. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  7998. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  7999. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8000. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8001. do { \
  8002. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8003. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8004. } while (0)
  8005. /*
  8006. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8007. *
  8008. * @details
  8009. * The following field definitions describe the format of the HTT host
  8010. * to target FW VDEV TX RX stats retrieve message.
  8011. * The message specifies the type of stats the host wants to retrieve.
  8012. *
  8013. * |31 27|26 25|24 17|16|15 8|7 0|
  8014. * |-----------------------------------------------------------|
  8015. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8016. * |-----------------------------------------------------------|
  8017. * | vdev_id lower bitmask |
  8018. * |-----------------------------------------------------------|
  8019. * | vdev_id upper bitmask |
  8020. * |-----------------------------------------------------------|
  8021. * Header fields:
  8022. * Where:
  8023. * dword0 - b'7:0 - msg_type: This will be set to
  8024. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8025. * b'15:8 - pdev id
  8026. * b'16(E) - Enable/Disable the vdev HW stats
  8027. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8028. * b'25:26(R) - Reset stats bits
  8029. * 0: don't reset stats
  8030. * 1: reset stats once
  8031. * 2: reset stats at the start of each periodic interval
  8032. * b'27:31 - reserved for future use
  8033. * dword1 - b'0:31 - vdev_id lower bitmask
  8034. * dword2 - b'0:31 - vdev_id upper bitmask
  8035. */
  8036. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8037. A_UINT32 msg_type :8,
  8038. pdev_id :8,
  8039. enable :1,
  8040. periodic_interval :8,
  8041. reset_stats_bits :2,
  8042. reserved0 :5;
  8043. A_UINT32 vdev_id_lower_bitmask;
  8044. A_UINT32 vdev_id_upper_bitmask;
  8045. } POSTPACK;
  8046. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8047. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8048. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8049. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8050. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8051. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8052. do { \
  8053. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8054. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8055. } while (0)
  8056. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8057. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8058. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8059. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8060. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8061. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8062. do { \
  8063. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8064. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8065. } while (0)
  8066. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8067. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8068. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8069. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8070. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8071. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8072. do { \
  8073. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8074. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8075. } while (0)
  8076. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8077. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8078. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8079. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8080. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8081. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8082. do { \
  8083. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8084. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8085. } while (0)
  8086. /*
  8087. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8088. *
  8089. * @details
  8090. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8091. * the default MSDU queues for one of the TIDs within the specified peer
  8092. * to the specified service class.
  8093. * The TID is indirectly specified - each service class is associated
  8094. * with a TID. All default MSDU queues for this peer-TID will be
  8095. * linked to the service class in question.
  8096. *
  8097. * |31 16|15 8|7 0|
  8098. * |------------------------------+--------------+--------------|
  8099. * | peer ID | svc class ID | msg type |
  8100. * |------------------------------------------------------------|
  8101. * Header fields:
  8102. * dword0 - b'7:0 - msg_type: This will be set to
  8103. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8104. * b'15:8 - service class ID
  8105. * b'31:16 - peer ID
  8106. */
  8107. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8108. A_UINT32 msg_type :8,
  8109. svc_class_id :8,
  8110. peer_id :16;
  8111. } POSTPACK;
  8112. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8113. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8114. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8115. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8116. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8117. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8118. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8119. do { \
  8120. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8121. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8122. } while (0)
  8123. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8124. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8125. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8126. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8127. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8128. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8129. do { \
  8130. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8131. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8132. } while (0)
  8133. /*
  8134. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8135. *
  8136. * @details
  8137. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8138. * remove the linkage of the specified peer-TID's MSDU queues to
  8139. * service classes.
  8140. *
  8141. * |31 16|15 12|11 8|7 0|
  8142. * |------------------------------+------+-------+--------------|
  8143. * | peer ID | rsvd | TID | msg type |
  8144. * |------------------------------------------------------------|
  8145. * Header fields:
  8146. * dword0 - b'7:0 - msg_type: This will be set to
  8147. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8148. * b'11:8 - TID
  8149. * dword1 - b'31:16 - peer ID
  8150. */
  8151. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8152. A_UINT32 msg_type :8,
  8153. tid :4,
  8154. reserved :4,
  8155. peer_id :16;
  8156. } POSTPACK;
  8157. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8158. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_M 0x00000F00
  8159. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_S 8
  8160. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_GET(_var) \
  8161. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_M) >> \
  8162. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_S)
  8163. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_TID_SET(_var, _val) \
  8164. do { \
  8165. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID, _val); \
  8166. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_S));\
  8167. } while (0)
  8168. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8169. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8170. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(_var) \
  8171. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8172. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8173. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(_var, _val) \
  8174. do { \
  8175. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8176. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8177. } while (0)
  8178. /*
  8179. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8180. *
  8181. * @details
  8182. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8183. * request the target to report what service class the default MSDU queues
  8184. * of the specified peer-TID are linked to.
  8185. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8186. * to report what service class (if any) the peer-TID's default MSDU queues
  8187. * are linked to.
  8188. *
  8189. * |31 16|15 12|11 8|7 0|
  8190. * |------------------------------+------+-------+--------------|
  8191. * | peer ID | rsvd | TID | msg type |
  8192. * |------------------------------------------------------------|
  8193. * Header fields:
  8194. * dword0 - b'7:0 - msg_type: This will be set to
  8195. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8196. * b'11:8 - TID
  8197. * dword1 - b'31:16 - peer ID
  8198. */
  8199. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8200. A_UINT32 msg_type :8,
  8201. tid :4,
  8202. reserved :4,
  8203. peer_id :16;
  8204. } POSTPACK;
  8205. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 4
  8206. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_M 0x00000F00
  8207. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_S 8
  8208. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_GET(_var) \
  8209. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_M) >> \
  8210. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_S)
  8211. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_SET(_var, _val) \
  8212. do { \
  8213. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID, _val); \
  8214. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_S));\
  8215. } while (0)
  8216. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8217. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8218. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(_var) \
  8219. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8220. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8221. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(_var, _val) \
  8222. do { \
  8223. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8224. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8225. } while (0)
  8226. /*=== target -> host messages ===============================================*/
  8227. enum htt_t2h_msg_type {
  8228. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  8229. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  8230. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  8231. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  8232. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  8233. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  8234. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  8235. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  8236. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  8237. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  8238. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  8239. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  8240. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  8241. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  8242. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  8243. /* only used for HL, add HTT MSG for HTT CREDIT update */
  8244. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  8245. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  8246. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  8247. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  8248. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  8249. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  8250. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  8251. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  8252. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  8253. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  8254. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  8255. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  8256. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  8257. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  8258. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  8259. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  8260. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  8261. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  8262. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  8263. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  8264. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  8265. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  8266. /* TX_OFFLOAD_DELIVER_IND:
  8267. * Forward the target's locally-generated packets to the host,
  8268. * to provide to the monitor mode interface.
  8269. */
  8270. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  8271. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  8272. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  8273. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  8274. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  8275. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  8276. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  8277. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  8278. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  8279. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e,
  8280. HTT_T2H_MSG_TYPE_TEST,
  8281. /* keep this last */
  8282. HTT_T2H_NUM_MSGS
  8283. };
  8284. /*
  8285. * HTT target to host message type -
  8286. * stored in bits 7:0 of the first word of the message
  8287. */
  8288. #define HTT_T2H_MSG_TYPE_M 0xff
  8289. #define HTT_T2H_MSG_TYPE_S 0
  8290. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  8291. do { \
  8292. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  8293. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  8294. } while (0)
  8295. #define HTT_T2H_MSG_TYPE_GET(word) \
  8296. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  8297. /**
  8298. * @brief target -> host version number confirmation message definition
  8299. *
  8300. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  8301. *
  8302. * |31 24|23 16|15 8|7 0|
  8303. * |----------------+----------------+----------------+----------------|
  8304. * | reserved | major number | minor number | msg type |
  8305. * |-------------------------------------------------------------------|
  8306. * : option request TLV (optional) |
  8307. * :...................................................................:
  8308. *
  8309. * The VER_CONF message may consist of a single 4-byte word, or may be
  8310. * extended with TLVs that specify HTT options selected by the target.
  8311. * The following option TLVs may be appended to the VER_CONF message:
  8312. * - LL_BUS_ADDR_SIZE
  8313. * - HL_SUPPRESS_TX_COMPL_IND
  8314. * - MAX_TX_QUEUE_GROUPS
  8315. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  8316. * may be appended to the VER_CONF message (but only one TLV of each type).
  8317. *
  8318. * Header fields:
  8319. * - MSG_TYPE
  8320. * Bits 7:0
  8321. * Purpose: identifies this as a version number confirmation message
  8322. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  8323. * - VER_MINOR
  8324. * Bits 15:8
  8325. * Purpose: Specify the minor number of the HTT message library version
  8326. * in use by the target firmware.
  8327. * The minor number specifies the specific revision within a range
  8328. * of fundamentally compatible HTT message definition revisions.
  8329. * Compatible revisions involve adding new messages or perhaps
  8330. * adding new fields to existing messages, in a backwards-compatible
  8331. * manner.
  8332. * Incompatible revisions involve changing the message type values,
  8333. * or redefining existing messages.
  8334. * Value: minor number
  8335. * - VER_MAJOR
  8336. * Bits 15:8
  8337. * Purpose: Specify the major number of the HTT message library version
  8338. * in use by the target firmware.
  8339. * The major number specifies the family of minor revisions that are
  8340. * fundamentally compatible with each other, but not with prior or
  8341. * later families.
  8342. * Value: major number
  8343. */
  8344. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  8345. #define HTT_VER_CONF_MINOR_S 8
  8346. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  8347. #define HTT_VER_CONF_MAJOR_S 16
  8348. #define HTT_VER_CONF_MINOR_SET(word, value) \
  8349. do { \
  8350. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  8351. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  8352. } while (0)
  8353. #define HTT_VER_CONF_MINOR_GET(word) \
  8354. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  8355. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  8356. do { \
  8357. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  8358. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  8359. } while (0)
  8360. #define HTT_VER_CONF_MAJOR_GET(word) \
  8361. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  8362. #define HTT_VER_CONF_BYTES 4
  8363. /**
  8364. * @brief - target -> host HTT Rx In order indication message
  8365. *
  8366. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  8367. *
  8368. * @details
  8369. *
  8370. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  8371. * |----------------+-------------------+---------------------+---------------|
  8372. * | peer ID | P| F| O| ext TID | msg type |
  8373. * |--------------------------------------------------------------------------|
  8374. * | MSDU count | Reserved | vdev id |
  8375. * |--------------------------------------------------------------------------|
  8376. * | MSDU 0 bus address (bits 31:0) |
  8377. #if HTT_PADDR64
  8378. * | MSDU 0 bus address (bits 63:32) |
  8379. #endif
  8380. * |--------------------------------------------------------------------------|
  8381. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  8382. * |--------------------------------------------------------------------------|
  8383. * | MSDU 1 bus address (bits 31:0) |
  8384. #if HTT_PADDR64
  8385. * | MSDU 1 bus address (bits 63:32) |
  8386. #endif
  8387. * |--------------------------------------------------------------------------|
  8388. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  8389. * |--------------------------------------------------------------------------|
  8390. */
  8391. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  8392. *
  8393. * @details
  8394. * bits
  8395. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  8396. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8397. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  8398. * | | frag | | | | fail |chksum fail|
  8399. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8400. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  8401. */
  8402. struct htt_rx_in_ord_paddr_ind_hdr_t
  8403. {
  8404. A_UINT32 /* word 0 */
  8405. msg_type: 8,
  8406. ext_tid: 5,
  8407. offload: 1,
  8408. frag: 1,
  8409. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  8410. peer_id: 16;
  8411. A_UINT32 /* word 1 */
  8412. vap_id: 8,
  8413. /* NOTE:
  8414. * This reserved_1 field is not truly reserved - certain targets use
  8415. * this field internally to store debug information, and do not zero
  8416. * out the contents of the field before uploading the message to the
  8417. * host. Thus, any host-target communication supported by this field
  8418. * is limited to using values that are never used by the debug
  8419. * information stored by certain targets in the reserved_1 field.
  8420. * In particular, the targets in question don't use the value 0x3
  8421. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  8422. * so this previously-unused value within these bits is available to
  8423. * use as the host / target PKT_CAPTURE_MODE flag.
  8424. */
  8425. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  8426. /* if pkt_capture_mode == 0x3, host should
  8427. * send rx frames to monitor mode interface
  8428. */
  8429. msdu_cnt: 16;
  8430. };
  8431. struct htt_rx_in_ord_paddr_ind_msdu32_t
  8432. {
  8433. A_UINT32 dma_addr;
  8434. A_UINT32
  8435. length: 16,
  8436. fw_desc: 8,
  8437. msdu_info:8;
  8438. };
  8439. struct htt_rx_in_ord_paddr_ind_msdu64_t
  8440. {
  8441. A_UINT32 dma_addr_lo;
  8442. A_UINT32 dma_addr_hi;
  8443. A_UINT32
  8444. length: 16,
  8445. fw_desc: 8,
  8446. msdu_info:8;
  8447. };
  8448. #if HTT_PADDR64
  8449. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  8450. #else
  8451. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  8452. #endif
  8453. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  8454. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  8455. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  8456. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  8457. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  8458. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  8459. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  8460. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  8461. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  8462. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  8463. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  8464. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  8465. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  8466. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  8467. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  8468. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  8469. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  8470. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  8471. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  8472. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  8473. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  8474. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  8475. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  8476. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  8477. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  8478. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  8479. /* for systems using 64-bit format for bus addresses */
  8480. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  8481. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  8482. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  8483. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  8484. /* for systems using 32-bit format for bus addresses */
  8485. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  8486. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  8487. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  8488. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  8489. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  8490. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  8491. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  8492. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  8493. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  8494. do { \
  8495. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  8496. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  8497. } while (0)
  8498. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  8499. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  8500. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  8501. do { \
  8502. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  8503. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  8504. } while (0)
  8505. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  8506. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  8507. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  8508. do { \
  8509. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  8510. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  8511. } while (0)
  8512. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  8513. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  8514. /*
  8515. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  8516. * deliver the rx frames to the monitor mode interface.
  8517. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  8518. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  8519. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  8520. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  8521. */
  8522. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  8523. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  8524. do { \
  8525. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  8526. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  8527. } while (0)
  8528. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  8529. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  8530. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  8531. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  8532. do { \
  8533. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  8534. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  8535. } while (0)
  8536. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  8537. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  8538. /* for systems using 64-bit format for bus addresses */
  8539. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  8540. do { \
  8541. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  8542. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  8543. } while (0)
  8544. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  8545. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  8546. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  8547. do { \
  8548. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  8549. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  8550. } while (0)
  8551. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  8552. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  8553. /* for systems using 32-bit format for bus addresses */
  8554. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  8555. do { \
  8556. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  8557. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  8558. } while (0)
  8559. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  8560. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  8561. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  8562. do { \
  8563. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  8564. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  8565. } while (0)
  8566. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  8567. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  8568. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  8569. do { \
  8570. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  8571. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  8572. } while (0)
  8573. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  8574. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  8575. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  8576. do { \
  8577. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  8578. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  8579. } while (0)
  8580. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  8581. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  8582. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  8583. do { \
  8584. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  8585. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  8586. } while (0)
  8587. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  8588. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  8589. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  8590. do { \
  8591. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  8592. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  8593. } while (0)
  8594. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  8595. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  8596. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  8597. do { \
  8598. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  8599. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  8600. } while (0)
  8601. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  8602. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  8603. /* definitions used within target -> host rx indication message */
  8604. PREPACK struct htt_rx_ind_hdr_prefix_t
  8605. {
  8606. A_UINT32 /* word 0 */
  8607. msg_type: 8,
  8608. ext_tid: 5,
  8609. release_valid: 1,
  8610. flush_valid: 1,
  8611. reserved0: 1,
  8612. peer_id: 16;
  8613. A_UINT32 /* word 1 */
  8614. flush_start_seq_num: 6,
  8615. flush_end_seq_num: 6,
  8616. release_start_seq_num: 6,
  8617. release_end_seq_num: 6,
  8618. num_mpdu_ranges: 8;
  8619. } POSTPACK;
  8620. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  8621. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  8622. #define HTT_TGT_RSSI_INVALID 0x80
  8623. PREPACK struct htt_rx_ppdu_desc_t
  8624. {
  8625. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  8626. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  8627. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  8628. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  8629. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  8630. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  8631. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  8632. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  8633. A_UINT32 /* word 0 */
  8634. rssi_cmb: 8,
  8635. timestamp_submicrosec: 8,
  8636. phy_err_code: 8,
  8637. phy_err: 1,
  8638. legacy_rate: 4,
  8639. legacy_rate_sel: 1,
  8640. end_valid: 1,
  8641. start_valid: 1;
  8642. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  8643. union {
  8644. A_UINT32 /* word 1 */
  8645. rssi0_pri20: 8,
  8646. rssi0_ext20: 8,
  8647. rssi0_ext40: 8,
  8648. rssi0_ext80: 8;
  8649. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  8650. } u0;
  8651. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  8652. union {
  8653. A_UINT32 /* word 2 */
  8654. rssi1_pri20: 8,
  8655. rssi1_ext20: 8,
  8656. rssi1_ext40: 8,
  8657. rssi1_ext80: 8;
  8658. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  8659. } u1;
  8660. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  8661. union {
  8662. A_UINT32 /* word 3 */
  8663. rssi2_pri20: 8,
  8664. rssi2_ext20: 8,
  8665. rssi2_ext40: 8,
  8666. rssi2_ext80: 8;
  8667. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  8668. } u2;
  8669. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  8670. union {
  8671. A_UINT32 /* word 4 */
  8672. rssi3_pri20: 8,
  8673. rssi3_ext20: 8,
  8674. rssi3_ext40: 8,
  8675. rssi3_ext80: 8;
  8676. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  8677. } u3;
  8678. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  8679. A_UINT32 tsf32; /* word 5 */
  8680. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  8681. A_UINT32 timestamp_microsec; /* word 6 */
  8682. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  8683. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  8684. A_UINT32 /* word 7 */
  8685. vht_sig_a1: 24,
  8686. preamble_type: 8;
  8687. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  8688. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  8689. A_UINT32 /* word 8 */
  8690. vht_sig_a2: 24,
  8691. /* sa_ant_matrix
  8692. * For cases where a single rx chain has options to be connected to
  8693. * different rx antennas, show which rx antennas were in use during
  8694. * receipt of a given PPDU.
  8695. * This sa_ant_matrix provides a bitmask of the antennas used while
  8696. * receiving this frame.
  8697. */
  8698. sa_ant_matrix: 8;
  8699. } POSTPACK;
  8700. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  8701. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  8702. PREPACK struct htt_rx_ind_hdr_suffix_t
  8703. {
  8704. A_UINT32 /* word 0 */
  8705. fw_rx_desc_bytes: 16,
  8706. reserved0: 16;
  8707. } POSTPACK;
  8708. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  8709. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  8710. PREPACK struct htt_rx_ind_hdr_t
  8711. {
  8712. struct htt_rx_ind_hdr_prefix_t prefix;
  8713. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  8714. struct htt_rx_ind_hdr_suffix_t suffix;
  8715. } POSTPACK;
  8716. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  8717. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  8718. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  8719. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  8720. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  8721. /*
  8722. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  8723. * the offset into the HTT rx indication message at which the
  8724. * FW rx PPDU descriptor resides
  8725. */
  8726. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  8727. /*
  8728. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  8729. * the offset into the HTT rx indication message at which the
  8730. * header suffix (FW rx MSDU byte count) resides
  8731. */
  8732. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  8733. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  8734. /*
  8735. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  8736. * the offset into the HTT rx indication message at which the per-MSDU
  8737. * information starts
  8738. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  8739. * per-MSDU information portion of the message. The per-MSDU info itself
  8740. * starts at byte 12.
  8741. */
  8742. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  8743. /**
  8744. * @brief target -> host rx indication message definition
  8745. *
  8746. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  8747. *
  8748. * @details
  8749. * The following field definitions describe the format of the rx indication
  8750. * message sent from the target to the host.
  8751. * The message consists of three major sections:
  8752. * 1. a fixed-length header
  8753. * 2. a variable-length list of firmware rx MSDU descriptors
  8754. * 3. one or more 4-octet MPDU range information elements
  8755. * The fixed length header itself has two sub-sections
  8756. * 1. the message meta-information, including identification of the
  8757. * sender and type of the received data, and a 4-octet flush/release IE
  8758. * 2. the firmware rx PPDU descriptor
  8759. *
  8760. * The format of the message is depicted below.
  8761. * in this depiction, the following abbreviations are used for information
  8762. * elements within the message:
  8763. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  8764. * elements associated with the PPDU start are valid.
  8765. * Specifically, the following fields are valid only if SV is set:
  8766. * RSSI (all variants), L, legacy rate, preamble type, service,
  8767. * VHT-SIG-A
  8768. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  8769. * elements associated with the PPDU end are valid.
  8770. * Specifically, the following fields are valid only if EV is set:
  8771. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  8772. * - L - Legacy rate selector - if legacy rates are used, this flag
  8773. * indicates whether the rate is from a CCK (L == 1) or OFDM
  8774. * (L == 0) PHY.
  8775. * - P - PHY error flag - boolean indication of whether the rx frame had
  8776. * a PHY error
  8777. *
  8778. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  8779. * |----------------+-------------------+---------------------+---------------|
  8780. * | peer ID | |RV|FV| ext TID | msg type |
  8781. * |--------------------------------------------------------------------------|
  8782. * | num | release | release | flush | flush |
  8783. * | MPDU | end | start | end | start |
  8784. * | ranges | seq num | seq num | seq num | seq num |
  8785. * |==========================================================================|
  8786. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  8787. * |V|V| | rate | | | timestamp | RSSI |
  8788. * |--------------------------------------------------------------------------|
  8789. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  8790. * |--------------------------------------------------------------------------|
  8791. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  8792. * |--------------------------------------------------------------------------|
  8793. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  8794. * |--------------------------------------------------------------------------|
  8795. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  8796. * |--------------------------------------------------------------------------|
  8797. * | TSF LSBs |
  8798. * |--------------------------------------------------------------------------|
  8799. * | microsec timestamp |
  8800. * |--------------------------------------------------------------------------|
  8801. * | preamble type | HT-SIG / VHT-SIG-A1 |
  8802. * |--------------------------------------------------------------------------|
  8803. * | service | HT-SIG / VHT-SIG-A2 |
  8804. * |==========================================================================|
  8805. * | reserved | FW rx desc bytes |
  8806. * |--------------------------------------------------------------------------|
  8807. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  8808. * | desc B3 | desc B2 | desc B1 | desc B0 |
  8809. * |--------------------------------------------------------------------------|
  8810. * : : :
  8811. * |--------------------------------------------------------------------------|
  8812. * | alignment | MSDU Rx |
  8813. * | padding | desc Bn |
  8814. * |--------------------------------------------------------------------------|
  8815. * | reserved | MPDU range status | MPDU count |
  8816. * |--------------------------------------------------------------------------|
  8817. * : reserved : MPDU range status : MPDU count :
  8818. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  8819. *
  8820. * Header fields:
  8821. * - MSG_TYPE
  8822. * Bits 7:0
  8823. * Purpose: identifies this as an rx indication message
  8824. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  8825. * - EXT_TID
  8826. * Bits 12:8
  8827. * Purpose: identify the traffic ID of the rx data, including
  8828. * special "extended" TID values for multicast, broadcast, and
  8829. * non-QoS data frames
  8830. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  8831. * - FLUSH_VALID (FV)
  8832. * Bit 13
  8833. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  8834. * is valid
  8835. * Value:
  8836. * 1 -> flush IE is valid and needs to be processed
  8837. * 0 -> flush IE is not valid and should be ignored
  8838. * - REL_VALID (RV)
  8839. * Bit 13
  8840. * Purpose: indicate whether the release IE (start/end sequence numbers)
  8841. * is valid
  8842. * Value:
  8843. * 1 -> release IE is valid and needs to be processed
  8844. * 0 -> release IE is not valid and should be ignored
  8845. * - PEER_ID
  8846. * Bits 31:16
  8847. * Purpose: Identify, by ID, which peer sent the rx data
  8848. * Value: ID of the peer who sent the rx data
  8849. * - FLUSH_SEQ_NUM_START
  8850. * Bits 5:0
  8851. * Purpose: Indicate the start of a series of MPDUs to flush
  8852. * Not all MPDUs within this series are necessarily valid - the host
  8853. * must check each sequence number within this range to see if the
  8854. * corresponding MPDU is actually present.
  8855. * This field is only valid if the FV bit is set.
  8856. * Value:
  8857. * The sequence number for the first MPDUs to check to flush.
  8858. * The sequence number is masked by 0x3f.
  8859. * - FLUSH_SEQ_NUM_END
  8860. * Bits 11:6
  8861. * Purpose: Indicate the end of a series of MPDUs to flush
  8862. * Value:
  8863. * The sequence number one larger than the sequence number of the
  8864. * last MPDU to check to flush.
  8865. * The sequence number is masked by 0x3f.
  8866. * Not all MPDUs within this series are necessarily valid - the host
  8867. * must check each sequence number within this range to see if the
  8868. * corresponding MPDU is actually present.
  8869. * This field is only valid if the FV bit is set.
  8870. * - REL_SEQ_NUM_START
  8871. * Bits 17:12
  8872. * Purpose: Indicate the start of a series of MPDUs to release.
  8873. * All MPDUs within this series are present and valid - the host
  8874. * need not check each sequence number within this range to see if
  8875. * the corresponding MPDU is actually present.
  8876. * This field is only valid if the RV bit is set.
  8877. * Value:
  8878. * The sequence number for the first MPDUs to check to release.
  8879. * The sequence number is masked by 0x3f.
  8880. * - REL_SEQ_NUM_END
  8881. * Bits 23:18
  8882. * Purpose: Indicate the end of a series of MPDUs to release.
  8883. * Value:
  8884. * The sequence number one larger than the sequence number of the
  8885. * last MPDU to check to release.
  8886. * The sequence number is masked by 0x3f.
  8887. * All MPDUs within this series are present and valid - the host
  8888. * need not check each sequence number within this range to see if
  8889. * the corresponding MPDU is actually present.
  8890. * This field is only valid if the RV bit is set.
  8891. * - NUM_MPDU_RANGES
  8892. * Bits 31:24
  8893. * Purpose: Indicate how many ranges of MPDUs are present.
  8894. * Each MPDU range consists of a series of contiguous MPDUs within the
  8895. * rx frame sequence which all have the same MPDU status.
  8896. * Value: 1-63 (typically a small number, like 1-3)
  8897. *
  8898. * Rx PPDU descriptor fields:
  8899. * - RSSI_CMB
  8900. * Bits 7:0
  8901. * Purpose: Combined RSSI from all active rx chains, across the active
  8902. * bandwidth.
  8903. * Value: RSSI dB units w.r.t. noise floor
  8904. * - TIMESTAMP_SUBMICROSEC
  8905. * Bits 15:8
  8906. * Purpose: high-resolution timestamp
  8907. * Value:
  8908. * Sub-microsecond time of PPDU reception.
  8909. * This timestamp ranges from [0,MAC clock MHz).
  8910. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  8911. * to form a high-resolution, large range rx timestamp.
  8912. * - PHY_ERR_CODE
  8913. * Bits 23:16
  8914. * Purpose:
  8915. * If the rx frame processing resulted in a PHY error, indicate what
  8916. * type of rx PHY error occurred.
  8917. * Value:
  8918. * This field is valid if the "P" (PHY_ERR) flag is set.
  8919. * TBD: document/specify the values for this field
  8920. * - PHY_ERR
  8921. * Bit 24
  8922. * Purpose: indicate whether the rx PPDU had a PHY error
  8923. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  8924. * - LEGACY_RATE
  8925. * Bits 28:25
  8926. * Purpose:
  8927. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  8928. * specify which rate was used.
  8929. * Value:
  8930. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  8931. * flag.
  8932. * If LEGACY_RATE_SEL is 0:
  8933. * 0x8: OFDM 48 Mbps
  8934. * 0x9: OFDM 24 Mbps
  8935. * 0xA: OFDM 12 Mbps
  8936. * 0xB: OFDM 6 Mbps
  8937. * 0xC: OFDM 54 Mbps
  8938. * 0xD: OFDM 36 Mbps
  8939. * 0xE: OFDM 18 Mbps
  8940. * 0xF: OFDM 9 Mbps
  8941. * If LEGACY_RATE_SEL is 1:
  8942. * 0x8: CCK 11 Mbps long preamble
  8943. * 0x9: CCK 5.5 Mbps long preamble
  8944. * 0xA: CCK 2 Mbps long preamble
  8945. * 0xB: CCK 1 Mbps long preamble
  8946. * 0xC: CCK 11 Mbps short preamble
  8947. * 0xD: CCK 5.5 Mbps short preamble
  8948. * 0xE: CCK 2 Mbps short preamble
  8949. * - LEGACY_RATE_SEL
  8950. * Bit 29
  8951. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  8952. * Value:
  8953. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  8954. * used a legacy rate.
  8955. * 0 -> OFDM, 1 -> CCK
  8956. * - END_VALID
  8957. * Bit 30
  8958. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8959. * the start of the PPDU are valid. Specifically, the following
  8960. * fields are only valid if END_VALID is set:
  8961. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  8962. * TIMESTAMP_SUBMICROSEC
  8963. * Value:
  8964. * 0 -> rx PPDU desc end fields are not valid
  8965. * 1 -> rx PPDU desc end fields are valid
  8966. * - START_VALID
  8967. * Bit 31
  8968. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8969. * the end of the PPDU are valid. Specifically, the following
  8970. * fields are only valid if START_VALID is set:
  8971. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  8972. * VHT-SIG-A
  8973. * Value:
  8974. * 0 -> rx PPDU desc start fields are not valid
  8975. * 1 -> rx PPDU desc start fields are valid
  8976. * - RSSI0_PRI20
  8977. * Bits 7:0
  8978. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  8979. * Value: RSSI dB units w.r.t. noise floor
  8980. *
  8981. * - RSSI0_EXT20
  8982. * Bits 7:0
  8983. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  8984. * (if the rx bandwidth was >= 40 MHz)
  8985. * Value: RSSI dB units w.r.t. noise floor
  8986. * - RSSI0_EXT40
  8987. * Bits 7:0
  8988. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  8989. * (if the rx bandwidth was >= 80 MHz)
  8990. * Value: RSSI dB units w.r.t. noise floor
  8991. * - RSSI0_EXT80
  8992. * Bits 7:0
  8993. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  8994. * (if the rx bandwidth was >= 160 MHz)
  8995. * Value: RSSI dB units w.r.t. noise floor
  8996. *
  8997. * - RSSI1_PRI20
  8998. * Bits 7:0
  8999. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  9000. * Value: RSSI dB units w.r.t. noise floor
  9001. * - RSSI1_EXT20
  9002. * Bits 7:0
  9003. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  9004. * (if the rx bandwidth was >= 40 MHz)
  9005. * Value: RSSI dB units w.r.t. noise floor
  9006. * - RSSI1_EXT40
  9007. * Bits 7:0
  9008. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  9009. * (if the rx bandwidth was >= 80 MHz)
  9010. * Value: RSSI dB units w.r.t. noise floor
  9011. * - RSSI1_EXT80
  9012. * Bits 7:0
  9013. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  9014. * (if the rx bandwidth was >= 160 MHz)
  9015. * Value: RSSI dB units w.r.t. noise floor
  9016. *
  9017. * - RSSI2_PRI20
  9018. * Bits 7:0
  9019. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  9020. * Value: RSSI dB units w.r.t. noise floor
  9021. * - RSSI2_EXT20
  9022. * Bits 7:0
  9023. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  9024. * (if the rx bandwidth was >= 40 MHz)
  9025. * Value: RSSI dB units w.r.t. noise floor
  9026. * - RSSI2_EXT40
  9027. * Bits 7:0
  9028. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  9029. * (if the rx bandwidth was >= 80 MHz)
  9030. * Value: RSSI dB units w.r.t. noise floor
  9031. * - RSSI2_EXT80
  9032. * Bits 7:0
  9033. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  9034. * (if the rx bandwidth was >= 160 MHz)
  9035. * Value: RSSI dB units w.r.t. noise floor
  9036. *
  9037. * - RSSI3_PRI20
  9038. * Bits 7:0
  9039. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  9040. * Value: RSSI dB units w.r.t. noise floor
  9041. * - RSSI3_EXT20
  9042. * Bits 7:0
  9043. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  9044. * (if the rx bandwidth was >= 40 MHz)
  9045. * Value: RSSI dB units w.r.t. noise floor
  9046. * - RSSI3_EXT40
  9047. * Bits 7:0
  9048. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  9049. * (if the rx bandwidth was >= 80 MHz)
  9050. * Value: RSSI dB units w.r.t. noise floor
  9051. * - RSSI3_EXT80
  9052. * Bits 7:0
  9053. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  9054. * (if the rx bandwidth was >= 160 MHz)
  9055. * Value: RSSI dB units w.r.t. noise floor
  9056. *
  9057. * - TSF32
  9058. * Bits 31:0
  9059. * Purpose: specify the time the rx PPDU was received, in TSF units
  9060. * Value: 32 LSBs of the TSF
  9061. * - TIMESTAMP_MICROSEC
  9062. * Bits 31:0
  9063. * Purpose: specify the time the rx PPDU was received, in microsecond units
  9064. * Value: PPDU rx time, in microseconds
  9065. * - VHT_SIG_A1
  9066. * Bits 23:0
  9067. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  9068. * from the rx PPDU
  9069. * Value:
  9070. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9071. * VHT-SIG-A1 data.
  9072. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9073. * first 24 bits of the HT-SIG data.
  9074. * Otherwise, this field is invalid.
  9075. * Refer to the the 802.11 protocol for the definition of the
  9076. * HT-SIG and VHT-SIG-A1 fields
  9077. * - VHT_SIG_A2
  9078. * Bits 23:0
  9079. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  9080. * from the rx PPDU
  9081. * Value:
  9082. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9083. * VHT-SIG-A2 data.
  9084. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9085. * last 24 bits of the HT-SIG data.
  9086. * Otherwise, this field is invalid.
  9087. * Refer to the the 802.11 protocol for the definition of the
  9088. * HT-SIG and VHT-SIG-A2 fields
  9089. * - PREAMBLE_TYPE
  9090. * Bits 31:24
  9091. * Purpose: indicate the PHY format of the received burst
  9092. * Value:
  9093. * 0x4: Legacy (OFDM/CCK)
  9094. * 0x8: HT
  9095. * 0x9: HT with TxBF
  9096. * 0xC: VHT
  9097. * 0xD: VHT with TxBF
  9098. * - SERVICE
  9099. * Bits 31:24
  9100. * Purpose: TBD
  9101. * Value: TBD
  9102. *
  9103. * Rx MSDU descriptor fields:
  9104. * - FW_RX_DESC_BYTES
  9105. * Bits 15:0
  9106. * Purpose: Indicate how many bytes in the Rx indication are used for
  9107. * FW Rx descriptors
  9108. *
  9109. * Payload fields:
  9110. * - MPDU_COUNT
  9111. * Bits 7:0
  9112. * Purpose: Indicate how many sequential MPDUs share the same status.
  9113. * All MPDUs within the indicated list are from the same RA-TA-TID.
  9114. * - MPDU_STATUS
  9115. * Bits 15:8
  9116. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  9117. * received successfully.
  9118. * Value:
  9119. * 0x1: success
  9120. * 0x2: FCS error
  9121. * 0x3: duplicate error
  9122. * 0x4: replay error
  9123. * 0x5: invalid peer
  9124. */
  9125. /* header fields */
  9126. #define HTT_RX_IND_EXT_TID_M 0x1f00
  9127. #define HTT_RX_IND_EXT_TID_S 8
  9128. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  9129. #define HTT_RX_IND_FLUSH_VALID_S 13
  9130. #define HTT_RX_IND_REL_VALID_M 0x4000
  9131. #define HTT_RX_IND_REL_VALID_S 14
  9132. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  9133. #define HTT_RX_IND_PEER_ID_S 16
  9134. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  9135. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  9136. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  9137. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  9138. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  9139. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  9140. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  9141. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  9142. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  9143. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  9144. /* rx PPDU descriptor fields */
  9145. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  9146. #define HTT_RX_IND_RSSI_CMB_S 0
  9147. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  9148. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  9149. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  9150. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  9151. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  9152. #define HTT_RX_IND_PHY_ERR_S 24
  9153. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  9154. #define HTT_RX_IND_LEGACY_RATE_S 25
  9155. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  9156. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  9157. #define HTT_RX_IND_END_VALID_M 0x40000000
  9158. #define HTT_RX_IND_END_VALID_S 30
  9159. #define HTT_RX_IND_START_VALID_M 0x80000000
  9160. #define HTT_RX_IND_START_VALID_S 31
  9161. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  9162. #define HTT_RX_IND_RSSI_PRI20_S 0
  9163. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  9164. #define HTT_RX_IND_RSSI_EXT20_S 8
  9165. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  9166. #define HTT_RX_IND_RSSI_EXT40_S 16
  9167. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  9168. #define HTT_RX_IND_RSSI_EXT80_S 24
  9169. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  9170. #define HTT_RX_IND_VHT_SIG_A1_S 0
  9171. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  9172. #define HTT_RX_IND_VHT_SIG_A2_S 0
  9173. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  9174. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  9175. #define HTT_RX_IND_SERVICE_M 0xff000000
  9176. #define HTT_RX_IND_SERVICE_S 24
  9177. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  9178. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  9179. /* rx MSDU descriptor fields */
  9180. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  9181. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  9182. /* payload fields */
  9183. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  9184. #define HTT_RX_IND_MPDU_COUNT_S 0
  9185. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  9186. #define HTT_RX_IND_MPDU_STATUS_S 8
  9187. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  9188. do { \
  9189. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  9190. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  9191. } while (0)
  9192. #define HTT_RX_IND_EXT_TID_GET(word) \
  9193. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  9194. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  9195. do { \
  9196. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  9197. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  9198. } while (0)
  9199. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  9200. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  9201. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  9202. do { \
  9203. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  9204. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  9205. } while (0)
  9206. #define HTT_RX_IND_REL_VALID_GET(word) \
  9207. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  9208. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  9209. do { \
  9210. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  9211. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  9212. } while (0)
  9213. #define HTT_RX_IND_PEER_ID_GET(word) \
  9214. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  9215. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  9216. do { \
  9217. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  9218. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  9219. } while (0)
  9220. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  9221. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  9222. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  9223. do { \
  9224. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  9225. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  9226. } while (0)
  9227. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  9228. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  9229. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  9230. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  9231. do { \
  9232. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  9233. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  9234. } while (0)
  9235. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  9236. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  9237. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  9238. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  9239. do { \
  9240. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  9241. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  9242. } while (0)
  9243. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  9244. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  9245. HTT_RX_IND_REL_SEQ_NUM_START_S)
  9246. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  9247. do { \
  9248. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  9249. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  9250. } while (0)
  9251. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  9252. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  9253. HTT_RX_IND_REL_SEQ_NUM_END_S)
  9254. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  9255. do { \
  9256. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  9257. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  9258. } while (0)
  9259. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  9260. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  9261. HTT_RX_IND_NUM_MPDU_RANGES_S)
  9262. /* FW rx PPDU descriptor fields */
  9263. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  9264. do { \
  9265. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  9266. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  9267. } while (0)
  9268. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  9269. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  9270. HTT_RX_IND_RSSI_CMB_S)
  9271. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  9272. do { \
  9273. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  9274. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  9275. } while (0)
  9276. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  9277. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  9278. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  9279. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  9280. do { \
  9281. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  9282. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  9283. } while (0)
  9284. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  9285. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  9286. HTT_RX_IND_PHY_ERR_CODE_S)
  9287. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  9288. do { \
  9289. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  9290. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  9291. } while (0)
  9292. #define HTT_RX_IND_PHY_ERR_GET(word) \
  9293. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  9294. HTT_RX_IND_PHY_ERR_S)
  9295. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  9296. do { \
  9297. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  9298. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  9299. } while (0)
  9300. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  9301. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  9302. HTT_RX_IND_LEGACY_RATE_S)
  9303. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  9304. do { \
  9305. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  9306. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  9307. } while (0)
  9308. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  9309. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  9310. HTT_RX_IND_LEGACY_RATE_SEL_S)
  9311. #define HTT_RX_IND_END_VALID_SET(word, value) \
  9312. do { \
  9313. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  9314. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  9315. } while (0)
  9316. #define HTT_RX_IND_END_VALID_GET(word) \
  9317. (((word) & HTT_RX_IND_END_VALID_M) >> \
  9318. HTT_RX_IND_END_VALID_S)
  9319. #define HTT_RX_IND_START_VALID_SET(word, value) \
  9320. do { \
  9321. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  9322. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  9323. } while (0)
  9324. #define HTT_RX_IND_START_VALID_GET(word) \
  9325. (((word) & HTT_RX_IND_START_VALID_M) >> \
  9326. HTT_RX_IND_START_VALID_S)
  9327. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  9328. do { \
  9329. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  9330. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  9331. } while (0)
  9332. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  9333. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  9334. HTT_RX_IND_RSSI_PRI20_S)
  9335. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  9336. do { \
  9337. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  9338. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  9339. } while (0)
  9340. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  9341. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  9342. HTT_RX_IND_RSSI_EXT20_S)
  9343. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  9344. do { \
  9345. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  9346. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  9347. } while (0)
  9348. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  9349. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  9350. HTT_RX_IND_RSSI_EXT40_S)
  9351. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  9352. do { \
  9353. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  9354. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  9355. } while (0)
  9356. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  9357. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  9358. HTT_RX_IND_RSSI_EXT80_S)
  9359. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  9360. do { \
  9361. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  9362. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  9363. } while (0)
  9364. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  9365. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  9366. HTT_RX_IND_VHT_SIG_A1_S)
  9367. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  9368. do { \
  9369. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  9370. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  9371. } while (0)
  9372. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  9373. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  9374. HTT_RX_IND_VHT_SIG_A2_S)
  9375. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  9376. do { \
  9377. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  9378. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  9379. } while (0)
  9380. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  9381. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  9382. HTT_RX_IND_PREAMBLE_TYPE_S)
  9383. #define HTT_RX_IND_SERVICE_SET(word, value) \
  9384. do { \
  9385. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  9386. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  9387. } while (0)
  9388. #define HTT_RX_IND_SERVICE_GET(word) \
  9389. (((word) & HTT_RX_IND_SERVICE_M) >> \
  9390. HTT_RX_IND_SERVICE_S)
  9391. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  9392. do { \
  9393. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  9394. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  9395. } while (0)
  9396. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  9397. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  9398. HTT_RX_IND_SA_ANT_MATRIX_S)
  9399. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  9400. do { \
  9401. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  9402. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  9403. } while (0)
  9404. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  9405. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  9406. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  9407. do { \
  9408. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  9409. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  9410. } while (0)
  9411. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  9412. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  9413. #define HTT_RX_IND_HL_BYTES \
  9414. (HTT_RX_IND_HDR_BYTES + \
  9415. 4 /* single FW rx MSDU descriptor */ + \
  9416. 4 /* single MPDU range information element */)
  9417. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  9418. /* Could we use one macro entry? */
  9419. #define HTT_WORD_SET(word, field, value) \
  9420. do { \
  9421. HTT_CHECK_SET_VAL(field, value); \
  9422. (word) |= ((value) << field ## _S); \
  9423. } while (0)
  9424. #define HTT_WORD_GET(word, field) \
  9425. (((word) & field ## _M) >> field ## _S)
  9426. PREPACK struct hl_htt_rx_ind_base {
  9427. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  9428. } POSTPACK;
  9429. /*
  9430. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  9431. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  9432. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  9433. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  9434. * htt_rx_ind_hl_rx_desc_t.
  9435. */
  9436. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  9437. struct htt_rx_ind_hl_rx_desc_t {
  9438. A_UINT8 ver;
  9439. A_UINT8 len;
  9440. struct {
  9441. A_UINT8
  9442. first_msdu: 1,
  9443. last_msdu: 1,
  9444. c3_failed: 1,
  9445. c4_failed: 1,
  9446. ipv6: 1,
  9447. tcp: 1,
  9448. udp: 1,
  9449. reserved: 1;
  9450. } flags;
  9451. /* NOTE: no reserved space - don't append any new fields here */
  9452. };
  9453. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  9454. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9455. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  9456. #define HTT_RX_IND_HL_RX_DESC_VER 0
  9457. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  9458. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9459. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  9460. #define HTT_RX_IND_HL_FLAG_OFFSET \
  9461. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9462. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  9463. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  9464. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  9465. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  9466. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  9467. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  9468. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  9469. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  9470. /* This structure is used in HL, the basic descriptor information
  9471. * used by host. the structure is translated by FW from HW desc
  9472. * or generated by FW. But in HL monitor mode, the host would use
  9473. * the same structure with LL.
  9474. */
  9475. PREPACK struct hl_htt_rx_desc_base {
  9476. A_UINT32
  9477. seq_num:12,
  9478. encrypted:1,
  9479. chan_info_present:1,
  9480. resv0:2,
  9481. mcast_bcast:1,
  9482. fragment:1,
  9483. key_id_oct:8,
  9484. resv1:6;
  9485. A_UINT32
  9486. pn_31_0;
  9487. union {
  9488. struct {
  9489. A_UINT16 pn_47_32;
  9490. A_UINT16 pn_63_48;
  9491. } pn16;
  9492. A_UINT32 pn_63_32;
  9493. } u0;
  9494. A_UINT32
  9495. pn_95_64;
  9496. A_UINT32
  9497. pn_127_96;
  9498. } POSTPACK;
  9499. /*
  9500. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  9501. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  9502. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  9503. * Please see htt_chan_change_t for description of the fields.
  9504. */
  9505. PREPACK struct htt_chan_info_t
  9506. {
  9507. A_UINT32 primary_chan_center_freq_mhz: 16,
  9508. contig_chan1_center_freq_mhz: 16;
  9509. A_UINT32 contig_chan2_center_freq_mhz: 16,
  9510. phy_mode: 8,
  9511. reserved: 8;
  9512. } POSTPACK;
  9513. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  9514. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  9515. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  9516. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  9517. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  9518. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  9519. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  9520. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  9521. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  9522. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  9523. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  9524. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  9525. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  9526. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  9527. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  9528. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  9529. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  9530. /* Channel information */
  9531. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  9532. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  9533. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  9534. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  9535. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  9536. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  9537. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  9538. #define HTT_CHAN_INFO_PHY_MODE_S 16
  9539. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  9540. do { \
  9541. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  9542. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  9543. } while (0)
  9544. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  9545. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  9546. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  9547. do { \
  9548. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  9549. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  9550. } while (0)
  9551. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  9552. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  9553. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  9554. do { \
  9555. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  9556. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  9557. } while (0)
  9558. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  9559. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  9560. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  9561. do { \
  9562. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  9563. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  9564. } while (0)
  9565. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  9566. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  9567. /*
  9568. * @brief target -> host message definition for FW offloaded pkts
  9569. *
  9570. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  9571. *
  9572. * @details
  9573. * The following field definitions describe the format of the firmware
  9574. * offload deliver message sent from the target to the host.
  9575. *
  9576. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  9577. *
  9578. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  9579. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  9580. * | reserved_1 | msg type |
  9581. * |--------------------------------------------------------------------------|
  9582. * | phy_timestamp_l32 |
  9583. * |--------------------------------------------------------------------------|
  9584. * | WORD2 (see below) |
  9585. * |--------------------------------------------------------------------------|
  9586. * | seqno | framectrl |
  9587. * |--------------------------------------------------------------------------|
  9588. * | reserved_3 | vdev_id | tid_num|
  9589. * |--------------------------------------------------------------------------|
  9590. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  9591. * |--------------------------------------------------------------------------|
  9592. *
  9593. * where:
  9594. * STAT = status
  9595. * F = format (802.3 vs. 802.11)
  9596. *
  9597. * definition for word 2
  9598. *
  9599. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  9600. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  9601. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  9602. * |--------------------------------------------------------------------------|
  9603. *
  9604. * where:
  9605. * PR = preamble
  9606. * BF = beamformed
  9607. */
  9608. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  9609. {
  9610. A_UINT32 /* word 0 */
  9611. msg_type:8, /* [ 7: 0] */
  9612. reserved_1:24; /* [31: 8] */
  9613. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  9614. A_UINT32 /* word 2 */
  9615. /* preamble:
  9616. * 0-OFDM,
  9617. * 1-CCk,
  9618. * 2-HT,
  9619. * 3-VHT
  9620. */
  9621. preamble: 2, /* [1:0] */
  9622. /* mcs:
  9623. * In case of HT preamble interpret
  9624. * MCS along with NSS.
  9625. * Valid values for HT are 0 to 7.
  9626. * HT mcs 0 with NSS 2 is mcs 8.
  9627. * Valid values for VHT are 0 to 9.
  9628. */
  9629. mcs: 4, /* [5:2] */
  9630. /* rate:
  9631. * This is applicable only for
  9632. * CCK and OFDM preamble type
  9633. * rate 0: OFDM 48 Mbps,
  9634. * 1: OFDM 24 Mbps,
  9635. * 2: OFDM 12 Mbps
  9636. * 3: OFDM 6 Mbps
  9637. * 4: OFDM 54 Mbps
  9638. * 5: OFDM 36 Mbps
  9639. * 6: OFDM 18 Mbps
  9640. * 7: OFDM 9 Mbps
  9641. * rate 0: CCK 11 Mbps Long
  9642. * 1: CCK 5.5 Mbps Long
  9643. * 2: CCK 2 Mbps Long
  9644. * 3: CCK 1 Mbps Long
  9645. * 4: CCK 11 Mbps Short
  9646. * 5: CCK 5.5 Mbps Short
  9647. * 6: CCK 2 Mbps Short
  9648. */
  9649. rate : 3, /* [ 8: 6] */
  9650. rssi : 8, /* [16: 9] units=dBm */
  9651. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  9652. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  9653. stbc : 1, /* [22] */
  9654. sgi : 1, /* [23] */
  9655. ldpc : 1, /* [24] */
  9656. beamformed: 1, /* [25] */
  9657. reserved_2: 6; /* [31:26] */
  9658. A_UINT32 /* word 3 */
  9659. framectrl:16, /* [15: 0] */
  9660. seqno:16; /* [31:16] */
  9661. A_UINT32 /* word 4 */
  9662. tid_num:5, /* [ 4: 0] actual TID number */
  9663. vdev_id:8, /* [12: 5] */
  9664. reserved_3:19; /* [31:13] */
  9665. A_UINT32 /* word 5 */
  9666. /* status:
  9667. * 0: tx_ok
  9668. * 1: retry
  9669. * 2: drop
  9670. * 3: filtered
  9671. * 4: abort
  9672. * 5: tid delete
  9673. * 6: sw abort
  9674. * 7: dropped by peer migration
  9675. */
  9676. status:3, /* [2:0] */
  9677. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  9678. tx_mpdu_bytes:16, /* [19:4] */
  9679. /* Indicates retry count of offloaded/local generated Data tx frames */
  9680. tx_retry_cnt:6, /* [25:20] */
  9681. reserved_4:6; /* [31:26] */
  9682. } POSTPACK;
  9683. /* FW offload deliver ind message header fields */
  9684. /* DWORD one */
  9685. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  9686. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  9687. /* DWORD two */
  9688. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  9689. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  9690. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  9691. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  9692. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  9693. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  9694. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  9695. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  9696. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  9697. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  9698. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  9699. #define HTT_FW_OFFLOAD_IND_BW_S 19
  9700. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  9701. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  9702. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  9703. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  9704. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  9705. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  9706. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  9707. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  9708. /* DWORD three*/
  9709. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  9710. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  9711. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  9712. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  9713. /* DWORD four */
  9714. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  9715. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  9716. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  9717. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  9718. /* DWORD five */
  9719. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  9720. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  9721. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  9722. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  9723. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  9724. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  9725. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  9726. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  9727. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  9728. do { \
  9729. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  9730. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  9731. } while (0)
  9732. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  9733. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  9734. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  9735. do { \
  9736. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  9737. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  9738. } while (0)
  9739. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  9740. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  9741. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  9742. do { \
  9743. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  9744. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  9745. } while (0)
  9746. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  9747. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  9748. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  9749. do { \
  9750. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  9751. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  9752. } while (0)
  9753. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  9754. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  9755. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  9756. do { \
  9757. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  9758. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  9759. } while (0)
  9760. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  9761. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  9762. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  9763. do { \
  9764. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  9765. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  9766. } while (0)
  9767. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  9768. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  9769. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  9770. do { \
  9771. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  9772. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  9773. } while (0)
  9774. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  9775. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  9776. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  9777. do { \
  9778. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  9779. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  9780. } while (0)
  9781. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  9782. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  9783. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  9784. do { \
  9785. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  9786. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  9787. } while (0)
  9788. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  9789. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  9790. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  9791. do { \
  9792. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  9793. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  9794. } while (0)
  9795. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  9796. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  9797. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  9798. do { \
  9799. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  9800. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  9801. } while (0)
  9802. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  9803. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  9804. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  9805. do { \
  9806. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  9807. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  9808. } while (0)
  9809. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  9810. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  9811. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  9812. do { \
  9813. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  9814. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  9815. } while (0)
  9816. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  9817. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  9818. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  9819. do { \
  9820. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  9821. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  9822. } while (0)
  9823. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  9824. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  9825. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  9826. do { \
  9827. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  9828. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  9829. } while (0)
  9830. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  9831. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  9832. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  9833. do { \
  9834. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  9835. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  9836. } while (0)
  9837. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  9838. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  9839. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  9840. do { \
  9841. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  9842. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  9843. } while (0)
  9844. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  9845. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  9846. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  9847. do { \
  9848. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  9849. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  9850. } while (0)
  9851. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  9852. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  9853. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  9854. do { \
  9855. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  9856. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  9857. } while (0)
  9858. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  9859. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  9860. /*
  9861. * @brief target -> host rx reorder flush message definition
  9862. *
  9863. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  9864. *
  9865. * @details
  9866. * The following field definitions describe the format of the rx flush
  9867. * message sent from the target to the host.
  9868. * The message consists of a 4-octet header, followed by one or more
  9869. * 4-octet payload information elements.
  9870. *
  9871. * |31 24|23 8|7 0|
  9872. * |--------------------------------------------------------------|
  9873. * | TID | peer ID | msg type |
  9874. * |--------------------------------------------------------------|
  9875. * | seq num end | seq num start | MPDU status | reserved |
  9876. * |--------------------------------------------------------------|
  9877. * First DWORD:
  9878. * - MSG_TYPE
  9879. * Bits 7:0
  9880. * Purpose: identifies this as an rx flush message
  9881. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  9882. * - PEER_ID
  9883. * Bits 23:8 (only bits 18:8 actually used)
  9884. * Purpose: identify which peer's rx data is being flushed
  9885. * Value: (rx) peer ID
  9886. * - TID
  9887. * Bits 31:24 (only bits 27:24 actually used)
  9888. * Purpose: Specifies which traffic identifier's rx data is being flushed
  9889. * Value: traffic identifier
  9890. * Second DWORD:
  9891. * - MPDU_STATUS
  9892. * Bits 15:8
  9893. * Purpose:
  9894. * Indicate whether the flushed MPDUs should be discarded or processed.
  9895. * Value:
  9896. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  9897. * stages of rx processing
  9898. * other: discard the MPDUs
  9899. * It is anticipated that flush messages will always have
  9900. * MPDU status == 1, but the status flag is included for
  9901. * flexibility.
  9902. * - SEQ_NUM_START
  9903. * Bits 23:16
  9904. * Purpose:
  9905. * Indicate the start of a series of consecutive MPDUs being flushed.
  9906. * Not all MPDUs within this range are necessarily valid - the host
  9907. * must check each sequence number within this range to see if the
  9908. * corresponding MPDU is actually present.
  9909. * Value:
  9910. * The sequence number for the first MPDU in the sequence.
  9911. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9912. * - SEQ_NUM_END
  9913. * Bits 30:24
  9914. * Purpose:
  9915. * Indicate the end of a series of consecutive MPDUs being flushed.
  9916. * Value:
  9917. * The sequence number one larger than the sequence number of the
  9918. * last MPDU being flushed.
  9919. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9920. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  9921. * are to be released for further rx processing.
  9922. * Not all MPDUs within this range are necessarily valid - the host
  9923. * must check each sequence number within this range to see if the
  9924. * corresponding MPDU is actually present.
  9925. */
  9926. /* first DWORD */
  9927. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  9928. #define HTT_RX_FLUSH_PEER_ID_S 8
  9929. #define HTT_RX_FLUSH_TID_M 0xff000000
  9930. #define HTT_RX_FLUSH_TID_S 24
  9931. /* second DWORD */
  9932. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  9933. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  9934. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  9935. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  9936. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  9937. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  9938. #define HTT_RX_FLUSH_BYTES 8
  9939. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  9940. do { \
  9941. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  9942. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  9943. } while (0)
  9944. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  9945. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  9946. #define HTT_RX_FLUSH_TID_SET(word, value) \
  9947. do { \
  9948. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  9949. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  9950. } while (0)
  9951. #define HTT_RX_FLUSH_TID_GET(word) \
  9952. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  9953. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  9954. do { \
  9955. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  9956. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  9957. } while (0)
  9958. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  9959. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  9960. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  9961. do { \
  9962. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  9963. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  9964. } while (0)
  9965. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  9966. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  9967. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  9968. do { \
  9969. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  9970. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  9971. } while (0)
  9972. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  9973. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  9974. /*
  9975. * @brief target -> host rx pn check indication message
  9976. *
  9977. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  9978. *
  9979. * @details
  9980. * The following field definitions describe the format of the Rx PN check
  9981. * indication message sent from the target to the host.
  9982. * The message consists of a 4-octet header, followed by the start and
  9983. * end sequence numbers to be released, followed by the PN IEs. Each PN
  9984. * IE is one octet containing the sequence number that failed the PN
  9985. * check.
  9986. *
  9987. * |31 24|23 8|7 0|
  9988. * |--------------------------------------------------------------|
  9989. * | TID | peer ID | msg type |
  9990. * |--------------------------------------------------------------|
  9991. * | Reserved | PN IE count | seq num end | seq num start|
  9992. * |--------------------------------------------------------------|
  9993. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  9994. * |--------------------------------------------------------------|
  9995. * First DWORD:
  9996. * - MSG_TYPE
  9997. * Bits 7:0
  9998. * Purpose: Identifies this as an rx pn check indication message
  9999. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  10000. * - PEER_ID
  10001. * Bits 23:8 (only bits 18:8 actually used)
  10002. * Purpose: identify which peer
  10003. * Value: (rx) peer ID
  10004. * - TID
  10005. * Bits 31:24 (only bits 27:24 actually used)
  10006. * Purpose: identify traffic identifier
  10007. * Value: traffic identifier
  10008. * Second DWORD:
  10009. * - SEQ_NUM_START
  10010. * Bits 7:0
  10011. * Purpose:
  10012. * Indicates the starting sequence number of the MPDU in this
  10013. * series of MPDUs that went though PN check.
  10014. * Value:
  10015. * The sequence number for the first MPDU in the sequence.
  10016. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10017. * - SEQ_NUM_END
  10018. * Bits 15:8
  10019. * Purpose:
  10020. * Indicates the ending sequence number of the MPDU in this
  10021. * series of MPDUs that went though PN check.
  10022. * Value:
  10023. * The sequence number one larger then the sequence number of the last
  10024. * MPDU being flushed.
  10025. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10026. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  10027. * for invalid PN numbers and are ready to be released for further processing.
  10028. * Not all MPDUs within this range are necessarily valid - the host
  10029. * must check each sequence number within this range to see if the
  10030. * corresponding MPDU is actually present.
  10031. * - PN_IE_COUNT
  10032. * Bits 23:16
  10033. * Purpose:
  10034. * Used to determine the variable number of PN information elements in this
  10035. * message
  10036. *
  10037. * PN information elements:
  10038. * - PN_IE_x-
  10039. * Purpose:
  10040. * Each PN information element contains the sequence number of the MPDU that
  10041. * has failed the target PN check.
  10042. * Value:
  10043. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  10044. * that failed the PN check.
  10045. */
  10046. /* first DWORD */
  10047. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  10048. #define HTT_RX_PN_IND_PEER_ID_S 8
  10049. #define HTT_RX_PN_IND_TID_M 0xff000000
  10050. #define HTT_RX_PN_IND_TID_S 24
  10051. /* second DWORD */
  10052. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  10053. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  10054. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  10055. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  10056. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  10057. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  10058. #define HTT_RX_PN_IND_BYTES 8
  10059. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  10060. do { \
  10061. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  10062. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  10063. } while (0)
  10064. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  10065. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  10066. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  10067. do { \
  10068. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  10069. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  10070. } while (0)
  10071. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  10072. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  10073. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  10074. do { \
  10075. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  10076. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  10077. } while (0)
  10078. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  10079. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  10080. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  10081. do { \
  10082. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  10083. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  10084. } while (0)
  10085. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  10086. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  10087. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  10088. do { \
  10089. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  10090. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  10091. } while (0)
  10092. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  10093. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  10094. /*
  10095. * @brief target -> host rx offload deliver message for LL system
  10096. *
  10097. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  10098. *
  10099. * @details
  10100. * In a low latency system this message is sent whenever the offload
  10101. * manager flushes out the packets it has coalesced in its coalescing buffer.
  10102. * The DMA of the actual packets into host memory is done before sending out
  10103. * this message. This message indicates only how many MSDUs to reap. The
  10104. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  10105. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  10106. * DMA'd by the MAC directly into host memory these packets do not contain
  10107. * the MAC descriptors in the header portion of the packet. Instead they contain
  10108. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  10109. * message, the packets are delivered directly to the NW stack without going
  10110. * through the regular reorder buffering and PN checking path since it has
  10111. * already been done in target.
  10112. *
  10113. * |31 24|23 16|15 8|7 0|
  10114. * |-----------------------------------------------------------------------|
  10115. * | Total MSDU count | reserved | msg type |
  10116. * |-----------------------------------------------------------------------|
  10117. *
  10118. * @brief target -> host rx offload deliver message for HL system
  10119. *
  10120. * @details
  10121. * In a high latency system this message is sent whenever the offload manager
  10122. * flushes out the packets it has coalesced in its coalescing buffer. The
  10123. * actual packets are also carried along with this message. When the host
  10124. * receives this message, it is expected to deliver these packets to the NW
  10125. * stack directly instead of routing them through the reorder buffering and
  10126. * PN checking path since it has already been done in target.
  10127. *
  10128. * |31 24|23 16|15 8|7 0|
  10129. * |-----------------------------------------------------------------------|
  10130. * | Total MSDU count | reserved | msg type |
  10131. * |-----------------------------------------------------------------------|
  10132. * | peer ID | MSDU length |
  10133. * |-----------------------------------------------------------------------|
  10134. * | MSDU payload | FW Desc | tid | vdev ID |
  10135. * |-----------------------------------------------------------------------|
  10136. * | MSDU payload contd. |
  10137. * |-----------------------------------------------------------------------|
  10138. * | peer ID | MSDU length |
  10139. * |-----------------------------------------------------------------------|
  10140. * | MSDU payload | FW Desc | tid | vdev ID |
  10141. * |-----------------------------------------------------------------------|
  10142. * | MSDU payload contd. |
  10143. * |-----------------------------------------------------------------------|
  10144. *
  10145. */
  10146. /* first DWORD */
  10147. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  10148. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  10149. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  10150. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  10151. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  10152. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  10153. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  10154. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  10155. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  10156. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  10157. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  10158. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  10159. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  10160. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  10161. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  10162. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  10163. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  10164. do { \
  10165. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  10166. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  10167. } while (0)
  10168. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  10169. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  10170. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  10171. do { \
  10172. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  10173. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  10174. } while (0)
  10175. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  10176. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  10177. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  10178. do { \
  10179. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  10180. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  10181. } while (0)
  10182. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  10183. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  10184. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  10185. do { \
  10186. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  10187. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  10188. } while (0)
  10189. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  10190. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  10191. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  10192. do { \
  10193. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  10194. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  10195. } while (0)
  10196. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  10197. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  10198. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  10199. do { \
  10200. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  10201. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  10202. } while (0)
  10203. /**
  10204. * @brief target -> host rx peer map/unmap message definition
  10205. *
  10206. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  10207. *
  10208. * @details
  10209. * The following diagram shows the format of the rx peer map message sent
  10210. * from the target to the host. This layout assumes the target operates
  10211. * as little-endian.
  10212. *
  10213. * This message always contains a SW peer ID. The main purpose of the
  10214. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10215. * with, so that the host can use that peer ID to determine which peer
  10216. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10217. * other purposes, such as identifying during tx completions which peer
  10218. * the tx frames in question were transmitted to.
  10219. *
  10220. * In certain generations of chips, the peer map message also contains
  10221. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  10222. * to identify which peer the frame needs to be forwarded to (i.e. the
  10223. * peer assocated with the Destination MAC Address within the packet),
  10224. * and particularly which vdev needs to transmit the frame (for cases
  10225. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  10226. * meaning as AST_INDEX_0.
  10227. * This DA-based peer ID that is provided for certain rx frames
  10228. * (the rx frames that need to be re-transmitted as tx frames)
  10229. * is the ID that the HW uses for referring to the peer in question,
  10230. * rather than the peer ID that the SW+FW use to refer to the peer.
  10231. *
  10232. *
  10233. * |31 24|23 16|15 8|7 0|
  10234. * |-----------------------------------------------------------------------|
  10235. * | SW peer ID | VDEV ID | msg type |
  10236. * |-----------------------------------------------------------------------|
  10237. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10238. * |-----------------------------------------------------------------------|
  10239. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10240. * |-----------------------------------------------------------------------|
  10241. *
  10242. *
  10243. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  10244. *
  10245. * The following diagram shows the format of the rx peer unmap message sent
  10246. * from the target to the host.
  10247. *
  10248. * |31 24|23 16|15 8|7 0|
  10249. * |-----------------------------------------------------------------------|
  10250. * | SW peer ID | VDEV ID | msg type |
  10251. * |-----------------------------------------------------------------------|
  10252. *
  10253. * The following field definitions describe the format of the rx peer map
  10254. * and peer unmap messages sent from the target to the host.
  10255. * - MSG_TYPE
  10256. * Bits 7:0
  10257. * Purpose: identifies this as an rx peer map or peer unmap message
  10258. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  10259. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  10260. * - VDEV_ID
  10261. * Bits 15:8
  10262. * Purpose: Indicates which virtual device the peer is associated
  10263. * with.
  10264. * Value: vdev ID (used in the host to look up the vdev object)
  10265. * - PEER_ID (a.k.a. SW_PEER_ID)
  10266. * Bits 31:16
  10267. * Purpose: The peer ID (index) that WAL is allocating (map) or
  10268. * freeing (unmap)
  10269. * Value: (rx) peer ID
  10270. * - MAC_ADDR_L32 (peer map only)
  10271. * Bits 31:0
  10272. * Purpose: Identifies which peer node the peer ID is for.
  10273. * Value: lower 4 bytes of peer node's MAC address
  10274. * - MAC_ADDR_U16 (peer map only)
  10275. * Bits 15:0
  10276. * Purpose: Identifies which peer node the peer ID is for.
  10277. * Value: upper 2 bytes of peer node's MAC address
  10278. * - HW_PEER_ID
  10279. * Bits 31:16
  10280. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10281. * address, so for rx frames marked for rx --> tx forwarding, the
  10282. * host can determine from the HW peer ID provided as meta-data with
  10283. * the rx frame which peer the frame is supposed to be forwarded to.
  10284. * Value: ID used by the MAC HW to identify the peer
  10285. */
  10286. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  10287. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  10288. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  10289. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  10290. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  10291. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  10292. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10293. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  10294. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  10295. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  10296. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  10297. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  10298. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  10299. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  10300. do { \
  10301. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  10302. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  10303. } while (0)
  10304. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  10305. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  10306. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  10307. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  10308. do { \
  10309. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  10310. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  10311. } while (0)
  10312. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  10313. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  10314. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  10315. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  10316. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  10317. do { \
  10318. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  10319. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  10320. } while (0)
  10321. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  10322. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  10323. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10324. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  10325. #define HTT_RX_PEER_MAP_BYTES 12
  10326. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  10327. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  10328. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  10329. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  10330. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  10331. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  10332. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  10333. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  10334. #define HTT_RX_PEER_UNMAP_BYTES 4
  10335. /**
  10336. * @brief target -> host rx peer map V2 message definition
  10337. *
  10338. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  10339. *
  10340. * @details
  10341. * The following diagram shows the format of the rx peer map v2 message sent
  10342. * from the target to the host. This layout assumes the target operates
  10343. * as little-endian.
  10344. *
  10345. * This message always contains a SW peer ID. The main purpose of the
  10346. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10347. * with, so that the host can use that peer ID to determine which peer
  10348. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10349. * other purposes, such as identifying during tx completions which peer
  10350. * the tx frames in question were transmitted to.
  10351. *
  10352. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  10353. * is used during rx --> tx frame forwarding to identify which peer the
  10354. * frame needs to be forwarded to (i.e. the peer assocated with the
  10355. * Destination MAC Address within the packet), and particularly which vdev
  10356. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  10357. * This DA-based peer ID that is provided for certain rx frames
  10358. * (the rx frames that need to be re-transmitted as tx frames)
  10359. * is the ID that the HW uses for referring to the peer in question,
  10360. * rather than the peer ID that the SW+FW use to refer to the peer.
  10361. *
  10362. * The HW peer id here is the same meaning as AST_INDEX_0.
  10363. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  10364. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  10365. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  10366. * AST is valid.
  10367. *
  10368. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  10369. * |-------------------------------------------------------------------------|
  10370. * | SW peer ID | VDEV ID | msg type |
  10371. * |-------------------------------------------------------------------------|
  10372. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10373. * |-------------------------------------------------------------------------|
  10374. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10375. * |-------------------------------------------------------------------------|
  10376. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  10377. * |-------------------------------------------------------------------------|
  10378. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  10379. * |-------------------------------------------------------------------------|
  10380. * |TID valid low pri| TID valid hi pri | AST index 2 |
  10381. * |-------------------------------------------------------------------------|
  10382. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  10383. * |-------------------------------------------------------------------------|
  10384. * | Reserved_2 |
  10385. * |-------------------------------------------------------------------------|
  10386. * Where:
  10387. * NH = Next Hop
  10388. * ASTVM = AST valid mask
  10389. * OA = on-chip AST valid bit
  10390. * ASTFM = AST flow mask
  10391. *
  10392. * The following field definitions describe the format of the rx peer map v2
  10393. * messages sent from the target to the host.
  10394. * - MSG_TYPE
  10395. * Bits 7:0
  10396. * Purpose: identifies this as an rx peer map v2 message
  10397. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  10398. * - VDEV_ID
  10399. * Bits 15:8
  10400. * Purpose: Indicates which virtual device the peer is associated with.
  10401. * Value: vdev ID (used in the host to look up the vdev object)
  10402. * - SW_PEER_ID
  10403. * Bits 31:16
  10404. * Purpose: The peer ID (index) that WAL is allocating
  10405. * Value: (rx) peer ID
  10406. * - MAC_ADDR_L32
  10407. * Bits 31:0
  10408. * Purpose: Identifies which peer node the peer ID is for.
  10409. * Value: lower 4 bytes of peer node's MAC address
  10410. * - MAC_ADDR_U16
  10411. * Bits 15:0
  10412. * Purpose: Identifies which peer node the peer ID is for.
  10413. * Value: upper 2 bytes of peer node's MAC address
  10414. * - HW_PEER_ID / AST_INDEX_0
  10415. * Bits 31:16
  10416. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10417. * address, so for rx frames marked for rx --> tx forwarding, the
  10418. * host can determine from the HW peer ID provided as meta-data with
  10419. * the rx frame which peer the frame is supposed to be forwarded to.
  10420. * Value: ID used by the MAC HW to identify the peer
  10421. * - AST_HASH_VALUE
  10422. * Bits 15:0
  10423. * Purpose: Indicates AST Hash value is required for the TCL AST index
  10424. * override feature.
  10425. * - NEXT_HOP
  10426. * Bit 16
  10427. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  10428. * (Wireless Distribution System).
  10429. * - AST_VALID_MASK
  10430. * Bits 19:17
  10431. * Purpose: Indicate if the AST 1 through AST 3 are valid
  10432. * - ONCHIP_AST_VALID_FLAG
  10433. * Bit 20
  10434. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  10435. * is valid.
  10436. * - AST_INDEX_1
  10437. * Bits 15:0
  10438. * Purpose: indicate the second AST index for this peer
  10439. * - AST_0_FLOW_MASK
  10440. * Bits 19:16
  10441. * Purpose: identify the which flow the AST 0 entry corresponds to.
  10442. * - AST_1_FLOW_MASK
  10443. * Bits 23:20
  10444. * Purpose: identify the which flow the AST 1 entry corresponds to.
  10445. * - AST_2_FLOW_MASK
  10446. * Bits 27:24
  10447. * Purpose: identify the which flow the AST 2 entry corresponds to.
  10448. * - AST_3_FLOW_MASK
  10449. * Bits 31:28
  10450. * Purpose: identify the which flow the AST 3 entry corresponds to.
  10451. * - AST_INDEX_2
  10452. * Bits 15:0
  10453. * Purpose: indicate the third AST index for this peer
  10454. * - TID_VALID_HI_PRI
  10455. * Bits 23:16
  10456. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  10457. * - TID_VALID_LOW_PRI
  10458. * Bits 31:24
  10459. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  10460. * - AST_INDEX_3
  10461. * Bits 15:0
  10462. * Purpose: indicate the fourth AST index for this peer
  10463. * - ONCHIP_AST_IDX / RESERVED
  10464. * Bits 31:16
  10465. * Purpose: This field is valid only when split AST feature is enabled.
  10466. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  10467. * If valid, identifies the HW peer ID corresponding to the peer MAC
  10468. * address, this ast_idx is used for LMAC modules for RXPCU.
  10469. * Value: ID used by the LMAC HW to identify the peer
  10470. */
  10471. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  10472. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  10473. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  10474. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  10475. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  10476. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  10477. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  10478. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  10479. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  10480. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  10481. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  10482. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  10483. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  10484. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  10485. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  10486. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  10487. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  10488. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  10489. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  10490. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  10491. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  10492. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  10493. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  10494. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  10495. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  10496. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  10497. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  10498. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  10499. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  10500. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  10501. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  10502. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  10503. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  10504. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  10505. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  10506. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  10507. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  10508. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  10509. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  10510. do { \
  10511. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  10512. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  10513. } while (0)
  10514. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  10515. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  10516. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  10517. do { \
  10518. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  10519. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  10520. } while (0)
  10521. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  10522. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  10523. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  10524. do { \
  10525. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  10526. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  10527. } while (0)
  10528. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  10529. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  10530. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  10531. do { \
  10532. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  10533. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  10534. } while (0)
  10535. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  10536. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  10537. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  10538. do { \
  10539. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  10540. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  10541. } while (0)
  10542. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  10543. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  10544. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  10545. do { \
  10546. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  10547. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  10548. } while (0)
  10549. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  10550. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  10551. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  10552. do { \
  10553. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  10554. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  10555. } while (0)
  10556. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  10557. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  10558. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  10559. do { \
  10560. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  10561. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  10562. } while (0)
  10563. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  10564. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  10565. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  10566. do { \
  10567. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  10568. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  10569. } while (0)
  10570. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  10571. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  10572. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  10573. do { \
  10574. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  10575. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  10576. } while (0)
  10577. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  10578. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  10579. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  10580. do { \
  10581. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  10582. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  10583. } while (0)
  10584. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  10585. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  10586. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  10587. do { \
  10588. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  10589. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  10590. } while (0)
  10591. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  10592. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  10593. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  10594. do { \
  10595. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  10596. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  10597. } while (0)
  10598. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  10599. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  10600. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  10601. do { \
  10602. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  10603. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  10604. } while (0)
  10605. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  10606. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  10607. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  10608. do { \
  10609. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  10610. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  10611. } while (0)
  10612. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  10613. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  10614. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  10615. do { \
  10616. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  10617. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  10618. } while (0)
  10619. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  10620. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  10621. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  10622. do { \
  10623. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  10624. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  10625. } while (0)
  10626. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  10627. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  10628. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10629. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  10630. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  10631. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  10632. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  10633. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  10634. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  10635. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  10636. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  10637. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  10638. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  10639. #define HTT_RX_PEER_MAP_V2_BYTES 32
  10640. /**
  10641. * @brief target -> host rx peer map V3 message definition
  10642. *
  10643. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  10644. *
  10645. * @details
  10646. * The following diagram shows the format of the rx peer map v3 message sent
  10647. * from the target to the host.
  10648. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  10649. * This layout assumes the target operates as little-endian.
  10650. *
  10651. * |31 24|23 20|19|18|17|16|15 8|7 0|
  10652. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  10653. * | SW peer ID | VDEV ID | msg type |
  10654. * |-----------------+--------------------+-----------------+-----------------|
  10655. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10656. * |-----------------+--------------------+-----------------+-----------------|
  10657. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  10658. * |-----------------+--------+-----------+-----------------+-----------------|
  10659. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  10660. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  10661. * | (8bits) | | (4bits) | |
  10662. * |-----------------+--------+--+--+--+--------------------------------------|
  10663. * | RESERVED |E |O | | |
  10664. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  10665. * | |V |V | | |
  10666. * |-----------------+--------------------+-----------------------------------|
  10667. * | HTT_MSDU_IDX_ | RESERVED | |
  10668. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  10669. * | (8bits) | | |
  10670. * |-----------------+--------------------+-----------------------------------|
  10671. * | Reserved_2 |
  10672. * |--------------------------------------------------------------------------|
  10673. * | Reserved_3 |
  10674. * |--------------------------------------------------------------------------|
  10675. *
  10676. * Where:
  10677. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  10678. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  10679. * NH = Next Hop
  10680. * The following field definitions describe the format of the rx peer map v3
  10681. * messages sent from the target to the host.
  10682. * - MSG_TYPE
  10683. * Bits 7:0
  10684. * Purpose: identifies this as a peer map v3 message
  10685. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  10686. * - VDEV_ID
  10687. * Bits 15:8
  10688. * Purpose: Indicates which virtual device the peer is associated with.
  10689. * - SW_PEER_ID
  10690. * Bits 31:16
  10691. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  10692. * - MAC_ADDR_L32
  10693. * Bits 31:0
  10694. * Purpose: Identifies which peer node the peer ID is for.
  10695. * Value: lower 4 bytes of peer node's MAC address
  10696. * - MAC_ADDR_U16
  10697. * Bits 15:0
  10698. * Purpose: Identifies which peer node the peer ID is for.
  10699. * Value: upper 2 bytes of peer node's MAC address
  10700. * - MULTICAST_SW_PEER_ID
  10701. * Bits 31:16
  10702. * Purpose: The multicast peer ID (index)
  10703. * Value: set to HTT_INVALID_PEER if not valid
  10704. * - HW_PEER_ID / AST_INDEX
  10705. * Bits 15:0
  10706. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10707. * address, so for rx frames marked for rx --> tx forwarding, the
  10708. * host can determine from the HW peer ID provided as meta-data with
  10709. * the rx frame which peer the frame is supposed to be forwarded to.
  10710. * - CACHE_SET_NUM
  10711. * Bits 19:16
  10712. * Purpose: Cache Set Number for AST_INDEX
  10713. * Cache set number that should be used to cache the index based
  10714. * search results, for address and flow search.
  10715. * This value should be equal to LSB 4 bits of the hash value
  10716. * of match data, in case of search index points to an entry which
  10717. * may be used in content based search also. The value can be
  10718. * anything when the entry pointed by search index will not be
  10719. * used for content based search.
  10720. * - HTT_MSDU_IDX_VALID_MASK
  10721. * Bits 31:24
  10722. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  10723. * - ONCHIP_AST_IDX / RESERVED
  10724. * Bits 15:0
  10725. * Purpose: This field is valid only when split AST feature is enabled.
  10726. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  10727. * If valid, identifies the HW peer ID corresponding to the peer MAC
  10728. * address, this ast_idx is used for LMAC modules for RXPCU.
  10729. * - NEXT_HOP
  10730. * Bits 16
  10731. * Purpose: Flag indicates next_hop AST entry used for WDS
  10732. * (Wireless Distribution System).
  10733. * - ONCHIP_AST_VALID
  10734. * Bits 17
  10735. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  10736. * - EXT_AST_VALID
  10737. * Bits 18
  10738. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  10739. * - EXT_AST_INDEX
  10740. * Bits 15:0
  10741. * Purpose: This field describes Extended AST index
  10742. * Valid if EXT_AST_VALID flag set
  10743. * - HTT_MSDU_IDX_VALID_MASK_EXT
  10744. * Bits 31:24
  10745. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  10746. */
  10747. /* dword 0 */
  10748. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  10749. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  10750. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  10751. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  10752. /* dword 1 */
  10753. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  10754. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  10755. /* dword 2 */
  10756. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  10757. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  10758. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  10759. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  10760. /* dword 3 */
  10761. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  10762. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  10763. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  10764. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  10765. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  10766. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  10767. /* dword 4 */
  10768. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  10769. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  10770. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  10771. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  10772. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  10773. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  10774. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  10775. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  10776. /* dword 5 */
  10777. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  10778. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  10779. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  10780. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  10781. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  10782. do { \
  10783. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  10784. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  10785. } while (0)
  10786. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  10787. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  10788. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  10789. do { \
  10790. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  10791. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  10792. } while (0)
  10793. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  10794. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  10795. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  10796. do { \
  10797. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  10798. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  10799. } while (0)
  10800. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  10801. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  10802. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  10803. do { \
  10804. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  10805. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  10806. } while (0)
  10807. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  10808. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  10809. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  10810. do { \
  10811. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  10812. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  10813. } while (0)
  10814. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  10815. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  10816. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  10817. do { \
  10818. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  10819. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  10820. } while (0)
  10821. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  10822. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  10823. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  10824. do { \
  10825. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  10826. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  10827. } while (0)
  10828. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  10829. (((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)
  10830. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  10831. do { \
  10832. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  10833. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  10834. } while (0)
  10835. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  10836. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  10837. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  10838. do { \
  10839. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  10840. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  10841. } while (0)
  10842. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  10843. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  10844. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  10845. do { \
  10846. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  10847. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  10848. } while (0)
  10849. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  10850. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  10851. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  10852. do { \
  10853. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  10854. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  10855. } while (0)
  10856. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  10857. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  10858. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  10859. do { \
  10860. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  10861. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  10862. } while (0)
  10863. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  10864. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  10865. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  10866. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  10867. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  10868. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  10869. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  10870. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  10871. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  10872. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10873. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10874. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  10875. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  10876. #define HTT_RX_PEER_MAP_V3_BYTES 32
  10877. /**
  10878. * @brief target -> host rx peer unmap V2 message definition
  10879. *
  10880. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  10881. *
  10882. * The following diagram shows the format of the rx peer unmap message sent
  10883. * from the target to the host.
  10884. *
  10885. * |31 24|23 16|15 8|7 0|
  10886. * |-----------------------------------------------------------------------|
  10887. * | SW peer ID | VDEV ID | msg type |
  10888. * |-----------------------------------------------------------------------|
  10889. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10890. * |-----------------------------------------------------------------------|
  10891. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  10892. * |-----------------------------------------------------------------------|
  10893. * | Peer Delete Duration |
  10894. * |-----------------------------------------------------------------------|
  10895. * | Reserved_0 | WDS Free Count |
  10896. * |-----------------------------------------------------------------------|
  10897. * | Reserved_1 |
  10898. * |-----------------------------------------------------------------------|
  10899. * | Reserved_2 |
  10900. * |-----------------------------------------------------------------------|
  10901. *
  10902. *
  10903. * The following field definitions describe the format of the rx peer unmap
  10904. * messages sent from the target to the host.
  10905. * - MSG_TYPE
  10906. * Bits 7:0
  10907. * Purpose: identifies this as an rx peer unmap v2 message
  10908. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  10909. * - VDEV_ID
  10910. * Bits 15:8
  10911. * Purpose: Indicates which virtual device the peer is associated
  10912. * with.
  10913. * Value: vdev ID (used in the host to look up the vdev object)
  10914. * - SW_PEER_ID
  10915. * Bits 31:16
  10916. * Purpose: The peer ID (index) that WAL is freeing
  10917. * Value: (rx) peer ID
  10918. * - MAC_ADDR_L32
  10919. * Bits 31:0
  10920. * Purpose: Identifies which peer node the peer ID is for.
  10921. * Value: lower 4 bytes of peer node's MAC address
  10922. * - MAC_ADDR_U16
  10923. * Bits 15:0
  10924. * Purpose: Identifies which peer node the peer ID is for.
  10925. * Value: upper 2 bytes of peer node's MAC address
  10926. * - NEXT_HOP
  10927. * Bits 16
  10928. * Purpose: Bit indicates next_hop AST entry used for WDS
  10929. * (Wireless Distribution System).
  10930. * - PEER_DELETE_DURATION
  10931. * Bits 31:0
  10932. * Purpose: Time taken to delete peer, in msec,
  10933. * Used for monitoring / debugging PEER delete response delay
  10934. * - PEER_WDS_FREE_COUNT
  10935. * Bits 15:0
  10936. * Purpose: Count of WDS entries deleted associated to peer deleted
  10937. */
  10938. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  10939. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  10940. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  10941. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  10942. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  10943. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  10944. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  10945. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  10946. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  10947. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  10948. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  10949. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  10950. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  10951. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  10952. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  10953. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  10954. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  10955. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  10956. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  10957. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  10958. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  10959. do { \
  10960. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  10961. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  10962. } while (0)
  10963. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  10964. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  10965. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  10966. do { \
  10967. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  10968. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  10969. } while (0)
  10970. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  10971. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  10972. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10973. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  10974. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  10975. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  10976. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  10977. /**
  10978. * @brief target -> host rx peer mlo map message definition
  10979. *
  10980. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  10981. *
  10982. * @details
  10983. * The following diagram shows the format of the rx mlo peer map message sent
  10984. * from the target to the host. This layout assumes the target operates
  10985. * as little-endian.
  10986. *
  10987. * MCC:
  10988. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  10989. *
  10990. * WIN:
  10991. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  10992. * It will be sent on the Assoc Link.
  10993. *
  10994. * This message always contains a MLO peer ID. The main purpose of the
  10995. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  10996. * with, so that the host can use that MLO peer ID to determine which peer
  10997. * transmitted the rx frame.
  10998. *
  10999. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  11000. * |-------------------------------------------------------------------------|
  11001. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  11002. * |-------------------------------------------------------------------------|
  11003. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11004. * |-------------------------------------------------------------------------|
  11005. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  11006. * |-------------------------------------------------------------------------|
  11007. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  11008. * |-------------------------------------------------------------------------|
  11009. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  11010. * |-------------------------------------------------------------------------|
  11011. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  11012. * |-------------------------------------------------------------------------|
  11013. * |RSVD |
  11014. * |-------------------------------------------------------------------------|
  11015. * |RSVD |
  11016. * |-------------------------------------------------------------------------|
  11017. * | htt_tlv_hdr_t |
  11018. * |-------------------------------------------------------------------------|
  11019. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11020. * |-------------------------------------------------------------------------|
  11021. * | htt_tlv_hdr_t |
  11022. * |-------------------------------------------------------------------------|
  11023. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11024. * |-------------------------------------------------------------------------|
  11025. * | htt_tlv_hdr_t |
  11026. * |-------------------------------------------------------------------------|
  11027. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11028. * |-------------------------------------------------------------------------|
  11029. *
  11030. * Where:
  11031. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  11032. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  11033. * V (valid) - 1 Bit Bit17
  11034. * CHIPID - 3 Bits
  11035. * TIDMASK - 8 Bits
  11036. * CACHE_SET_NUM - 8 Bits
  11037. *
  11038. * The following field definitions describe the format of the rx MLO peer map
  11039. * messages sent from the target to the host.
  11040. * - MSG_TYPE
  11041. * Bits 7:0
  11042. * Purpose: identifies this as an rx mlo peer map message
  11043. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  11044. *
  11045. * - MLO_PEER_ID
  11046. * Bits 23:8
  11047. * Purpose: The MLO peer ID (index).
  11048. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  11049. * Value: MLO peer ID
  11050. *
  11051. * - NUMLINK
  11052. * Bits: 26:24 (3Bits)
  11053. * Purpose: Indicate the max number of logical links supported per client.
  11054. * Value: number of logical links
  11055. *
  11056. * - PRC
  11057. * Bits: 29:27 (3Bits)
  11058. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  11059. * if there is migration of the primary chip.
  11060. * Value: Primary REO CHIPID
  11061. *
  11062. * - MAC_ADDR_L32
  11063. * Bits 31:0
  11064. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  11065. * Value: lower 4 bytes of peer node's MAC address
  11066. *
  11067. * - MAC_ADDR_U16
  11068. * Bits 15:0
  11069. * Purpose: Identifies which peer node the peer ID is for.
  11070. * Value: upper 2 bytes of peer node's MAC address
  11071. *
  11072. * - PRIMARY_TCL_AST_IDX
  11073. * Bits 15:0
  11074. * Purpose: Primary TCL AST index for this peer.
  11075. *
  11076. * - V
  11077. * 1 Bit Position 16
  11078. * Purpose: If the ast idx is valid.
  11079. *
  11080. * - CHIPID
  11081. * Bits 19:17
  11082. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  11083. *
  11084. * - TIDMASK
  11085. * Bits 27:20
  11086. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  11087. *
  11088. * - CACHE_SET_NUM
  11089. * Bits 31:28
  11090. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  11091. * Cache set number that should be used to cache the index based
  11092. * search results, for address and flow search.
  11093. * This value should be equal to LSB four bits of the hash value
  11094. * of match data, in case of search index points to an entry which
  11095. * may be used in content based search also. The value can be
  11096. * anything when the entry pointed by search index will not be
  11097. * used for content based search.
  11098. *
  11099. * - htt_tlv_hdr_t
  11100. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  11101. *
  11102. * Bits 11:0
  11103. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  11104. *
  11105. * Bits 23:12
  11106. * Purpose: Length, Length of the value that follows the header
  11107. *
  11108. * Bits 31:28
  11109. * Purpose: Reserved.
  11110. *
  11111. *
  11112. * - SW_PEER_ID
  11113. * Bits 15:0
  11114. * Purpose: The peer ID (index) that WAL is allocating
  11115. * Value: (rx) peer ID
  11116. *
  11117. * - VDEV_ID
  11118. * Bits 23:16
  11119. * Purpose: Indicates which virtual device the peer is associated with.
  11120. * Value: vdev ID (used in the host to look up the vdev object)
  11121. *
  11122. * - CHIPID
  11123. * Bits 26:24
  11124. * Purpose: Indicates which Chip id the peer is associated with.
  11125. * Value: chip ID (Provided by Host as part of QMI exchange)
  11126. */
  11127. typedef enum {
  11128. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  11129. } MLO_PEER_MAP_TLV_TAG_ID;
  11130. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  11131. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  11132. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  11133. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  11134. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  11135. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  11136. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11137. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  11138. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  11139. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  11140. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  11141. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  11142. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  11143. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  11144. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  11145. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  11146. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  11147. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  11148. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  11149. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  11150. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  11151. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  11152. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  11153. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  11154. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  11155. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  11156. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  11157. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  11158. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  11159. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  11160. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  11161. do { \
  11162. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  11163. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  11164. } while (0)
  11165. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  11166. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  11167. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  11168. do { \
  11169. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  11170. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  11171. } while (0)
  11172. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  11173. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  11174. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  11175. do { \
  11176. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  11177. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  11178. } while (0)
  11179. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  11180. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  11181. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  11182. do { \
  11183. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  11184. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  11185. } while (0)
  11186. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  11187. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  11188. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  11189. do { \
  11190. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  11191. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  11192. } while (0)
  11193. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  11194. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  11195. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  11196. do { \
  11197. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  11198. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  11199. } while (0)
  11200. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  11201. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  11202. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  11203. do { \
  11204. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  11205. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  11206. } while (0)
  11207. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  11208. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  11209. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  11210. do { \
  11211. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  11212. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  11213. } while (0)
  11214. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  11215. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  11216. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  11217. do { \
  11218. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  11219. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  11220. } while (0)
  11221. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  11222. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  11223. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  11224. do { \
  11225. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  11226. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  11227. } while (0)
  11228. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  11229. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  11230. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  11231. do { \
  11232. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  11233. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  11234. } while (0)
  11235. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  11236. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  11237. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  11238. do { \
  11239. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  11240. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  11241. } while (0)
  11242. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  11243. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  11244. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  11245. do { \
  11246. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  11247. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  11248. } while (0)
  11249. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  11250. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  11251. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11252. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  11253. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  11254. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  11255. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  11256. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  11257. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  11258. *
  11259. * The following diagram shows the format of the rx mlo peer unmap message sent
  11260. * from the target to the host.
  11261. *
  11262. * |31 24|23 16|15 8|7 0|
  11263. * |-----------------------------------------------------------------------|
  11264. * | RSVD_24_31 | MLO peer ID | msg type |
  11265. * |-----------------------------------------------------------------------|
  11266. */
  11267. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  11268. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  11269. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  11270. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  11271. /**
  11272. * @brief target -> host message specifying security parameters
  11273. *
  11274. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  11275. *
  11276. * @details
  11277. * The following diagram shows the format of the security specification
  11278. * message sent from the target to the host.
  11279. * This security specification message tells the host whether a PN check is
  11280. * necessary on rx data frames, and if so, how large the PN counter is.
  11281. * This message also tells the host about the security processing to apply
  11282. * to defragmented rx frames - specifically, whether a Message Integrity
  11283. * Check is required, and the Michael key to use.
  11284. *
  11285. * |31 24|23 16|15|14 8|7 0|
  11286. * |-----------------------------------------------------------------------|
  11287. * | peer ID | U| security type | msg type |
  11288. * |-----------------------------------------------------------------------|
  11289. * | Michael Key K0 |
  11290. * |-----------------------------------------------------------------------|
  11291. * | Michael Key K1 |
  11292. * |-----------------------------------------------------------------------|
  11293. * | WAPI RSC Low0 |
  11294. * |-----------------------------------------------------------------------|
  11295. * | WAPI RSC Low1 |
  11296. * |-----------------------------------------------------------------------|
  11297. * | WAPI RSC Hi0 |
  11298. * |-----------------------------------------------------------------------|
  11299. * | WAPI RSC Hi1 |
  11300. * |-----------------------------------------------------------------------|
  11301. *
  11302. * The following field definitions describe the format of the security
  11303. * indication message sent from the target to the host.
  11304. * - MSG_TYPE
  11305. * Bits 7:0
  11306. * Purpose: identifies this as a security specification message
  11307. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  11308. * - SEC_TYPE
  11309. * Bits 14:8
  11310. * Purpose: specifies which type of security applies to the peer
  11311. * Value: htt_sec_type enum value
  11312. * - UNICAST
  11313. * Bit 15
  11314. * Purpose: whether this security is applied to unicast or multicast data
  11315. * Value: 1 -> unicast, 0 -> multicast
  11316. * - PEER_ID
  11317. * Bits 31:16
  11318. * Purpose: The ID number for the peer the security specification is for
  11319. * Value: peer ID
  11320. * - MICHAEL_KEY_K0
  11321. * Bits 31:0
  11322. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  11323. * Value: Michael Key K0 (if security type is TKIP)
  11324. * - MICHAEL_KEY_K1
  11325. * Bits 31:0
  11326. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  11327. * Value: Michael Key K1 (if security type is TKIP)
  11328. * - WAPI_RSC_LOW0
  11329. * Bits 31:0
  11330. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  11331. * Value: WAPI RSC Low0 (if security type is WAPI)
  11332. * - WAPI_RSC_LOW1
  11333. * Bits 31:0
  11334. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  11335. * Value: WAPI RSC Low1 (if security type is WAPI)
  11336. * - WAPI_RSC_HI0
  11337. * Bits 31:0
  11338. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  11339. * Value: WAPI RSC Hi0 (if security type is WAPI)
  11340. * - WAPI_RSC_HI1
  11341. * Bits 31:0
  11342. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  11343. * Value: WAPI RSC Hi1 (if security type is WAPI)
  11344. */
  11345. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  11346. #define HTT_SEC_IND_SEC_TYPE_S 8
  11347. #define HTT_SEC_IND_UNICAST_M 0x00008000
  11348. #define HTT_SEC_IND_UNICAST_S 15
  11349. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  11350. #define HTT_SEC_IND_PEER_ID_S 16
  11351. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  11352. do { \
  11353. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  11354. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  11355. } while (0)
  11356. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  11357. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  11358. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  11359. do { \
  11360. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  11361. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  11362. } while (0)
  11363. #define HTT_SEC_IND_UNICAST_GET(word) \
  11364. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  11365. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  11366. do { \
  11367. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  11368. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  11369. } while (0)
  11370. #define HTT_SEC_IND_PEER_ID_GET(word) \
  11371. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  11372. #define HTT_SEC_IND_BYTES 28
  11373. /**
  11374. * @brief target -> host rx ADDBA / DELBA message definitions
  11375. *
  11376. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  11377. *
  11378. * @details
  11379. * The following diagram shows the format of the rx ADDBA message sent
  11380. * from the target to the host:
  11381. *
  11382. * |31 20|19 16|15 8|7 0|
  11383. * |---------------------------------------------------------------------|
  11384. * | peer ID | TID | window size | msg type |
  11385. * |---------------------------------------------------------------------|
  11386. *
  11387. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  11388. *
  11389. * The following diagram shows the format of the rx DELBA message sent
  11390. * from the target to the host:
  11391. *
  11392. * |31 20|19 16|15 10|9 8|7 0|
  11393. * |---------------------------------------------------------------------|
  11394. * | peer ID | TID | window size | IR| msg type |
  11395. * |---------------------------------------------------------------------|
  11396. *
  11397. * The following field definitions describe the format of the rx ADDBA
  11398. * and DELBA messages sent from the target to the host.
  11399. * - MSG_TYPE
  11400. * Bits 7:0
  11401. * Purpose: identifies this as an rx ADDBA or DELBA message
  11402. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  11403. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  11404. * - IR (initiator / recipient)
  11405. * Bits 9:8 (DELBA only)
  11406. * Purpose: specify whether the DELBA handshake was initiated by the
  11407. * local STA/AP, or by the peer STA/AP
  11408. * Value:
  11409. * 0 - unspecified
  11410. * 1 - initiator (a.k.a. originator)
  11411. * 2 - recipient (a.k.a. responder)
  11412. * 3 - unused / reserved
  11413. * - WIN_SIZE
  11414. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  11415. * Purpose: Specifies the length of the block ack window (max = 64).
  11416. * Value:
  11417. * block ack window length specified by the received ADDBA/DELBA
  11418. * management message.
  11419. * - TID
  11420. * Bits 19:16
  11421. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  11422. * Value:
  11423. * TID specified by the received ADDBA or DELBA management message.
  11424. * - PEER_ID
  11425. * Bits 31:20
  11426. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  11427. * Value:
  11428. * ID (hash value) used by the host for fast, direct lookup of
  11429. * host SW peer info, including rx reorder states.
  11430. */
  11431. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  11432. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  11433. #define HTT_RX_ADDBA_TID_M 0xf0000
  11434. #define HTT_RX_ADDBA_TID_S 16
  11435. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  11436. #define HTT_RX_ADDBA_PEER_ID_S 20
  11437. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  11438. do { \
  11439. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  11440. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  11441. } while (0)
  11442. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  11443. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  11444. #define HTT_RX_ADDBA_TID_SET(word, value) \
  11445. do { \
  11446. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  11447. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  11448. } while (0)
  11449. #define HTT_RX_ADDBA_TID_GET(word) \
  11450. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  11451. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  11452. do { \
  11453. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  11454. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  11455. } while (0)
  11456. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  11457. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  11458. #define HTT_RX_ADDBA_BYTES 4
  11459. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  11460. #define HTT_RX_DELBA_INITIATOR_S 8
  11461. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  11462. #define HTT_RX_DELBA_WIN_SIZE_S 10
  11463. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  11464. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  11465. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  11466. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  11467. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  11468. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  11469. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  11470. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  11471. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  11472. do { \
  11473. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  11474. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  11475. } while (0)
  11476. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  11477. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  11478. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  11479. do { \
  11480. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  11481. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  11482. } while (0)
  11483. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  11484. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  11485. #define HTT_RX_DELBA_BYTES 4
  11486. /**
  11487. * @brief tx queue group information element definition
  11488. *
  11489. * @details
  11490. * The following diagram shows the format of the tx queue group
  11491. * information element, which can be included in target --> host
  11492. * messages to specify the number of tx "credits" (tx descriptors
  11493. * for LL, or tx buffers for HL) available to a particular group
  11494. * of host-side tx queues, and which host-side tx queues belong to
  11495. * the group.
  11496. *
  11497. * |31|30 24|23 16|15|14|13 0|
  11498. * |------------------------------------------------------------------------|
  11499. * | X| reserved | tx queue grp ID | A| S| credit count |
  11500. * |------------------------------------------------------------------------|
  11501. * | vdev ID mask | AC mask |
  11502. * |------------------------------------------------------------------------|
  11503. *
  11504. * The following definitions describe the fields within the tx queue group
  11505. * information element:
  11506. * - credit_count
  11507. * Bits 13:1
  11508. * Purpose: specify how many tx credits are available to the tx queue group
  11509. * Value: An absolute or relative, positive or negative credit value
  11510. * The 'A' bit specifies whether the value is absolute or relative.
  11511. * The 'S' bit specifies whether the value is positive or negative.
  11512. * A negative value can only be relative, not absolute.
  11513. * An absolute value replaces any prior credit value the host has for
  11514. * the tx queue group in question.
  11515. * A relative value is added to the prior credit value the host has for
  11516. * the tx queue group in question.
  11517. * - sign
  11518. * Bit 14
  11519. * Purpose: specify whether the credit count is positive or negative
  11520. * Value: 0 -> positive, 1 -> negative
  11521. * - absolute
  11522. * Bit 15
  11523. * Purpose: specify whether the credit count is absolute or relative
  11524. * Value: 0 -> relative, 1 -> absolute
  11525. * - txq_group_id
  11526. * Bits 23:16
  11527. * Purpose: indicate which tx queue group's credit and/or membership are
  11528. * being specified
  11529. * Value: 0 to max_tx_queue_groups-1
  11530. * - reserved
  11531. * Bits 30:16
  11532. * Value: 0x0
  11533. * - eXtension
  11534. * Bit 31
  11535. * Purpose: specify whether another tx queue group info element follows
  11536. * Value: 0 -> no more tx queue group information elements
  11537. * 1 -> another tx queue group information element immediately follows
  11538. * - ac_mask
  11539. * Bits 15:0
  11540. * Purpose: specify which Access Categories belong to the tx queue group
  11541. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  11542. * the tx queue group.
  11543. * The AC bit-mask values are obtained by left-shifting by the
  11544. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  11545. * - vdev_id_mask
  11546. * Bits 31:16
  11547. * Purpose: specify which vdev's tx queues belong to the tx queue group
  11548. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  11549. * belong to the tx queue group.
  11550. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  11551. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  11552. */
  11553. PREPACK struct htt_txq_group {
  11554. A_UINT32
  11555. credit_count: 14,
  11556. sign: 1,
  11557. absolute: 1,
  11558. tx_queue_group_id: 8,
  11559. reserved0: 7,
  11560. extension: 1;
  11561. A_UINT32
  11562. ac_mask: 16,
  11563. vdev_id_mask: 16;
  11564. } POSTPACK;
  11565. /* first word */
  11566. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  11567. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  11568. #define HTT_TXQ_GROUP_SIGN_S 14
  11569. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  11570. #define HTT_TXQ_GROUP_ABS_S 15
  11571. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  11572. #define HTT_TXQ_GROUP_ID_S 16
  11573. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  11574. #define HTT_TXQ_GROUP_EXT_S 31
  11575. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  11576. /* second word */
  11577. #define HTT_TXQ_GROUP_AC_MASK_S 0
  11578. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  11579. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  11580. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  11581. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  11582. do { \
  11583. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  11584. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  11585. } while (0)
  11586. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  11587. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  11588. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  11589. do { \
  11590. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  11591. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  11592. } while (0)
  11593. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  11594. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  11595. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  11596. do { \
  11597. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  11598. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  11599. } while (0)
  11600. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  11601. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  11602. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  11603. do { \
  11604. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  11605. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  11606. } while (0)
  11607. #define HTT_TXQ_GROUP_ID_GET(_info) \
  11608. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  11609. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  11610. do { \
  11611. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  11612. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  11613. } while (0)
  11614. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  11615. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  11616. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  11617. do { \
  11618. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  11619. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  11620. } while (0)
  11621. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  11622. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  11623. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  11624. do { \
  11625. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  11626. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  11627. } while (0)
  11628. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  11629. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  11630. /**
  11631. * @brief target -> host TX completion indication message definition
  11632. *
  11633. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  11634. *
  11635. * @details
  11636. * The following diagram shows the format of the TX completion indication sent
  11637. * from the target to the host
  11638. *
  11639. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  11640. * |-------------------------------------------------------------------|
  11641. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  11642. * |-------------------------------------------------------------------|
  11643. * payload:| MSDU1 ID | MSDU0 ID |
  11644. * |-------------------------------------------------------------------|
  11645. * : MSDU3 ID | MSDU2 ID :
  11646. * |-------------------------------------------------------------------|
  11647. * | struct htt_tx_compl_ind_append_retries |
  11648. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11649. * | struct htt_tx_compl_ind_append_tx_tstamp |
  11650. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11651. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  11652. * |-------------------------------------------------------------------|
  11653. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  11654. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11655. * | MSDU0 tx_tsf64_low |
  11656. * |-------------------------------------------------------------------|
  11657. * | MSDU0 tx_tsf64_high |
  11658. * |-------------------------------------------------------------------|
  11659. * | MSDU1 tx_tsf64_low |
  11660. * |-------------------------------------------------------------------|
  11661. * | MSDU1 tx_tsf64_high |
  11662. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11663. * | phy_timestamp |
  11664. * |-------------------------------------------------------------------|
  11665. * | rate specs (see below) |
  11666. * |-------------------------------------------------------------------|
  11667. * | seqctrl | framectrl |
  11668. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11669. * Where:
  11670. * A0 = append (a.k.a. append0)
  11671. * A1 = append1
  11672. * TP = MSDU tx power presence
  11673. * A2 = append2
  11674. * A3 = append3
  11675. * A4 = append4
  11676. *
  11677. * The following field definitions describe the format of the TX completion
  11678. * indication sent from the target to the host
  11679. * Header fields:
  11680. * - msg_type
  11681. * Bits 7:0
  11682. * Purpose: identifies this as HTT TX completion indication
  11683. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  11684. * - status
  11685. * Bits 10:8
  11686. * Purpose: the TX completion status of payload fragmentations descriptors
  11687. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  11688. * - tid
  11689. * Bits 14:11
  11690. * Purpose: the tid associated with those fragmentation descriptors. It is
  11691. * valid or not, depending on the tid_invalid bit.
  11692. * Value: 0 to 15
  11693. * - tid_invalid
  11694. * Bits 15:15
  11695. * Purpose: this bit indicates whether the tid field is valid or not
  11696. * Value: 0 indicates valid; 1 indicates invalid
  11697. * - num
  11698. * Bits 23:16
  11699. * Purpose: the number of payload in this indication
  11700. * Value: 1 to 255
  11701. * - append (a.k.a. append0)
  11702. * Bits 24:24
  11703. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  11704. * the number of tx retries for one MSDU at the end of this message
  11705. * Value: 0 indicates no appending; 1 indicates appending
  11706. * - append1
  11707. * Bits 25:25
  11708. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  11709. * contains the timestamp info for each TX msdu id in payload.
  11710. * The order of the timestamps matches the order of the MSDU IDs.
  11711. * Note that a big-endian host needs to account for the reordering
  11712. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  11713. * conversion) when determining which tx timestamp corresponds to
  11714. * which MSDU ID.
  11715. * Value: 0 indicates no appending; 1 indicates appending
  11716. * - msdu_tx_power_presence
  11717. * Bits 26:26
  11718. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  11719. * for each MSDU referenced by the TX_COMPL_IND message.
  11720. * The tx power is reported in 0.5 dBm units.
  11721. * The order of the per-MSDU tx power reports matches the order
  11722. * of the MSDU IDs.
  11723. * Note that a big-endian host needs to account for the reordering
  11724. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  11725. * conversion) when determining which Tx Power corresponds to
  11726. * which MSDU ID.
  11727. * Value: 0 indicates MSDU tx power reports are not appended,
  11728. * 1 indicates MSDU tx power reports are appended
  11729. * - append2
  11730. * Bits 27:27
  11731. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  11732. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  11733. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  11734. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  11735. * for each MSDU, for convenience.
  11736. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  11737. * this append2 bit is set).
  11738. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  11739. * dB above the noise floor.
  11740. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  11741. * 1 indicates MSDU ACK RSSI values are appended.
  11742. * - append3
  11743. * Bits 28:28
  11744. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  11745. * contains the tx tsf info based on wlan global TSF for
  11746. * each TX msdu id in payload.
  11747. * The order of the tx tsf matches the order of the MSDU IDs.
  11748. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  11749. * values to indicate the the lower 32 bits and higher 32 bits of
  11750. * the tx tsf.
  11751. * The tx_tsf64 here represents the time MSDU was acked and the
  11752. * tx_tsf64 has microseconds units.
  11753. * Value: 0 indicates no appending; 1 indicates appending
  11754. * - append4
  11755. * Bits 29:29
  11756. * Purpose: Indicate whether data frame control fields and fields required
  11757. * for radio tap header are appended for each MSDU in TX_COMP_IND
  11758. * message. The order of the this message matches the order of
  11759. * the MSDU IDs.
  11760. * Value: 0 indicates frame control fields and fields required for
  11761. * radio tap header values are not appended,
  11762. * 1 indicates frame control fields and fields required for
  11763. * radio tap header values are appended.
  11764. * Payload fields:
  11765. * - hmsdu_id
  11766. * Bits 15:0
  11767. * Purpose: this ID is used to track the Tx buffer in host
  11768. * Value: 0 to "size of host MSDU descriptor pool - 1"
  11769. */
  11770. PREPACK struct htt_tx_data_hdr_information {
  11771. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  11772. A_UINT32 /* word 1 */
  11773. /* preamble:
  11774. * 0-OFDM,
  11775. * 1-CCk,
  11776. * 2-HT,
  11777. * 3-VHT
  11778. */
  11779. preamble: 2, /* [1:0] */
  11780. /* mcs:
  11781. * In case of HT preamble interpret
  11782. * MCS along with NSS.
  11783. * Valid values for HT are 0 to 7.
  11784. * HT mcs 0 with NSS 2 is mcs 8.
  11785. * Valid values for VHT are 0 to 9.
  11786. */
  11787. mcs: 4, /* [5:2] */
  11788. /* rate:
  11789. * This is applicable only for
  11790. * CCK and OFDM preamble type
  11791. * rate 0: OFDM 48 Mbps,
  11792. * 1: OFDM 24 Mbps,
  11793. * 2: OFDM 12 Mbps
  11794. * 3: OFDM 6 Mbps
  11795. * 4: OFDM 54 Mbps
  11796. * 5: OFDM 36 Mbps
  11797. * 6: OFDM 18 Mbps
  11798. * 7: OFDM 9 Mbps
  11799. * rate 0: CCK 11 Mbps Long
  11800. * 1: CCK 5.5 Mbps Long
  11801. * 2: CCK 2 Mbps Long
  11802. * 3: CCK 1 Mbps Long
  11803. * 4: CCK 11 Mbps Short
  11804. * 5: CCK 5.5 Mbps Short
  11805. * 6: CCK 2 Mbps Short
  11806. */
  11807. rate : 3, /* [ 8: 6] */
  11808. rssi : 8, /* [16: 9] units=dBm */
  11809. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  11810. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  11811. stbc : 1, /* [22] */
  11812. sgi : 1, /* [23] */
  11813. ldpc : 1, /* [24] */
  11814. beamformed: 1, /* [25] */
  11815. /* tx_retry_cnt:
  11816. * Indicates retry count of data tx frames provided by the host.
  11817. */
  11818. tx_retry_cnt: 6; /* [31:26] */
  11819. A_UINT32 /* word 2 */
  11820. framectrl:16, /* [15: 0] */
  11821. seqno:16; /* [31:16] */
  11822. } POSTPACK;
  11823. #define HTT_TX_COMPL_IND_STATUS_S 8
  11824. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  11825. #define HTT_TX_COMPL_IND_TID_S 11
  11826. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  11827. #define HTT_TX_COMPL_IND_TID_INV_S 15
  11828. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  11829. #define HTT_TX_COMPL_IND_NUM_S 16
  11830. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  11831. #define HTT_TX_COMPL_IND_APPEND_S 24
  11832. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  11833. #define HTT_TX_COMPL_IND_APPEND1_S 25
  11834. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  11835. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  11836. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  11837. #define HTT_TX_COMPL_IND_APPEND2_S 27
  11838. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  11839. #define HTT_TX_COMPL_IND_APPEND3_S 28
  11840. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  11841. #define HTT_TX_COMPL_IND_APPEND4_S 29
  11842. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  11843. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  11844. do { \
  11845. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  11846. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  11847. } while (0)
  11848. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  11849. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  11850. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  11851. do { \
  11852. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  11853. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  11854. } while (0)
  11855. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  11856. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  11857. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  11858. do { \
  11859. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  11860. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  11861. } while (0)
  11862. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  11863. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  11864. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  11865. do { \
  11866. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  11867. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  11868. } while (0)
  11869. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  11870. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  11871. HTT_TX_COMPL_IND_TID_INV_S)
  11872. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  11873. do { \
  11874. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  11875. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  11876. } while (0)
  11877. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  11878. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  11879. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  11880. do { \
  11881. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  11882. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  11883. } while (0)
  11884. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  11885. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  11886. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  11887. do { \
  11888. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  11889. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  11890. } while (0)
  11891. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  11892. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  11893. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  11894. do { \
  11895. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  11896. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  11897. } while (0)
  11898. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  11899. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  11900. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  11901. do { \
  11902. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  11903. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  11904. } while (0)
  11905. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  11906. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  11907. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  11908. do { \
  11909. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  11910. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  11911. } while (0)
  11912. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  11913. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  11914. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  11915. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  11916. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  11917. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  11918. #define HTT_TX_COMPL_IND_STAT_OK 0
  11919. /* DISCARD:
  11920. * current meaning:
  11921. * MSDUs were queued for transmission but filtered by HW or SW
  11922. * without any over the air attempts
  11923. * legacy meaning (HL Rome):
  11924. * MSDUs were discarded by the target FW without any over the air
  11925. * attempts due to lack of space
  11926. */
  11927. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  11928. /* NO_ACK:
  11929. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  11930. */
  11931. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  11932. /* POSTPONE:
  11933. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  11934. * be downloaded again later (in the appropriate order), when they are
  11935. * deliverable.
  11936. */
  11937. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  11938. /*
  11939. * The PEER_DEL tx completion status is used for HL cases
  11940. * where the peer the frame is for has been deleted.
  11941. * The host has already discarded its copy of the frame, but
  11942. * it still needs the tx completion to restore its credit.
  11943. */
  11944. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  11945. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  11946. #define HTT_TX_COMPL_IND_STAT_DROP 5
  11947. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  11948. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  11949. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  11950. PREPACK struct htt_tx_compl_ind_base {
  11951. A_UINT32 hdr;
  11952. A_UINT16 payload[1/*or more*/];
  11953. } POSTPACK;
  11954. PREPACK struct htt_tx_compl_ind_append_retries {
  11955. A_UINT16 msdu_id;
  11956. A_UINT8 tx_retries;
  11957. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  11958. 0: this is the last append_retries struct */
  11959. } POSTPACK;
  11960. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  11961. A_UINT32 timestamp[1/*or more*/];
  11962. } POSTPACK;
  11963. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  11964. A_UINT32 tx_tsf64_low;
  11965. A_UINT32 tx_tsf64_high;
  11966. } POSTPACK;
  11967. /* htt_tx_data_hdr_information payload extension fields: */
  11968. /* DWORD zero */
  11969. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  11970. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  11971. /* DWORD one */
  11972. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  11973. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  11974. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  11975. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  11976. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  11977. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  11978. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  11979. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  11980. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  11981. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  11982. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  11983. #define HTT_FW_TX_DATA_HDR_BW_S 19
  11984. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  11985. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  11986. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  11987. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  11988. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  11989. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  11990. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  11991. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  11992. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  11993. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  11994. /* DWORD two */
  11995. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  11996. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  11997. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  11998. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  11999. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  12000. do { \
  12001. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  12002. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  12003. } while (0)
  12004. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  12005. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  12006. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  12007. do { \
  12008. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  12009. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  12010. } while (0)
  12011. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  12012. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  12013. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  12014. do { \
  12015. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  12016. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  12017. } while (0)
  12018. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  12019. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  12020. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  12021. do { \
  12022. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  12023. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  12024. } while (0)
  12025. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  12026. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  12027. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  12028. do { \
  12029. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  12030. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  12031. } while (0)
  12032. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  12033. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  12034. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  12035. do { \
  12036. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  12037. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  12038. } while (0)
  12039. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  12040. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  12041. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  12042. do { \
  12043. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  12044. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  12045. } while (0)
  12046. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  12047. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  12048. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  12049. do { \
  12050. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  12051. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  12052. } while (0)
  12053. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  12054. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  12055. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  12056. do { \
  12057. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  12058. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  12059. } while (0)
  12060. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  12061. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  12062. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  12063. do { \
  12064. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  12065. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  12066. } while (0)
  12067. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  12068. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  12069. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  12070. do { \
  12071. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  12072. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  12073. } while (0)
  12074. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  12075. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  12076. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  12077. do { \
  12078. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  12079. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  12080. } while (0)
  12081. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  12082. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  12083. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  12084. do { \
  12085. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  12086. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  12087. } while (0)
  12088. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  12089. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  12090. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  12091. do { \
  12092. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  12093. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  12094. } while (0)
  12095. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  12096. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  12097. /**
  12098. * @brief target -> host rate-control update indication message
  12099. *
  12100. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  12101. *
  12102. * @details
  12103. * The following diagram shows the format of the RC Update message
  12104. * sent from the target to the host, while processing the tx-completion
  12105. * of a transmitted PPDU.
  12106. *
  12107. * |31 24|23 16|15 8|7 0|
  12108. * |-------------------------------------------------------------|
  12109. * | peer ID | vdev ID | msg_type |
  12110. * |-------------------------------------------------------------|
  12111. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12112. * |-------------------------------------------------------------|
  12113. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  12114. * |-------------------------------------------------------------|
  12115. * | : |
  12116. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12117. * | : |
  12118. * |-------------------------------------------------------------|
  12119. * | : |
  12120. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12121. * | : |
  12122. * |-------------------------------------------------------------|
  12123. * : :
  12124. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12125. *
  12126. */
  12127. typedef struct {
  12128. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  12129. A_UINT32 rate_code_flags;
  12130. A_UINT32 flags; /* Encodes information such as excessive
  12131. retransmission, aggregate, some info
  12132. from .11 frame control,
  12133. STBC, LDPC, (SGI and Tx Chain Mask
  12134. are encoded in ptx_rc->flags field),
  12135. AMPDU truncation (BT/time based etc.),
  12136. RTS/CTS attempt */
  12137. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  12138. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  12139. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  12140. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  12141. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  12142. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  12143. } HTT_RC_TX_DONE_PARAMS;
  12144. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  12145. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  12146. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  12147. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  12148. #define HTT_RC_UPDATE_VDEVID_S 8
  12149. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  12150. #define HTT_RC_UPDATE_PEERID_S 16
  12151. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  12152. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  12153. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  12154. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  12155. do { \
  12156. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  12157. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  12158. } while (0)
  12159. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  12160. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  12161. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  12162. do { \
  12163. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  12164. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  12165. } while (0)
  12166. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  12167. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  12168. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  12169. do { \
  12170. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  12171. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  12172. } while (0)
  12173. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  12174. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  12175. /**
  12176. * @brief target -> host rx fragment indication message definition
  12177. *
  12178. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  12179. *
  12180. * @details
  12181. * The following field definitions describe the format of the rx fragment
  12182. * indication message sent from the target to the host.
  12183. * The rx fragment indication message shares the format of the
  12184. * rx indication message, but not all fields from the rx indication message
  12185. * are relevant to the rx fragment indication message.
  12186. *
  12187. *
  12188. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  12189. * |-----------+-------------------+---------------------+-------------|
  12190. * | peer ID | |FV| ext TID | msg type |
  12191. * |-------------------------------------------------------------------|
  12192. * | | flush | flush |
  12193. * | | end | start |
  12194. * | | seq num | seq num |
  12195. * |-------------------------------------------------------------------|
  12196. * | reserved | FW rx desc bytes |
  12197. * |-------------------------------------------------------------------|
  12198. * | | FW MSDU Rx |
  12199. * | | desc B0 |
  12200. * |-------------------------------------------------------------------|
  12201. * Header fields:
  12202. * - MSG_TYPE
  12203. * Bits 7:0
  12204. * Purpose: identifies this as an rx fragment indication message
  12205. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  12206. * - EXT_TID
  12207. * Bits 12:8
  12208. * Purpose: identify the traffic ID of the rx data, including
  12209. * special "extended" TID values for multicast, broadcast, and
  12210. * non-QoS data frames
  12211. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  12212. * - FLUSH_VALID (FV)
  12213. * Bit 13
  12214. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  12215. * is valid
  12216. * Value:
  12217. * 1 -> flush IE is valid and needs to be processed
  12218. * 0 -> flush IE is not valid and should be ignored
  12219. * - PEER_ID
  12220. * Bits 31:16
  12221. * Purpose: Identify, by ID, which peer sent the rx data
  12222. * Value: ID of the peer who sent the rx data
  12223. * - FLUSH_SEQ_NUM_START
  12224. * Bits 5:0
  12225. * Purpose: Indicate the start of a series of MPDUs to flush
  12226. * Not all MPDUs within this series are necessarily valid - the host
  12227. * must check each sequence number within this range to see if the
  12228. * corresponding MPDU is actually present.
  12229. * This field is only valid if the FV bit is set.
  12230. * Value:
  12231. * The sequence number for the first MPDUs to check to flush.
  12232. * The sequence number is masked by 0x3f.
  12233. * - FLUSH_SEQ_NUM_END
  12234. * Bits 11:6
  12235. * Purpose: Indicate the end of a series of MPDUs to flush
  12236. * Value:
  12237. * The sequence number one larger than the sequence number of the
  12238. * last MPDU to check to flush.
  12239. * The sequence number is masked by 0x3f.
  12240. * Not all MPDUs within this series are necessarily valid - the host
  12241. * must check each sequence number within this range to see if the
  12242. * corresponding MPDU is actually present.
  12243. * This field is only valid if the FV bit is set.
  12244. * Rx descriptor fields:
  12245. * - FW_RX_DESC_BYTES
  12246. * Bits 15:0
  12247. * Purpose: Indicate how many bytes in the Rx indication are used for
  12248. * FW Rx descriptors
  12249. * Value: 1
  12250. */
  12251. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  12252. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  12253. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  12254. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  12255. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  12256. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  12257. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  12258. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  12259. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  12260. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  12261. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  12262. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  12263. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  12264. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  12265. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  12266. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  12267. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  12268. #define HTT_RX_FRAG_IND_BYTES \
  12269. (4 /* msg hdr */ + \
  12270. 4 /* flush spec */ + \
  12271. 4 /* (unused) FW rx desc bytes spec */ + \
  12272. 4 /* FW rx desc */)
  12273. /**
  12274. * @brief target -> host test message definition
  12275. *
  12276. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  12277. *
  12278. * @details
  12279. * The following field definitions describe the format of the test
  12280. * message sent from the target to the host.
  12281. * The message consists of a 4-octet header, followed by a variable
  12282. * number of 32-bit integer values, followed by a variable number
  12283. * of 8-bit character values.
  12284. *
  12285. * |31 16|15 8|7 0|
  12286. * |-----------------------------------------------------------|
  12287. * | num chars | num ints | msg type |
  12288. * |-----------------------------------------------------------|
  12289. * | int 0 |
  12290. * |-----------------------------------------------------------|
  12291. * | int 1 |
  12292. * |-----------------------------------------------------------|
  12293. * | ... |
  12294. * |-----------------------------------------------------------|
  12295. * | char 3 | char 2 | char 1 | char 0 |
  12296. * |-----------------------------------------------------------|
  12297. * | | | ... | char 4 |
  12298. * |-----------------------------------------------------------|
  12299. * - MSG_TYPE
  12300. * Bits 7:0
  12301. * Purpose: identifies this as a test message
  12302. * Value: HTT_MSG_TYPE_TEST
  12303. * - NUM_INTS
  12304. * Bits 15:8
  12305. * Purpose: indicate how many 32-bit integers follow the message header
  12306. * - NUM_CHARS
  12307. * Bits 31:16
  12308. * Purpose: indicate how many 8-bit charaters follow the series of integers
  12309. */
  12310. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  12311. #define HTT_RX_TEST_NUM_INTS_S 8
  12312. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  12313. #define HTT_RX_TEST_NUM_CHARS_S 16
  12314. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  12315. do { \
  12316. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  12317. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  12318. } while (0)
  12319. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  12320. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  12321. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  12322. do { \
  12323. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  12324. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  12325. } while (0)
  12326. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  12327. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  12328. /**
  12329. * @brief target -> host packet log message
  12330. *
  12331. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  12332. *
  12333. * @details
  12334. * The following field definitions describe the format of the packet log
  12335. * message sent from the target to the host.
  12336. * The message consists of a 4-octet header,followed by a variable number
  12337. * of 32-bit character values.
  12338. *
  12339. * |31 16|15 12|11 10|9 8|7 0|
  12340. * |------------------------------------------------------------------|
  12341. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  12342. * |------------------------------------------------------------------|
  12343. * | payload |
  12344. * |------------------------------------------------------------------|
  12345. * - MSG_TYPE
  12346. * Bits 7:0
  12347. * Purpose: identifies this as a pktlog message
  12348. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  12349. * - mac_id
  12350. * Bits 9:8
  12351. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  12352. * Value: 0-3
  12353. * - pdev_id
  12354. * Bits 11:10
  12355. * Purpose: pdev_id
  12356. * Value: 0-3
  12357. * 0 (for rings at SOC level),
  12358. * 1/2/3 PDEV -> 0/1/2
  12359. * - payload_size
  12360. * Bits 31:16
  12361. * Purpose: explicitly specify the payload size
  12362. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  12363. */
  12364. PREPACK struct htt_pktlog_msg {
  12365. A_UINT32 header;
  12366. A_UINT32 payload[1/* or more */];
  12367. } POSTPACK;
  12368. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  12369. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  12370. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  12371. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  12372. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  12373. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  12374. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  12375. do { \
  12376. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  12377. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  12378. } while (0)
  12379. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  12380. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  12381. HTT_T2H_PKTLOG_MAC_ID_S)
  12382. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  12383. do { \
  12384. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  12385. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  12386. } while (0)
  12387. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  12388. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  12389. HTT_T2H_PKTLOG_PDEV_ID_S)
  12390. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  12391. do { \
  12392. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  12393. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  12394. } while (0)
  12395. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  12396. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  12397. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  12398. /*
  12399. * Rx reorder statistics
  12400. * NB: all the fields must be defined in 4 octets size.
  12401. */
  12402. struct rx_reorder_stats {
  12403. /* Non QoS MPDUs received */
  12404. A_UINT32 deliver_non_qos;
  12405. /* MPDUs received in-order */
  12406. A_UINT32 deliver_in_order;
  12407. /* Flush due to reorder timer expired */
  12408. A_UINT32 deliver_flush_timeout;
  12409. /* Flush due to move out of window */
  12410. A_UINT32 deliver_flush_oow;
  12411. /* Flush due to DELBA */
  12412. A_UINT32 deliver_flush_delba;
  12413. /* MPDUs dropped due to FCS error */
  12414. A_UINT32 fcs_error;
  12415. /* MPDUs dropped due to monitor mode non-data packet */
  12416. A_UINT32 mgmt_ctrl;
  12417. /* Unicast-data MPDUs dropped due to invalid peer */
  12418. A_UINT32 invalid_peer;
  12419. /* MPDUs dropped due to duplication (non aggregation) */
  12420. A_UINT32 dup_non_aggr;
  12421. /* MPDUs dropped due to processed before */
  12422. A_UINT32 dup_past;
  12423. /* MPDUs dropped due to duplicate in reorder queue */
  12424. A_UINT32 dup_in_reorder;
  12425. /* Reorder timeout happened */
  12426. A_UINT32 reorder_timeout;
  12427. /* invalid bar ssn */
  12428. A_UINT32 invalid_bar_ssn;
  12429. /* reorder reset due to bar ssn */
  12430. A_UINT32 ssn_reset;
  12431. /* Flush due to delete peer */
  12432. A_UINT32 deliver_flush_delpeer;
  12433. /* Flush due to offload*/
  12434. A_UINT32 deliver_flush_offload;
  12435. /* Flush due to out of buffer*/
  12436. A_UINT32 deliver_flush_oob;
  12437. /* MPDUs dropped due to PN check fail */
  12438. A_UINT32 pn_fail;
  12439. /* MPDUs dropped due to unable to allocate memory */
  12440. A_UINT32 store_fail;
  12441. /* Number of times the tid pool alloc succeeded */
  12442. A_UINT32 tid_pool_alloc_succ;
  12443. /* Number of times the MPDU pool alloc succeeded */
  12444. A_UINT32 mpdu_pool_alloc_succ;
  12445. /* Number of times the MSDU pool alloc succeeded */
  12446. A_UINT32 msdu_pool_alloc_succ;
  12447. /* Number of times the tid pool alloc failed */
  12448. A_UINT32 tid_pool_alloc_fail;
  12449. /* Number of times the MPDU pool alloc failed */
  12450. A_UINT32 mpdu_pool_alloc_fail;
  12451. /* Number of times the MSDU pool alloc failed */
  12452. A_UINT32 msdu_pool_alloc_fail;
  12453. /* Number of times the tid pool freed */
  12454. A_UINT32 tid_pool_free;
  12455. /* Number of times the MPDU pool freed */
  12456. A_UINT32 mpdu_pool_free;
  12457. /* Number of times the MSDU pool freed */
  12458. A_UINT32 msdu_pool_free;
  12459. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  12460. A_UINT32 msdu_queued;
  12461. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  12462. A_UINT32 msdu_recycled;
  12463. /* Number of MPDUs with invalid peer but A2 found in AST */
  12464. A_UINT32 invalid_peer_a2_in_ast;
  12465. /* Number of MPDUs with invalid peer but A3 found in AST */
  12466. A_UINT32 invalid_peer_a3_in_ast;
  12467. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  12468. A_UINT32 invalid_peer_bmc_mpdus;
  12469. /* Number of MSDUs with err attention word */
  12470. A_UINT32 rxdesc_err_att;
  12471. /* Number of MSDUs with flag of peer_idx_invalid */
  12472. A_UINT32 rxdesc_err_peer_idx_inv;
  12473. /* Number of MSDUs with flag of peer_idx_timeout */
  12474. A_UINT32 rxdesc_err_peer_idx_to;
  12475. /* Number of MSDUs with flag of overflow */
  12476. A_UINT32 rxdesc_err_ov;
  12477. /* Number of MSDUs with flag of msdu_length_err */
  12478. A_UINT32 rxdesc_err_msdu_len;
  12479. /* Number of MSDUs with flag of mpdu_length_err */
  12480. A_UINT32 rxdesc_err_mpdu_len;
  12481. /* Number of MSDUs with flag of tkip_mic_err */
  12482. A_UINT32 rxdesc_err_tkip_mic;
  12483. /* Number of MSDUs with flag of decrypt_err */
  12484. A_UINT32 rxdesc_err_decrypt;
  12485. /* Number of MSDUs with flag of fcs_err */
  12486. A_UINT32 rxdesc_err_fcs;
  12487. /* Number of Unicast (bc_mc bit is not set in attention word)
  12488. * frames with invalid peer handler
  12489. */
  12490. A_UINT32 rxdesc_uc_msdus_inv_peer;
  12491. /* Number of unicast frame directly (direct bit is set in attention word)
  12492. * to DUT with invalid peer handler
  12493. */
  12494. A_UINT32 rxdesc_direct_msdus_inv_peer;
  12495. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  12496. * frames with invalid peer handler
  12497. */
  12498. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  12499. /* Number of MSDUs dropped due to no first MSDU flag */
  12500. A_UINT32 rxdesc_no_1st_msdu;
  12501. /* Number of MSDUs droped due to ring overflow */
  12502. A_UINT32 msdu_drop_ring_ov;
  12503. /* Number of MSDUs dropped due to FC mismatch */
  12504. A_UINT32 msdu_drop_fc_mismatch;
  12505. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  12506. A_UINT32 msdu_drop_mgmt_remote_ring;
  12507. /* Number of MSDUs dropped due to errors not reported in attention word */
  12508. A_UINT32 msdu_drop_misc;
  12509. /* Number of MSDUs go to offload before reorder */
  12510. A_UINT32 offload_msdu_wal;
  12511. /* Number of data frame dropped by offload after reorder */
  12512. A_UINT32 offload_msdu_reorder;
  12513. /* Number of MPDUs with sequence number in the past and within the BA window */
  12514. A_UINT32 dup_past_within_window;
  12515. /* Number of MPDUs with sequence number in the past and outside the BA window */
  12516. A_UINT32 dup_past_outside_window;
  12517. /* Number of MSDUs with decrypt/MIC error */
  12518. A_UINT32 rxdesc_err_decrypt_mic;
  12519. /* Number of data MSDUs received on both local and remote rings */
  12520. A_UINT32 data_msdus_on_both_rings;
  12521. /* MPDUs never filled */
  12522. A_UINT32 holes_not_filled;
  12523. };
  12524. /*
  12525. * Rx Remote buffer statistics
  12526. * NB: all the fields must be defined in 4 octets size.
  12527. */
  12528. struct rx_remote_buffer_mgmt_stats {
  12529. /* Total number of MSDUs reaped for Rx processing */
  12530. A_UINT32 remote_reaped;
  12531. /* MSDUs recycled within firmware */
  12532. A_UINT32 remote_recycled;
  12533. /* MSDUs stored by Data Rx */
  12534. A_UINT32 data_rx_msdus_stored;
  12535. /* Number of HTT indications from WAL Rx MSDU */
  12536. A_UINT32 wal_rx_ind;
  12537. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  12538. A_UINT32 wal_rx_ind_unconsumed;
  12539. /* Number of HTT indications from Data Rx MSDU */
  12540. A_UINT32 data_rx_ind;
  12541. /* Number of unconsumed HTT indications from Data Rx MSDU */
  12542. A_UINT32 data_rx_ind_unconsumed;
  12543. /* Number of HTT indications from ATHBUF */
  12544. A_UINT32 athbuf_rx_ind;
  12545. /* Number of remote buffers requested for refill */
  12546. A_UINT32 refill_buf_req;
  12547. /* Number of remote buffers filled by the host */
  12548. A_UINT32 refill_buf_rsp;
  12549. /* Number of times MAC hw_index = f/w write_index */
  12550. A_INT32 mac_no_bufs;
  12551. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  12552. A_INT32 fw_indices_equal;
  12553. /* Number of times f/w finds no buffers to post */
  12554. A_INT32 host_no_bufs;
  12555. };
  12556. /*
  12557. * TXBF MU/SU packets and NDPA statistics
  12558. * NB: all the fields must be defined in 4 octets size.
  12559. */
  12560. struct rx_txbf_musu_ndpa_pkts_stats {
  12561. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  12562. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  12563. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  12564. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  12565. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  12566. A_UINT32 reserved[3]; /* must be set to 0x0 */
  12567. };
  12568. /*
  12569. * htt_dbg_stats_status -
  12570. * present - The requested stats have been delivered in full.
  12571. * This indicates that either the stats information was contained
  12572. * in its entirety within this message, or else this message
  12573. * completes the delivery of the requested stats info that was
  12574. * partially delivered through earlier STATS_CONF messages.
  12575. * partial - The requested stats have been delivered in part.
  12576. * One or more subsequent STATS_CONF messages with the same
  12577. * cookie value will be sent to deliver the remainder of the
  12578. * information.
  12579. * error - The requested stats could not be delivered, for example due
  12580. * to a shortage of memory to construct a message holding the
  12581. * requested stats.
  12582. * invalid - The requested stat type is either not recognized, or the
  12583. * target is configured to not gather the stats type in question.
  12584. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12585. * series_done - This special value indicates that no further stats info
  12586. * elements are present within a series of stats info elems
  12587. * (within a stats upload confirmation message).
  12588. */
  12589. enum htt_dbg_stats_status {
  12590. HTT_DBG_STATS_STATUS_PRESENT = 0,
  12591. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  12592. HTT_DBG_STATS_STATUS_ERROR = 2,
  12593. HTT_DBG_STATS_STATUS_INVALID = 3,
  12594. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  12595. };
  12596. /**
  12597. * @brief target -> host statistics upload
  12598. *
  12599. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  12600. *
  12601. * @details
  12602. * The following field definitions describe the format of the HTT target
  12603. * to host stats upload confirmation message.
  12604. * The message contains a cookie echoed from the HTT host->target stats
  12605. * upload request, which identifies which request the confirmation is
  12606. * for, and a series of tag-length-value stats information elements.
  12607. * The tag-length header for each stats info element also includes a
  12608. * status field, to indicate whether the request for the stat type in
  12609. * question was fully met, partially met, unable to be met, or invalid
  12610. * (if the stat type in question is disabled in the target).
  12611. * A special value of all 1's in this status field is used to indicate
  12612. * the end of the series of stats info elements.
  12613. *
  12614. *
  12615. * |31 16|15 8|7 5|4 0|
  12616. * |------------------------------------------------------------|
  12617. * | reserved | msg type |
  12618. * |------------------------------------------------------------|
  12619. * | cookie LSBs |
  12620. * |------------------------------------------------------------|
  12621. * | cookie MSBs |
  12622. * |------------------------------------------------------------|
  12623. * | stats entry length | reserved | S |stat type|
  12624. * |------------------------------------------------------------|
  12625. * | |
  12626. * | type-specific stats info |
  12627. * | |
  12628. * |------------------------------------------------------------|
  12629. * | stats entry length | reserved | S |stat type|
  12630. * |------------------------------------------------------------|
  12631. * | |
  12632. * | type-specific stats info |
  12633. * | |
  12634. * |------------------------------------------------------------|
  12635. * | n/a | reserved | 111 | n/a |
  12636. * |------------------------------------------------------------|
  12637. * Header fields:
  12638. * - MSG_TYPE
  12639. * Bits 7:0
  12640. * Purpose: identifies this is a statistics upload confirmation message
  12641. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  12642. * - COOKIE_LSBS
  12643. * Bits 31:0
  12644. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12645. * message with its preceding host->target stats request message.
  12646. * Value: LSBs of the opaque cookie specified by the host-side requestor
  12647. * - COOKIE_MSBS
  12648. * Bits 31:0
  12649. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12650. * message with its preceding host->target stats request message.
  12651. * Value: MSBs of the opaque cookie specified by the host-side requestor
  12652. *
  12653. * Stats Information Element tag-length header fields:
  12654. * - STAT_TYPE
  12655. * Bits 4:0
  12656. * Purpose: identifies the type of statistics info held in the
  12657. * following information element
  12658. * Value: htt_dbg_stats_type
  12659. * - STATUS
  12660. * Bits 7:5
  12661. * Purpose: indicate whether the requested stats are present
  12662. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  12663. * the completion of the stats entry series
  12664. * - LENGTH
  12665. * Bits 31:16
  12666. * Purpose: indicate the stats information size
  12667. * Value: This field specifies the number of bytes of stats information
  12668. * that follows the element tag-length header.
  12669. * It is expected but not required that this length is a multiple of
  12670. * 4 bytes. Even if the length is not an integer multiple of 4, the
  12671. * subsequent stats entry header will begin on a 4-byte aligned
  12672. * boundary.
  12673. */
  12674. #define HTT_T2H_STATS_COOKIE_SIZE 8
  12675. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  12676. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  12677. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  12678. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  12679. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  12680. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  12681. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  12682. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  12683. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  12684. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  12685. do { \
  12686. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  12687. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  12688. } while (0)
  12689. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  12690. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  12691. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  12692. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  12693. do { \
  12694. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  12695. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  12696. } while (0)
  12697. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  12698. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  12699. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  12700. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  12701. do { \
  12702. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  12703. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  12704. } while (0)
  12705. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  12706. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  12707. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  12708. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  12709. #define HTT_MAX_AGGR 64
  12710. #define HTT_HL_MAX_AGGR 18
  12711. /**
  12712. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  12713. *
  12714. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  12715. *
  12716. * @details
  12717. * The following field definitions describe the format of the HTT host
  12718. * to target frag_desc/msdu_ext bank configuration message.
  12719. * The message contains the based address and the min and max id of the
  12720. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  12721. * MSDU_EXT/FRAG_DESC.
  12722. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  12723. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  12724. * the hardware does the mapping/translation.
  12725. *
  12726. * Total banks that can be configured is configured to 16.
  12727. *
  12728. * This should be called before any TX has be initiated by the HTT
  12729. *
  12730. * |31 16|15 8|7 5|4 0|
  12731. * |------------------------------------------------------------|
  12732. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  12733. * |------------------------------------------------------------|
  12734. * | BANK0_BASE_ADDRESS (bits 31:0) |
  12735. #if HTT_PADDR64
  12736. * | BANK0_BASE_ADDRESS (bits 63:32) |
  12737. #endif
  12738. * |------------------------------------------------------------|
  12739. * | ... |
  12740. * |------------------------------------------------------------|
  12741. * | BANK15_BASE_ADDRESS (bits 31:0) |
  12742. #if HTT_PADDR64
  12743. * | BANK15_BASE_ADDRESS (bits 63:32) |
  12744. #endif
  12745. * |------------------------------------------------------------|
  12746. * | BANK0_MAX_ID | BANK0_MIN_ID |
  12747. * |------------------------------------------------------------|
  12748. * | ... |
  12749. * |------------------------------------------------------------|
  12750. * | BANK15_MAX_ID | BANK15_MIN_ID |
  12751. * |------------------------------------------------------------|
  12752. * Header fields:
  12753. * - MSG_TYPE
  12754. * Bits 7:0
  12755. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  12756. * for systems with 64-bit format for bus addresses:
  12757. * - BANKx_BASE_ADDRESS_LO
  12758. * Bits 31:0
  12759. * Purpose: Provide a mechanism to specify the base address of the
  12760. * MSDU_EXT bank physical/bus address.
  12761. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  12762. * - BANKx_BASE_ADDRESS_HI
  12763. * Bits 31:0
  12764. * Purpose: Provide a mechanism to specify the base address of the
  12765. * MSDU_EXT bank physical/bus address.
  12766. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  12767. * for systems with 32-bit format for bus addresses:
  12768. * - BANKx_BASE_ADDRESS
  12769. * Bits 31:0
  12770. * Purpose: Provide a mechanism to specify the base address of the
  12771. * MSDU_EXT bank physical/bus address.
  12772. * Value: MSDU_EXT bank physical / bus address
  12773. * - BANKx_MIN_ID
  12774. * Bits 15:0
  12775. * Purpose: Provide a mechanism to specify the min index that needs to
  12776. * mapped.
  12777. * - BANKx_MAX_ID
  12778. * Bits 31:16
  12779. * Purpose: Provide a mechanism to specify the max index that needs to
  12780. * mapped.
  12781. *
  12782. */
  12783. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  12784. * safe value.
  12785. * @note MAX supported banks is 16.
  12786. */
  12787. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  12788. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  12789. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  12790. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  12791. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  12792. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  12793. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  12794. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  12795. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  12796. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  12797. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  12798. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  12799. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  12800. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  12801. do { \
  12802. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  12803. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  12804. } while (0)
  12805. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  12806. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  12807. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  12808. do { \
  12809. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  12810. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  12811. } while (0)
  12812. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  12813. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  12814. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  12815. do { \
  12816. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  12817. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  12818. } while (0)
  12819. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  12820. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  12821. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  12822. do { \
  12823. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  12824. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  12825. } while (0)
  12826. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  12827. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  12828. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  12829. do { \
  12830. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  12831. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  12832. } while (0)
  12833. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  12834. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  12835. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  12836. do { \
  12837. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  12838. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  12839. } while (0)
  12840. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  12841. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  12842. /*
  12843. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  12844. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  12845. * addresses are stored in a XXX-bit field.
  12846. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  12847. * htt_tx_frag_desc64_bank_cfg_t structs.
  12848. */
  12849. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  12850. _paddr_bits_, \
  12851. _paddr__bank_base_address_) \
  12852. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  12853. /** word 0 \
  12854. * msg_type: 8, \
  12855. * pdev_id: 2, \
  12856. * swap: 1, \
  12857. * reserved0: 5, \
  12858. * num_banks: 8, \
  12859. * desc_size: 8; \
  12860. */ \
  12861. A_UINT32 word0; \
  12862. /* \
  12863. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  12864. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  12865. * the second A_UINT32). \
  12866. */ \
  12867. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12868. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12869. } POSTPACK
  12870. /* define htt_tx_frag_desc32_bank_cfg_t */
  12871. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  12872. /* define htt_tx_frag_desc64_bank_cfg_t */
  12873. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  12874. /*
  12875. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  12876. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  12877. */
  12878. #if HTT_PADDR64
  12879. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  12880. #else
  12881. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  12882. #endif
  12883. /**
  12884. * @brief target -> host HTT TX Credit total count update message definition
  12885. *
  12886. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  12887. *
  12888. *|31 16|15|14 9| 8 |7 0 |
  12889. *|---------------------+--+----------+-------+----------|
  12890. *|cur htt credit delta | Q| reserved | sign | msg type |
  12891. *|------------------------------------------------------|
  12892. *
  12893. * Header fields:
  12894. * - MSG_TYPE
  12895. * Bits 7:0
  12896. * Purpose: identifies this as a htt tx credit delta update message
  12897. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  12898. * - SIGN
  12899. * Bits 8
  12900. * identifies whether credit delta is positive or negative
  12901. * Value:
  12902. * - 0x0: credit delta is positive, rebalance in some buffers
  12903. * - 0x1: credit delta is negative, rebalance out some buffers
  12904. * - reserved
  12905. * Bits 14:9
  12906. * Value: 0x0
  12907. * - TXQ_GRP
  12908. * Bit 15
  12909. * Purpose: indicates whether any tx queue group information elements
  12910. * are appended to the tx credit update message
  12911. * Value: 0 -> no tx queue group information element is present
  12912. * 1 -> a tx queue group information element immediately follows
  12913. * - DELTA_COUNT
  12914. * Bits 31:16
  12915. * Purpose: Specify current htt credit delta absolute count
  12916. */
  12917. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  12918. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  12919. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  12920. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  12921. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  12922. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  12923. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  12924. do { \
  12925. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  12926. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  12927. } while (0)
  12928. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  12929. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  12930. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  12931. do { \
  12932. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  12933. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  12934. } while (0)
  12935. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  12936. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  12937. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  12938. do { \
  12939. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  12940. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  12941. } while (0)
  12942. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  12943. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  12944. #define HTT_TX_CREDIT_MSG_BYTES 4
  12945. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  12946. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  12947. /**
  12948. * @brief HTT WDI_IPA Operation Response Message
  12949. *
  12950. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  12951. *
  12952. * @details
  12953. * HTT WDI_IPA Operation Response message is sent by target
  12954. * to host confirming suspend or resume operation.
  12955. * |31 24|23 16|15 8|7 0|
  12956. * |----------------+----------------+----------------+----------------|
  12957. * | op_code | Rsvd | msg_type |
  12958. * |-------------------------------------------------------------------|
  12959. * | Rsvd | Response len |
  12960. * |-------------------------------------------------------------------|
  12961. * | |
  12962. * | Response-type specific info |
  12963. * | |
  12964. * | |
  12965. * |-------------------------------------------------------------------|
  12966. * Header fields:
  12967. * - MSG_TYPE
  12968. * Bits 7:0
  12969. * Purpose: Identifies this as WDI_IPA Operation Response message
  12970. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  12971. * - OP_CODE
  12972. * Bits 31:16
  12973. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  12974. * value: = enum htt_wdi_ipa_op_code
  12975. * - RSP_LEN
  12976. * Bits 16:0
  12977. * Purpose: length for the response-type specific info
  12978. * value: = length in bytes for response-type specific info
  12979. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  12980. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  12981. */
  12982. PREPACK struct htt_wdi_ipa_op_response_t
  12983. {
  12984. /* DWORD 0: flags and meta-data */
  12985. A_UINT32
  12986. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12987. reserved1: 8,
  12988. op_code: 16;
  12989. A_UINT32
  12990. rsp_len: 16,
  12991. reserved2: 16;
  12992. } POSTPACK;
  12993. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  12994. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  12995. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  12996. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  12997. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  12998. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  12999. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  13000. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  13001. do { \
  13002. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  13003. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  13004. } while (0)
  13005. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  13006. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  13007. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  13008. do { \
  13009. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  13010. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  13011. } while (0)
  13012. enum htt_phy_mode {
  13013. htt_phy_mode_11a = 0,
  13014. htt_phy_mode_11g = 1,
  13015. htt_phy_mode_11b = 2,
  13016. htt_phy_mode_11g_only = 3,
  13017. htt_phy_mode_11na_ht20 = 4,
  13018. htt_phy_mode_11ng_ht20 = 5,
  13019. htt_phy_mode_11na_ht40 = 6,
  13020. htt_phy_mode_11ng_ht40 = 7,
  13021. htt_phy_mode_11ac_vht20 = 8,
  13022. htt_phy_mode_11ac_vht40 = 9,
  13023. htt_phy_mode_11ac_vht80 = 10,
  13024. htt_phy_mode_11ac_vht20_2g = 11,
  13025. htt_phy_mode_11ac_vht40_2g = 12,
  13026. htt_phy_mode_11ac_vht80_2g = 13,
  13027. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  13028. htt_phy_mode_11ac_vht160 = 15,
  13029. htt_phy_mode_max,
  13030. };
  13031. /**
  13032. * @brief target -> host HTT channel change indication
  13033. *
  13034. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  13035. *
  13036. * @details
  13037. * Specify when a channel change occurs.
  13038. * This allows the host to precisely determine which rx frames arrived
  13039. * on the old channel and which rx frames arrived on the new channel.
  13040. *
  13041. *|31 |7 0 |
  13042. *|-------------------------------------------+----------|
  13043. *| reserved | msg type |
  13044. *|------------------------------------------------------|
  13045. *| primary_chan_center_freq_mhz |
  13046. *|------------------------------------------------------|
  13047. *| contiguous_chan1_center_freq_mhz |
  13048. *|------------------------------------------------------|
  13049. *| contiguous_chan2_center_freq_mhz |
  13050. *|------------------------------------------------------|
  13051. *| phy_mode |
  13052. *|------------------------------------------------------|
  13053. *
  13054. * Header fields:
  13055. * - MSG_TYPE
  13056. * Bits 7:0
  13057. * Purpose: identifies this as a htt channel change indication message
  13058. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  13059. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  13060. * Bits 31:0
  13061. * Purpose: identify the (center of the) new 20 MHz primary channel
  13062. * Value: center frequency of the 20 MHz primary channel, in MHz units
  13063. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  13064. * Bits 31:0
  13065. * Purpose: identify the (center of the) contiguous frequency range
  13066. * comprising the new channel.
  13067. * For example, if the new channel is a 80 MHz channel extending
  13068. * 60 MHz beyond the primary channel, this field would be 30 larger
  13069. * than the primary channel center frequency field.
  13070. * Value: center frequency of the contiguous frequency range comprising
  13071. * the full channel in MHz units
  13072. * (80+80 channels also use the CONTIG_CHAN2 field)
  13073. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  13074. * Bits 31:0
  13075. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  13076. * within a VHT 80+80 channel.
  13077. * This field is only relevant for VHT 80+80 channels.
  13078. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  13079. * channel (arbitrary value for cases besides VHT 80+80)
  13080. * - PHY_MODE
  13081. * Bits 31:0
  13082. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  13083. * and band
  13084. * Value: htt_phy_mode enum value
  13085. */
  13086. PREPACK struct htt_chan_change_t
  13087. {
  13088. /* DWORD 0: flags and meta-data */
  13089. A_UINT32
  13090. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13091. reserved1: 24;
  13092. A_UINT32 primary_chan_center_freq_mhz;
  13093. A_UINT32 contig_chan1_center_freq_mhz;
  13094. A_UINT32 contig_chan2_center_freq_mhz;
  13095. A_UINT32 phy_mode;
  13096. } POSTPACK;
  13097. /*
  13098. * Due to historical / backwards-compatibility reasons, maintain the
  13099. * below htt_chan_change_msg struct definition, which needs to be
  13100. * consistent with the above htt_chan_change_t struct definition
  13101. * (aside from the htt_chan_change_t definition including the msg_type
  13102. * dword within the message, and the htt_chan_change_msg only containing
  13103. * the payload of the message that follows the msg_type dword).
  13104. */
  13105. PREPACK struct htt_chan_change_msg {
  13106. A_UINT32 chan_mhz; /* frequency in mhz */
  13107. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  13108. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  13109. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  13110. } POSTPACK;
  13111. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  13112. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  13113. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  13114. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  13115. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  13116. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  13117. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  13118. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  13119. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  13120. do { \
  13121. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  13122. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  13123. } while (0)
  13124. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  13125. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  13126. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  13127. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  13128. do { \
  13129. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  13130. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  13131. } while (0)
  13132. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  13133. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  13134. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  13135. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  13136. do { \
  13137. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  13138. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  13139. } while (0)
  13140. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  13141. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  13142. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  13143. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  13144. do { \
  13145. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  13146. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  13147. } while (0)
  13148. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  13149. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  13150. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  13151. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  13152. /**
  13153. * @brief rx offload packet error message
  13154. *
  13155. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  13156. *
  13157. * @details
  13158. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  13159. * of target payload like mic err.
  13160. *
  13161. * |31 24|23 16|15 8|7 0|
  13162. * |----------------+----------------+----------------+----------------|
  13163. * | tid | vdev_id | msg_sub_type | msg_type |
  13164. * |-------------------------------------------------------------------|
  13165. * : (sub-type dependent content) :
  13166. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13167. * Header fields:
  13168. * - msg_type
  13169. * Bits 7:0
  13170. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  13171. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  13172. * - msg_sub_type
  13173. * Bits 15:8
  13174. * Purpose: Identifies which type of rx error is reported by this message
  13175. * value: htt_rx_ofld_pkt_err_type
  13176. * - vdev_id
  13177. * Bits 23:16
  13178. * Purpose: Identifies which vdev received the erroneous rx frame
  13179. * value:
  13180. * - tid
  13181. * Bits 31:24
  13182. * Purpose: Identifies the traffic type of the rx frame
  13183. * value:
  13184. *
  13185. * - The payload fields used if the sub-type == MIC error are shown below.
  13186. * Note - MIC err is per MSDU, while PN is per MPDU.
  13187. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  13188. * with MIC err in A-MSDU case, so FW will send only one HTT message
  13189. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  13190. * instead of sending separate HTT messages for each wrong MSDU within
  13191. * the MPDU.
  13192. *
  13193. * |31 24|23 16|15 8|7 0|
  13194. * |----------------+----------------+----------------+----------------|
  13195. * | Rsvd | key_id | peer_id |
  13196. * |-------------------------------------------------------------------|
  13197. * | receiver MAC addr 31:0 |
  13198. * |-------------------------------------------------------------------|
  13199. * | Rsvd | receiver MAC addr 47:32 |
  13200. * |-------------------------------------------------------------------|
  13201. * | transmitter MAC addr 31:0 |
  13202. * |-------------------------------------------------------------------|
  13203. * | Rsvd | transmitter MAC addr 47:32 |
  13204. * |-------------------------------------------------------------------|
  13205. * | PN 31:0 |
  13206. * |-------------------------------------------------------------------|
  13207. * | Rsvd | PN 47:32 |
  13208. * |-------------------------------------------------------------------|
  13209. * - peer_id
  13210. * Bits 15:0
  13211. * Purpose: identifies which peer is frame is from
  13212. * value:
  13213. * - key_id
  13214. * Bits 23:16
  13215. * Purpose: identifies key_id of rx frame
  13216. * value:
  13217. * - RA_31_0 (receiver MAC addr 31:0)
  13218. * Bits 31:0
  13219. * Purpose: identifies by MAC address which vdev received the frame
  13220. * value: MAC address lower 4 bytes
  13221. * - RA_47_32 (receiver MAC addr 47:32)
  13222. * Bits 15:0
  13223. * Purpose: identifies by MAC address which vdev received the frame
  13224. * value: MAC address upper 2 bytes
  13225. * - TA_31_0 (transmitter MAC addr 31:0)
  13226. * Bits 31:0
  13227. * Purpose: identifies by MAC address which peer transmitted the frame
  13228. * value: MAC address lower 4 bytes
  13229. * - TA_47_32 (transmitter MAC addr 47:32)
  13230. * Bits 15:0
  13231. * Purpose: identifies by MAC address which peer transmitted the frame
  13232. * value: MAC address upper 2 bytes
  13233. * - PN_31_0
  13234. * Bits 31:0
  13235. * Purpose: Identifies pn of rx frame
  13236. * value: PN lower 4 bytes
  13237. * - PN_47_32
  13238. * Bits 15:0
  13239. * Purpose: Identifies pn of rx frame
  13240. * value:
  13241. * TKIP or CCMP: PN upper 2 bytes
  13242. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  13243. */
  13244. enum htt_rx_ofld_pkt_err_type {
  13245. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  13246. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  13247. };
  13248. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  13249. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  13250. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  13251. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  13252. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  13253. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  13254. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  13255. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  13256. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  13257. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  13258. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  13259. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  13260. do { \
  13261. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  13262. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  13263. } while (0)
  13264. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  13265. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  13266. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  13267. do { \
  13268. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  13269. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  13270. } while (0)
  13271. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  13272. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  13273. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  13274. do { \
  13275. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  13276. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  13277. } while (0)
  13278. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  13279. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  13280. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  13281. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  13282. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  13283. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  13284. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  13285. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  13286. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  13287. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  13288. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  13289. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  13290. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  13291. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  13292. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  13293. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  13294. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  13295. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  13296. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  13297. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  13298. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  13299. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  13300. do { \
  13301. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  13302. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  13303. } while (0)
  13304. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  13305. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  13306. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  13307. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  13308. do { \
  13309. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  13310. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  13311. } while (0)
  13312. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  13313. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  13314. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  13315. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  13316. do { \
  13317. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  13318. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  13319. } while (0)
  13320. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  13321. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  13322. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  13323. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  13324. do { \
  13325. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  13326. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  13327. } while (0)
  13328. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  13329. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  13330. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  13331. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  13332. do { \
  13333. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  13334. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  13335. } while (0)
  13336. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  13337. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  13338. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  13339. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  13340. do { \
  13341. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  13342. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  13343. } while (0)
  13344. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  13345. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  13346. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  13347. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  13348. do { \
  13349. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  13350. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  13351. } while (0)
  13352. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  13353. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  13354. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  13355. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  13356. do { \
  13357. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  13358. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  13359. } while (0)
  13360. /**
  13361. * @brief target -> host peer rate report message
  13362. *
  13363. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  13364. *
  13365. * @details
  13366. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  13367. * justified rate of all the peers.
  13368. *
  13369. * |31 24|23 16|15 8|7 0|
  13370. * |----------------+----------------+----------------+----------------|
  13371. * | peer_count | | msg_type |
  13372. * |-------------------------------------------------------------------|
  13373. * : Payload (variant number of peer rate report) :
  13374. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13375. * Header fields:
  13376. * - msg_type
  13377. * Bits 7:0
  13378. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  13379. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  13380. * - reserved
  13381. * Bits 15:8
  13382. * Purpose:
  13383. * value:
  13384. * - peer_count
  13385. * Bits 31:16
  13386. * Purpose: Specify how many peer rate report elements are present in the payload.
  13387. * value:
  13388. *
  13389. * Payload:
  13390. * There are variant number of peer rate report follow the first 32 bits.
  13391. * The peer rate report is defined as follows.
  13392. *
  13393. * |31 20|19 16|15 0|
  13394. * |-----------------------+---------+---------------------------------|-
  13395. * | reserved | phy | peer_id | \
  13396. * |-------------------------------------------------------------------| -> report #0
  13397. * | rate | /
  13398. * |-----------------------+---------+---------------------------------|-
  13399. * | reserved | phy | peer_id | \
  13400. * |-------------------------------------------------------------------| -> report #1
  13401. * | rate | /
  13402. * |-----------------------+---------+---------------------------------|-
  13403. * | reserved | phy | peer_id | \
  13404. * |-------------------------------------------------------------------| -> report #2
  13405. * | rate | /
  13406. * |-------------------------------------------------------------------|-
  13407. * : :
  13408. * : :
  13409. * : :
  13410. * :-------------------------------------------------------------------:
  13411. *
  13412. * - peer_id
  13413. * Bits 15:0
  13414. * Purpose: identify the peer
  13415. * value:
  13416. * - phy
  13417. * Bits 19:16
  13418. * Purpose: identify which phy is in use
  13419. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  13420. * Please see enum htt_peer_report_phy_type for detail.
  13421. * - reserved
  13422. * Bits 31:20
  13423. * Purpose:
  13424. * value:
  13425. * - rate
  13426. * Bits 31:0
  13427. * Purpose: represent the justified rate of the peer specified by peer_id
  13428. * value:
  13429. */
  13430. enum htt_peer_rate_report_phy_type {
  13431. HTT_PEER_RATE_REPORT_11B = 0,
  13432. HTT_PEER_RATE_REPORT_11A_G,
  13433. HTT_PEER_RATE_REPORT_11N,
  13434. HTT_PEER_RATE_REPORT_11AC,
  13435. };
  13436. #define HTT_PEER_RATE_REPORT_SIZE 8
  13437. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  13438. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  13439. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  13440. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  13441. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  13442. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  13443. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  13444. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  13445. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  13446. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  13447. do { \
  13448. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  13449. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  13450. } while (0)
  13451. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  13452. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  13453. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  13454. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  13455. do { \
  13456. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  13457. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  13458. } while (0)
  13459. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  13460. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  13461. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  13462. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  13463. do { \
  13464. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  13465. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  13466. } while (0)
  13467. /**
  13468. * @brief target -> host flow pool map message
  13469. *
  13470. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  13471. *
  13472. * @details
  13473. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  13474. * a flow of descriptors.
  13475. *
  13476. * This message is in TLV format and indicates the parameters to be setup a
  13477. * flow in the host. Each entry indicates that a particular flow ID is ready to
  13478. * receive descriptors from a specified pool.
  13479. *
  13480. * The message would appear as follows:
  13481. *
  13482. * |31 24|23 16|15 8|7 0|
  13483. * |----------------+----------------+----------------+----------------|
  13484. * header | reserved | num_flows | msg_type |
  13485. * |-------------------------------------------------------------------|
  13486. * | |
  13487. * : payload :
  13488. * | |
  13489. * |-------------------------------------------------------------------|
  13490. *
  13491. * The header field is one DWORD long and is interpreted as follows:
  13492. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  13493. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  13494. * this message
  13495. * b'16-31 - reserved: These bits are reserved for future use
  13496. *
  13497. * Payload:
  13498. * The payload would contain multiple objects of the following structure. Each
  13499. * object represents a flow.
  13500. *
  13501. * |31 24|23 16|15 8|7 0|
  13502. * |----------------+----------------+----------------+----------------|
  13503. * header | reserved | num_flows | msg_type |
  13504. * |-------------------------------------------------------------------|
  13505. * payload0| flow_type |
  13506. * |-------------------------------------------------------------------|
  13507. * | flow_id |
  13508. * |-------------------------------------------------------------------|
  13509. * | reserved0 | flow_pool_id |
  13510. * |-------------------------------------------------------------------|
  13511. * | reserved1 | flow_pool_size |
  13512. * |-------------------------------------------------------------------|
  13513. * | reserved2 |
  13514. * |-------------------------------------------------------------------|
  13515. * payload1| flow_type |
  13516. * |-------------------------------------------------------------------|
  13517. * | flow_id |
  13518. * |-------------------------------------------------------------------|
  13519. * | reserved0 | flow_pool_id |
  13520. * |-------------------------------------------------------------------|
  13521. * | reserved1 | flow_pool_size |
  13522. * |-------------------------------------------------------------------|
  13523. * | reserved2 |
  13524. * |-------------------------------------------------------------------|
  13525. * | . |
  13526. * | . |
  13527. * | . |
  13528. * |-------------------------------------------------------------------|
  13529. *
  13530. * Each payload is 5 DWORDS long and is interpreted as follows:
  13531. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  13532. * this flow is associated. It can be VDEV, peer,
  13533. * or tid (AC). Based on enum htt_flow_type.
  13534. *
  13535. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13536. * object. For flow_type vdev it is set to the
  13537. * vdevid, for peer it is peerid and for tid, it is
  13538. * tid_num.
  13539. *
  13540. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  13541. * in the host for this flow
  13542. * b'16:31 - reserved0: This field in reserved for the future. In case
  13543. * we have a hierarchical implementation (HCM) of
  13544. * pools, it can be used to indicate the ID of the
  13545. * parent-pool.
  13546. *
  13547. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  13548. * Descriptors for this flow will be
  13549. * allocated from this pool in the host.
  13550. * b'16:31 - reserved1: This field in reserved for the future. In case
  13551. * we have a hierarchical implementation of pools,
  13552. * it can be used to indicate the max number of
  13553. * descriptors in the pool. The b'0:15 can be used
  13554. * to indicate min number of descriptors in the
  13555. * HCM scheme.
  13556. *
  13557. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  13558. * we have a hierarchical implementation of pools,
  13559. * b'0:15 can be used to indicate the
  13560. * priority-based borrowing (PBB) threshold of
  13561. * the flow's pool. The b'16:31 are still left
  13562. * reserved.
  13563. */
  13564. enum htt_flow_type {
  13565. FLOW_TYPE_VDEV = 0,
  13566. /* Insert new flow types above this line */
  13567. };
  13568. PREPACK struct htt_flow_pool_map_payload_t {
  13569. A_UINT32 flow_type;
  13570. A_UINT32 flow_id;
  13571. A_UINT32 flow_pool_id:16,
  13572. reserved0:16;
  13573. A_UINT32 flow_pool_size:16,
  13574. reserved1:16;
  13575. A_UINT32 reserved2;
  13576. } POSTPACK;
  13577. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  13578. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  13579. (sizeof(struct htt_flow_pool_map_payload_t))
  13580. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  13581. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  13582. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  13583. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  13584. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  13585. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  13586. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  13587. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  13588. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  13589. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  13590. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  13591. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  13592. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  13593. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  13594. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  13595. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  13596. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  13597. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  13598. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  13599. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  13600. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  13601. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  13602. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  13603. do { \
  13604. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  13605. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  13606. } while (0)
  13607. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  13608. do { \
  13609. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  13610. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  13611. } while (0)
  13612. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  13613. do { \
  13614. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  13615. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  13616. } while (0)
  13617. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  13618. do { \
  13619. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  13620. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  13621. } while (0)
  13622. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  13623. do { \
  13624. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  13625. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  13626. } while (0)
  13627. /**
  13628. * @brief target -> host flow pool unmap message
  13629. *
  13630. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  13631. *
  13632. * @details
  13633. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  13634. * down a flow of descriptors.
  13635. * This message indicates that for the flow (whose ID is provided) is wanting
  13636. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  13637. * pool of descriptors from where descriptors are being allocated for this
  13638. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  13639. * be unmapped by the host.
  13640. *
  13641. * The message would appear as follows:
  13642. *
  13643. * |31 24|23 16|15 8|7 0|
  13644. * |----------------+----------------+----------------+----------------|
  13645. * | reserved0 | msg_type |
  13646. * |-------------------------------------------------------------------|
  13647. * | flow_type |
  13648. * |-------------------------------------------------------------------|
  13649. * | flow_id |
  13650. * |-------------------------------------------------------------------|
  13651. * | reserved1 | flow_pool_id |
  13652. * |-------------------------------------------------------------------|
  13653. *
  13654. * The message is interpreted as follows:
  13655. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  13656. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  13657. * b'8:31 - reserved0: Reserved for future use
  13658. *
  13659. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  13660. * this flow is associated. It can be VDEV, peer,
  13661. * or tid (AC). Based on enum htt_flow_type.
  13662. *
  13663. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13664. * object. For flow_type vdev it is set to the
  13665. * vdevid, for peer it is peerid and for tid, it is
  13666. * tid_num.
  13667. *
  13668. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  13669. * used in the host for this flow
  13670. * b'16:31 - reserved0: This field in reserved for the future.
  13671. *
  13672. */
  13673. PREPACK struct htt_flow_pool_unmap_t {
  13674. A_UINT32 msg_type:8,
  13675. reserved0:24;
  13676. A_UINT32 flow_type;
  13677. A_UINT32 flow_id;
  13678. A_UINT32 flow_pool_id:16,
  13679. reserved1:16;
  13680. } POSTPACK;
  13681. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  13682. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  13683. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  13684. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  13685. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  13686. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  13687. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  13688. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  13689. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  13690. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  13691. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  13692. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  13693. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  13694. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  13695. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  13696. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  13697. do { \
  13698. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  13699. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  13700. } while (0)
  13701. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  13702. do { \
  13703. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  13704. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  13705. } while (0)
  13706. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  13707. do { \
  13708. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  13709. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  13710. } while (0)
  13711. /**
  13712. * @brief target -> host SRING setup done message
  13713. *
  13714. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  13715. *
  13716. * @details
  13717. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  13718. * SRNG ring setup is done
  13719. *
  13720. * This message indicates whether the last setup operation is successful.
  13721. * It will be sent to host when host set respose_required bit in
  13722. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  13723. * The message would appear as follows:
  13724. *
  13725. * |31 24|23 16|15 8|7 0|
  13726. * |--------------- +----------------+----------------+----------------|
  13727. * | setup_status | ring_id | pdev_id | msg_type |
  13728. * |-------------------------------------------------------------------|
  13729. *
  13730. * The message is interpreted as follows:
  13731. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  13732. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  13733. * b'8:15 - pdev_id:
  13734. * 0 (for rings at SOC/UMAC level),
  13735. * 1/2/3 mac id (for rings at LMAC level)
  13736. * b'16:23 - ring_id: Identify the ring which is set up
  13737. * More details can be got from enum htt_srng_ring_id
  13738. * b'24:31 - setup_status: Indicate status of setup operation
  13739. * Refer to htt_ring_setup_status
  13740. */
  13741. PREPACK struct htt_sring_setup_done_t {
  13742. A_UINT32 msg_type: 8,
  13743. pdev_id: 8,
  13744. ring_id: 8,
  13745. setup_status: 8;
  13746. } POSTPACK;
  13747. enum htt_ring_setup_status {
  13748. htt_ring_setup_status_ok = 0,
  13749. htt_ring_setup_status_error,
  13750. };
  13751. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  13752. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  13753. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  13754. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  13755. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  13756. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  13757. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  13758. do { \
  13759. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  13760. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  13761. } while (0)
  13762. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  13763. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  13764. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  13765. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  13766. HTT_SRING_SETUP_DONE_RING_ID_S)
  13767. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  13768. do { \
  13769. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  13770. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  13771. } while (0)
  13772. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  13773. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  13774. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  13775. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  13776. HTT_SRING_SETUP_DONE_STATUS_S)
  13777. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  13778. do { \
  13779. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  13780. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  13781. } while (0)
  13782. /**
  13783. * @brief target -> flow map flow info
  13784. *
  13785. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  13786. *
  13787. * @details
  13788. * HTT TX map flow entry with tqm flow pointer
  13789. * Sent from firmware to host to add tqm flow pointer in corresponding
  13790. * flow search entry. Flow metadata is replayed back to host as part of this
  13791. * struct to enable host to find the specific flow search entry
  13792. *
  13793. * The message would appear as follows:
  13794. *
  13795. * |31 28|27 18|17 14|13 8|7 0|
  13796. * |-------+------------------------------------------+----------------|
  13797. * | rsvd0 | fse_hsh_idx | msg_type |
  13798. * |-------------------------------------------------------------------|
  13799. * | rsvd1 | tid | peer_id |
  13800. * |-------------------------------------------------------------------|
  13801. * | tqm_flow_pntr_lo |
  13802. * |-------------------------------------------------------------------|
  13803. * | tqm_flow_pntr_hi |
  13804. * |-------------------------------------------------------------------|
  13805. * | fse_meta_data |
  13806. * |-------------------------------------------------------------------|
  13807. *
  13808. * The message is interpreted as follows:
  13809. *
  13810. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  13811. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  13812. *
  13813. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  13814. * for this flow entry
  13815. *
  13816. * dword0 - b'28:31 - rsvd0: Reserved for future use
  13817. *
  13818. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  13819. *
  13820. * dword1 - b'14:17 - tid
  13821. *
  13822. * dword1 - b'18:31 - rsvd1: Reserved for future use
  13823. *
  13824. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  13825. *
  13826. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  13827. *
  13828. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  13829. * given by host
  13830. */
  13831. PREPACK struct htt_tx_map_flow_info {
  13832. A_UINT32
  13833. msg_type: 8,
  13834. fse_hsh_idx: 20,
  13835. rsvd0: 4;
  13836. A_UINT32
  13837. peer_id: 14,
  13838. tid: 4,
  13839. rsvd1: 14;
  13840. A_UINT32 tqm_flow_pntr_lo;
  13841. A_UINT32 tqm_flow_pntr_hi;
  13842. struct htt_tx_flow_metadata fse_meta_data;
  13843. } POSTPACK;
  13844. /* DWORD 0 */
  13845. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  13846. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  13847. /* DWORD 1 */
  13848. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  13849. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  13850. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  13851. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  13852. /* DWORD 0 */
  13853. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  13854. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  13855. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  13856. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  13857. do { \
  13858. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  13859. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  13860. } while (0)
  13861. /* DWORD 1 */
  13862. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  13863. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  13864. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  13865. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  13866. do { \
  13867. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  13868. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  13869. } while (0)
  13870. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  13871. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  13872. HTT_TX_MAP_FLOW_INFO_TID_S)
  13873. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  13874. do { \
  13875. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  13876. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  13877. } while (0)
  13878. /*
  13879. * htt_dbg_ext_stats_status -
  13880. * present - The requested stats have been delivered in full.
  13881. * This indicates that either the stats information was contained
  13882. * in its entirety within this message, or else this message
  13883. * completes the delivery of the requested stats info that was
  13884. * partially delivered through earlier STATS_CONF messages.
  13885. * partial - The requested stats have been delivered in part.
  13886. * One or more subsequent STATS_CONF messages with the same
  13887. * cookie value will be sent to deliver the remainder of the
  13888. * information.
  13889. * error - The requested stats could not be delivered, for example due
  13890. * to a shortage of memory to construct a message holding the
  13891. * requested stats.
  13892. * invalid - The requested stat type is either not recognized, or the
  13893. * target is configured to not gather the stats type in question.
  13894. */
  13895. enum htt_dbg_ext_stats_status {
  13896. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  13897. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  13898. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  13899. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  13900. };
  13901. /**
  13902. * @brief target -> host ppdu stats upload
  13903. *
  13904. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  13905. *
  13906. * @details
  13907. * The following field definitions describe the format of the HTT target
  13908. * to host ppdu stats indication message.
  13909. *
  13910. *
  13911. * |31 16|15 12|11 10|9 8|7 0 |
  13912. * |----------------------------------------------------------------------|
  13913. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  13914. * |----------------------------------------------------------------------|
  13915. * | ppdu_id |
  13916. * |----------------------------------------------------------------------|
  13917. * | Timestamp in us |
  13918. * |----------------------------------------------------------------------|
  13919. * | reserved |
  13920. * |----------------------------------------------------------------------|
  13921. * | type-specific stats info |
  13922. * | (see htt_ppdu_stats.h) |
  13923. * |----------------------------------------------------------------------|
  13924. * Header fields:
  13925. * - MSG_TYPE
  13926. * Bits 7:0
  13927. * Purpose: Identifies this is a PPDU STATS indication
  13928. * message.
  13929. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  13930. * - mac_id
  13931. * Bits 9:8
  13932. * Purpose: mac_id of this ppdu_id
  13933. * Value: 0-3
  13934. * - pdev_id
  13935. * Bits 11:10
  13936. * Purpose: pdev_id of this ppdu_id
  13937. * Value: 0-3
  13938. * 0 (for rings at SOC level),
  13939. * 1/2/3 PDEV -> 0/1/2
  13940. * - payload_size
  13941. * Bits 31:16
  13942. * Purpose: total tlv size
  13943. * Value: payload_size in bytes
  13944. */
  13945. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  13946. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  13947. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  13948. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  13949. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  13950. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  13951. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  13952. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  13953. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  13954. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  13955. do { \
  13956. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  13957. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  13958. } while (0)
  13959. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  13960. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  13961. HTT_T2H_PPDU_STATS_MAC_ID_S)
  13962. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  13963. do { \
  13964. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  13965. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  13966. } while (0)
  13967. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  13968. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  13969. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  13970. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  13971. do { \
  13972. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  13973. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  13974. } while (0)
  13975. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  13976. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  13977. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  13978. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  13979. do { \
  13980. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  13981. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  13982. } while (0)
  13983. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  13984. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  13985. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  13986. /* htt_t2h_ppdu_stats_ind_hdr_t
  13987. * This struct contains the fields within the header of the
  13988. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  13989. * stats info.
  13990. * This struct assumes little-endian layout, and thus is only
  13991. * suitable for use within processors known to be little-endian
  13992. * (such as the target).
  13993. * In contrast, the above macros provide endian-portable methods
  13994. * to get and set the bitfields within this PPDU_STATS_IND header.
  13995. */
  13996. typedef struct {
  13997. A_UINT32 msg_type: 8, /* bits 7:0 */
  13998. mac_id: 2, /* bits 9:8 */
  13999. pdev_id: 2, /* bits 11:10 */
  14000. reserved1: 4, /* bits 15:12 */
  14001. payload_size: 16; /* bits 31:16 */
  14002. A_UINT32 ppdu_id;
  14003. A_UINT32 timestamp_us;
  14004. A_UINT32 reserved2;
  14005. } htt_t2h_ppdu_stats_ind_hdr_t;
  14006. /**
  14007. * @brief target -> host extended statistics upload
  14008. *
  14009. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  14010. *
  14011. * @details
  14012. * The following field definitions describe the format of the HTT target
  14013. * to host stats upload confirmation message.
  14014. * The message contains a cookie echoed from the HTT host->target stats
  14015. * upload request, which identifies which request the confirmation is
  14016. * for, and a single stats can span over multiple HTT stats indication
  14017. * due to the HTT message size limitation so every HTT ext stats indication
  14018. * will have tag-length-value stats information elements.
  14019. * The tag-length header for each HTT stats IND message also includes a
  14020. * status field, to indicate whether the request for the stat type in
  14021. * question was fully met, partially met, unable to be met, or invalid
  14022. * (if the stat type in question is disabled in the target).
  14023. * A Done bit 1's indicate the end of the of stats info elements.
  14024. *
  14025. *
  14026. * |31 16|15 12|11|10 8|7 5|4 0|
  14027. * |--------------------------------------------------------------|
  14028. * | reserved | msg type |
  14029. * |--------------------------------------------------------------|
  14030. * | cookie LSBs |
  14031. * |--------------------------------------------------------------|
  14032. * | cookie MSBs |
  14033. * |--------------------------------------------------------------|
  14034. * | stats entry length | rsvd | D| S | stat type |
  14035. * |--------------------------------------------------------------|
  14036. * | type-specific stats info |
  14037. * | (see htt_stats.h) |
  14038. * |--------------------------------------------------------------|
  14039. * Header fields:
  14040. * - MSG_TYPE
  14041. * Bits 7:0
  14042. * Purpose: Identifies this is a extended statistics upload confirmation
  14043. * message.
  14044. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  14045. * - COOKIE_LSBS
  14046. * Bits 31:0
  14047. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14048. * message with its preceding host->target stats request message.
  14049. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14050. * - COOKIE_MSBS
  14051. * Bits 31:0
  14052. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14053. * message with its preceding host->target stats request message.
  14054. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14055. *
  14056. * Stats Information Element tag-length header fields:
  14057. * - STAT_TYPE
  14058. * Bits 7:0
  14059. * Purpose: identifies the type of statistics info held in the
  14060. * following information element
  14061. * Value: htt_dbg_ext_stats_type
  14062. * - STATUS
  14063. * Bits 10:8
  14064. * Purpose: indicate whether the requested stats are present
  14065. * Value: htt_dbg_ext_stats_status
  14066. * - DONE
  14067. * Bits 11
  14068. * Purpose:
  14069. * Indicates the completion of the stats entry, this will be the last
  14070. * stats conf HTT segment for the requested stats type.
  14071. * Value:
  14072. * 0 -> the stats retrieval is ongoing
  14073. * 1 -> the stats retrieval is complete
  14074. * - LENGTH
  14075. * Bits 31:16
  14076. * Purpose: indicate the stats information size
  14077. * Value: This field specifies the number of bytes of stats information
  14078. * that follows the element tag-length header.
  14079. * It is expected but not required that this length is a multiple of
  14080. * 4 bytes.
  14081. */
  14082. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  14083. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  14084. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  14085. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  14086. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  14087. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  14088. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  14089. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  14090. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  14091. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14092. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  14093. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  14094. do { \
  14095. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  14096. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  14097. } while (0)
  14098. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  14099. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  14100. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  14101. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  14102. do { \
  14103. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  14104. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  14105. } while (0)
  14106. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  14107. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  14108. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  14109. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  14110. do { \
  14111. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  14112. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  14113. } while (0)
  14114. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  14115. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  14116. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  14117. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14118. do { \
  14119. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  14120. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  14121. } while (0)
  14122. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  14123. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  14124. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  14125. typedef enum {
  14126. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  14127. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  14128. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  14129. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  14130. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  14131. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  14132. /* Reserved from 128 - 255 for target internal use.*/
  14133. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  14134. } HTT_PEER_TYPE;
  14135. /** macro to convert MAC address from char array to HTT word format */
  14136. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  14137. (phtt_mac_addr)->mac_addr31to0 = \
  14138. (((c_macaddr)[0] << 0) | \
  14139. ((c_macaddr)[1] << 8) | \
  14140. ((c_macaddr)[2] << 16) | \
  14141. ((c_macaddr)[3] << 24)); \
  14142. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  14143. } while (0)
  14144. /**
  14145. * @brief target -> host monitor mac header indication message
  14146. *
  14147. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  14148. *
  14149. * @details
  14150. * The following diagram shows the format of the monitor mac header message
  14151. * sent from the target to the host.
  14152. * This message is primarily sent when promiscuous rx mode is enabled.
  14153. * One message is sent per rx PPDU.
  14154. *
  14155. * |31 24|23 16|15 8|7 0|
  14156. * |-------------------------------------------------------------|
  14157. * | peer_id | reserved0 | msg_type |
  14158. * |-------------------------------------------------------------|
  14159. * | reserved1 | num_mpdu |
  14160. * |-------------------------------------------------------------|
  14161. * | struct hw_rx_desc |
  14162. * | (see wal_rx_desc.h) |
  14163. * |-------------------------------------------------------------|
  14164. * | struct ieee80211_frame_addr4 |
  14165. * | (see ieee80211_defs.h) |
  14166. * |-------------------------------------------------------------|
  14167. * | struct ieee80211_frame_addr4 |
  14168. * | (see ieee80211_defs.h) |
  14169. * |-------------------------------------------------------------|
  14170. * | ...... |
  14171. * |-------------------------------------------------------------|
  14172. *
  14173. * Header fields:
  14174. * - msg_type
  14175. * Bits 7:0
  14176. * Purpose: Identifies this is a monitor mac header indication message.
  14177. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  14178. * - peer_id
  14179. * Bits 31:16
  14180. * Purpose: Software peer id given by host during association,
  14181. * During promiscuous mode, the peer ID will be invalid (0xFF)
  14182. * for rx PPDUs received from unassociated peers.
  14183. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  14184. * - num_mpdu
  14185. * Bits 15:0
  14186. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  14187. * delivered within the message.
  14188. * Value: 1 to 32
  14189. * num_mpdu is limited to a maximum value of 32, due to buffer
  14190. * size limits. For PPDUs with more than 32 MPDUs, only the
  14191. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  14192. * the PPDU will be provided.
  14193. */
  14194. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  14195. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  14196. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  14197. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  14198. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  14199. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  14200. do { \
  14201. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  14202. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  14203. } while (0)
  14204. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  14205. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  14206. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  14207. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  14208. do { \
  14209. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  14210. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  14211. } while (0)
  14212. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  14213. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  14214. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  14215. /**
  14216. * @brief target -> host flow pool resize Message
  14217. *
  14218. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  14219. *
  14220. * @details
  14221. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  14222. * the flow pool associated with the specified ID is resized
  14223. *
  14224. * The message would appear as follows:
  14225. *
  14226. * |31 16|15 8|7 0|
  14227. * |---------------------------------+----------------+----------------|
  14228. * | reserved0 | Msg type |
  14229. * |-------------------------------------------------------------------|
  14230. * | flow pool new size | flow pool ID |
  14231. * |-------------------------------------------------------------------|
  14232. *
  14233. * The message is interpreted as follows:
  14234. * b'0:7 - msg_type: This will be set to 0x21
  14235. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  14236. *
  14237. * b'0:15 - flow pool ID: Existing flow pool ID
  14238. *
  14239. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  14240. *
  14241. */
  14242. PREPACK struct htt_flow_pool_resize_t {
  14243. A_UINT32 msg_type:8,
  14244. reserved0:24;
  14245. A_UINT32 flow_pool_id:16,
  14246. flow_pool_new_size:16;
  14247. } POSTPACK;
  14248. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  14249. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  14250. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  14251. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  14252. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  14253. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  14254. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  14255. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  14256. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  14257. do { \
  14258. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  14259. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  14260. } while (0)
  14261. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  14262. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  14263. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  14264. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  14265. do { \
  14266. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  14267. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  14268. } while (0)
  14269. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  14270. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  14271. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  14272. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  14273. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  14274. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  14275. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  14276. /*
  14277. * The read and write indices point to the data within the host buffer.
  14278. * Because the first 4 bytes of the host buffer is used for the read index and
  14279. * the next 4 bytes for the write index, the data itself starts at offset 8.
  14280. * The read index and write index are the byte offsets from the base of the
  14281. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  14282. * Refer the ASCII text picture below.
  14283. */
  14284. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  14285. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  14286. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  14287. /*
  14288. ***************************************************************************
  14289. *
  14290. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14291. *
  14292. ***************************************************************************
  14293. *
  14294. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  14295. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  14296. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  14297. * written into the Host memory region mentioned below.
  14298. *
  14299. * Read index is updated by the Host. At any point of time, the read index will
  14300. * indicate the index that will next be read by the Host. The read index is
  14301. * in units of bytes offset from the base of the meta-data buffer.
  14302. *
  14303. * Write index is updated by the FW. At any point of time, the write index will
  14304. * indicate from where the FW can start writing any new data. The write index is
  14305. * in units of bytes offset from the base of the meta-data buffer.
  14306. *
  14307. * If the Host is not fast enough in reading the CFR data, any new capture data
  14308. * would be dropped if there is no space left to write the new captures.
  14309. *
  14310. * The last 4 bytes of the memory region will have the magic pattern
  14311. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  14312. * not overrun the host buffer.
  14313. *
  14314. * ,--------------------. read and write indices store the
  14315. * | | byte offset from the base of the
  14316. * | ,--------+--------. meta-data buffer to the next
  14317. * | | | | location within the data buffer
  14318. * | | v v that will be read / written
  14319. * ************************************************************************
  14320. * * Read * Write * * Magic *
  14321. * * index * index * CFR data1 ...... CFR data N * pattern *
  14322. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  14323. * ************************************************************************
  14324. * |<---------- data buffer ---------->|
  14325. *
  14326. * |<----------------- meta-data buffer allocated in Host ----------------|
  14327. *
  14328. * Note:
  14329. * - Considering the 4 bytes needed to store the Read index (R) and the
  14330. * Write index (W), the initial value is as follows:
  14331. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  14332. * - Buffer empty condition:
  14333. * R = W
  14334. *
  14335. * Regarding CFR data format:
  14336. * --------------------------
  14337. *
  14338. * Each CFR tone is stored in HW as 16-bits with the following format:
  14339. * {bits[15:12], bits[11:6], bits[5:0]} =
  14340. * {unsigned exponent (4 bits),
  14341. * signed mantissa_real (6 bits),
  14342. * signed mantissa_imag (6 bits)}
  14343. *
  14344. * CFR_real = mantissa_real * 2^(exponent-5)
  14345. * CFR_imag = mantissa_imag * 2^(exponent-5)
  14346. *
  14347. *
  14348. * The CFR data is written to the 16-bit unsigned output array (buff) in
  14349. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  14350. *
  14351. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  14352. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  14353. * .
  14354. * .
  14355. * .
  14356. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  14357. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  14358. */
  14359. /* Bandwidth of peer CFR captures */
  14360. typedef enum {
  14361. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  14362. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  14363. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  14364. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  14365. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  14366. HTT_PEER_CFR_CAPTURE_BW_MAX,
  14367. } HTT_PEER_CFR_CAPTURE_BW;
  14368. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  14369. * was captured
  14370. */
  14371. typedef enum {
  14372. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  14373. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  14374. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  14375. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  14376. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  14377. } HTT_PEER_CFR_CAPTURE_MODE;
  14378. typedef enum {
  14379. /* This message type is currently used for the below purpose:
  14380. *
  14381. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  14382. * wmi_peer_cfr_capture_cmd.
  14383. * If payload_present bit is set to 0 then the associated memory region
  14384. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  14385. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  14386. * message; the CFR dump will be present at the end of the message,
  14387. * after the chan_phy_mode.
  14388. */
  14389. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  14390. /* Always keep this last */
  14391. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  14392. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  14393. /**
  14394. * @brief target -> host CFR dump completion indication message definition
  14395. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  14396. *
  14397. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  14398. *
  14399. * @details
  14400. * The following diagram shows the format of the Channel Frequency Response
  14401. * (CFR) dump completion indication. This inidcation is sent to the Host when
  14402. * the channel capture of a peer is copied by Firmware into the Host memory
  14403. *
  14404. * **************************************************************************
  14405. *
  14406. * Message format when the CFR capture message type is
  14407. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14408. *
  14409. * **************************************************************************
  14410. *
  14411. * |31 16|15 |8|7 0|
  14412. * |----------------------------------------------------------------|
  14413. * header: | reserved |P| msg_type |
  14414. * word 0 | | | |
  14415. * |----------------------------------------------------------------|
  14416. * payload: | cfr_capture_msg_type |
  14417. * word 1 | |
  14418. * |----------------------------------------------------------------|
  14419. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  14420. * word 2 | | | | | | | | |
  14421. * |----------------------------------------------------------------|
  14422. * | mac_addr31to0 |
  14423. * word 3 | |
  14424. * |----------------------------------------------------------------|
  14425. * | unused / reserved | mac_addr47to32 |
  14426. * word 4 | | |
  14427. * |----------------------------------------------------------------|
  14428. * | index |
  14429. * word 5 | |
  14430. * |----------------------------------------------------------------|
  14431. * | length |
  14432. * word 6 | |
  14433. * |----------------------------------------------------------------|
  14434. * | timestamp |
  14435. * word 7 | |
  14436. * |----------------------------------------------------------------|
  14437. * | counter |
  14438. * word 8 | |
  14439. * |----------------------------------------------------------------|
  14440. * | chan_mhz |
  14441. * word 9 | |
  14442. * |----------------------------------------------------------------|
  14443. * | band_center_freq1 |
  14444. * word 10 | |
  14445. * |----------------------------------------------------------------|
  14446. * | band_center_freq2 |
  14447. * word 11 | |
  14448. * |----------------------------------------------------------------|
  14449. * | chan_phy_mode |
  14450. * word 12 | |
  14451. * |----------------------------------------------------------------|
  14452. * where,
  14453. * P - payload present bit (payload_present explained below)
  14454. * req_id - memory request id (mem_req_id explained below)
  14455. * S - status field (status explained below)
  14456. * capbw - capture bandwidth (capture_bw explained below)
  14457. * mode - mode of capture (mode explained below)
  14458. * sts - space time streams (sts_count explained below)
  14459. * chbw - channel bandwidth (channel_bw explained below)
  14460. * captype - capture type (cap_type explained below)
  14461. *
  14462. * The following field definitions describe the format of the CFR dump
  14463. * completion indication sent from the target to the host
  14464. *
  14465. * Header fields:
  14466. *
  14467. * Word 0
  14468. * - msg_type
  14469. * Bits 7:0
  14470. * Purpose: Identifies this as CFR TX completion indication
  14471. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  14472. * - payload_present
  14473. * Bit 8
  14474. * Purpose: Identifies how CFR data is sent to host
  14475. * Value: 0 - If CFR Payload is written to host memory
  14476. * 1 - If CFR Payload is sent as part of HTT message
  14477. * (This is the requirement for SDIO/USB where it is
  14478. * not possible to write CFR data to host memory)
  14479. * - reserved
  14480. * Bits 31:9
  14481. * Purpose: Reserved
  14482. * Value: 0
  14483. *
  14484. * Payload fields:
  14485. *
  14486. * Word 1
  14487. * - cfr_capture_msg_type
  14488. * Bits 31:0
  14489. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  14490. * to specify the format used for the remainder of the message
  14491. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14492. * (currently only MSG_TYPE_1 is defined)
  14493. *
  14494. * Word 2
  14495. * - mem_req_id
  14496. * Bits 6:0
  14497. * Purpose: Contain the mem request id of the region where the CFR capture
  14498. * has been stored - of type WMI_HOST_MEM_REQ_ID
  14499. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  14500. this value is invalid)
  14501. * - status
  14502. * Bit 7
  14503. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  14504. * Value: 1 (True) - Successful; 0 (False) - Not successful
  14505. * - capture_bw
  14506. * Bits 10:8
  14507. * Purpose: Carry the bandwidth of the CFR capture
  14508. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  14509. * - mode
  14510. * Bits 13:11
  14511. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  14512. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  14513. * - sts_count
  14514. * Bits 16:14
  14515. * Purpose: Carry the number of space time streams
  14516. * Value: Number of space time streams
  14517. * - channel_bw
  14518. * Bits 19:17
  14519. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  14520. * measurement
  14521. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  14522. * - cap_type
  14523. * Bits 23:20
  14524. * Purpose: Carry the type of the capture
  14525. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  14526. * - vdev_id
  14527. * Bits 31:24
  14528. * Purpose: Carry the virtual device id
  14529. * Value: vdev ID
  14530. *
  14531. * Word 3
  14532. * - mac_addr31to0
  14533. * Bits 31:0
  14534. * Purpose: Contain the bits 31:0 of the peer MAC address
  14535. * Value: Bits 31:0 of the peer MAC address
  14536. *
  14537. * Word 4
  14538. * - mac_addr47to32
  14539. * Bits 15:0
  14540. * Purpose: Contain the bits 47:32 of the peer MAC address
  14541. * Value: Bits 47:32 of the peer MAC address
  14542. *
  14543. * Word 5
  14544. * - index
  14545. * Bits 31:0
  14546. * Purpose: Contain the index at which this CFR dump was written in the Host
  14547. * allocated memory. This index is the number of bytes from the base address.
  14548. * Value: Index position
  14549. *
  14550. * Word 6
  14551. * - length
  14552. * Bits 31:0
  14553. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  14554. * Value: Length of the CFR capture of the peer
  14555. *
  14556. * Word 7
  14557. * - timestamp
  14558. * Bits 31:0
  14559. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  14560. * clock used for this timestamp is private to the target and not visible to
  14561. * the host i.e., Host can interpret only the relative timestamp deltas from
  14562. * one message to the next, but can't interpret the absolute timestamp from a
  14563. * single message.
  14564. * Value: Timestamp in microseconds
  14565. *
  14566. * Word 8
  14567. * - counter
  14568. * Bits 31:0
  14569. * Purpose: Carry the count of the current CFR capture from FW. This is
  14570. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  14571. * in host memory)
  14572. * Value: Count of the current CFR capture
  14573. *
  14574. * Word 9
  14575. * - chan_mhz
  14576. * Bits 31:0
  14577. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  14578. * Value: Primary 20 channel frequency
  14579. *
  14580. * Word 10
  14581. * - band_center_freq1
  14582. * Bits 31:0
  14583. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  14584. * Value: Center frequency 1 in MHz
  14585. *
  14586. * Word 11
  14587. * - band_center_freq2
  14588. * Bits 31:0
  14589. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  14590. * the VDEV
  14591. * 80plus80 mode
  14592. * Value: Center frequency 2 in MHz
  14593. *
  14594. * Word 12
  14595. * - chan_phy_mode
  14596. * Bits 31:0
  14597. * Purpose: Carry the phy mode of the channel, of the VDEV
  14598. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  14599. */
  14600. PREPACK struct htt_cfr_dump_ind_type_1 {
  14601. A_UINT32 mem_req_id:7,
  14602. status:1,
  14603. capture_bw:3,
  14604. mode:3,
  14605. sts_count:3,
  14606. channel_bw:3,
  14607. cap_type:4,
  14608. vdev_id:8;
  14609. htt_mac_addr addr;
  14610. A_UINT32 index;
  14611. A_UINT32 length;
  14612. A_UINT32 timestamp;
  14613. A_UINT32 counter;
  14614. struct htt_chan_change_msg chan;
  14615. } POSTPACK;
  14616. PREPACK struct htt_cfr_dump_compl_ind {
  14617. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  14618. union {
  14619. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  14620. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  14621. /* If there is a need to change the memory layout and its associated
  14622. * HTT indication format, a new CFR capture message type can be
  14623. * introduced and added into this union.
  14624. */
  14625. };
  14626. } POSTPACK;
  14627. /*
  14628. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  14629. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14630. */
  14631. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  14632. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  14633. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  14634. do { \
  14635. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  14636. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  14637. } while(0)
  14638. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  14639. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  14640. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  14641. /*
  14642. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  14643. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14644. */
  14645. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  14646. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  14647. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  14648. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  14649. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  14650. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  14651. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  14652. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  14653. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  14654. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  14655. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  14656. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  14657. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  14658. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  14659. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  14660. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  14661. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  14662. do { \
  14663. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  14664. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  14665. } while (0)
  14666. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  14667. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  14668. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  14669. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  14670. do { \
  14671. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  14672. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  14673. } while (0)
  14674. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  14675. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  14676. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  14677. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  14678. do { \
  14679. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  14680. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  14681. } while (0)
  14682. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  14683. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  14684. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  14685. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  14686. do { \
  14687. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  14688. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  14689. } while (0)
  14690. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  14691. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  14692. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  14693. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  14694. do { \
  14695. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  14696. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  14697. } while (0)
  14698. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  14699. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  14700. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  14701. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  14702. do { \
  14703. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  14704. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  14705. } while (0)
  14706. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  14707. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  14708. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  14709. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  14710. do { \
  14711. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  14712. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  14713. } while (0)
  14714. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  14715. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  14716. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  14717. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  14718. do { \
  14719. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  14720. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  14721. } while (0)
  14722. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  14723. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  14724. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  14725. /**
  14726. * @brief target -> host peer (PPDU) stats message
  14727. *
  14728. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  14729. *
  14730. * @details
  14731. * This message is generated by FW when FW is sending stats to host
  14732. * about one or more PPDUs that the FW has transmitted to one or more peers.
  14733. * This message is sent autonomously by the target rather than upon request
  14734. * by the host.
  14735. * The following field definitions describe the format of the HTT target
  14736. * to host peer stats indication message.
  14737. *
  14738. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  14739. * or more PPDU stats records.
  14740. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  14741. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  14742. * then the message would start with the
  14743. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  14744. * below.
  14745. *
  14746. * |31 16|15|14|13 11|10 9|8|7 0|
  14747. * |-------------------------------------------------------------|
  14748. * | reserved |MSG_TYPE |
  14749. * |-------------------------------------------------------------|
  14750. * rec 0 | TLV header |
  14751. * rec 0 |-------------------------------------------------------------|
  14752. * rec 0 | ppdu successful bytes |
  14753. * rec 0 |-------------------------------------------------------------|
  14754. * rec 0 | ppdu retry bytes |
  14755. * rec 0 |-------------------------------------------------------------|
  14756. * rec 0 | ppdu failed bytes |
  14757. * rec 0 |-------------------------------------------------------------|
  14758. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  14759. * rec 0 |-------------------------------------------------------------|
  14760. * rec 0 | retried MSDUs | successful MSDUs |
  14761. * rec 0 |-------------------------------------------------------------|
  14762. * rec 0 | TX duration | failed MSDUs |
  14763. * rec 0 |-------------------------------------------------------------|
  14764. * ...
  14765. * |-------------------------------------------------------------|
  14766. * rec N | TLV header |
  14767. * rec N |-------------------------------------------------------------|
  14768. * rec N | ppdu successful bytes |
  14769. * rec N |-------------------------------------------------------------|
  14770. * rec N | ppdu retry bytes |
  14771. * rec N |-------------------------------------------------------------|
  14772. * rec N | ppdu failed bytes |
  14773. * rec N |-------------------------------------------------------------|
  14774. * rec N | peer id | S|SG| BW | BA |A|rate code|
  14775. * rec N |-------------------------------------------------------------|
  14776. * rec N | retried MSDUs | successful MSDUs |
  14777. * rec N |-------------------------------------------------------------|
  14778. * rec N | TX duration | failed MSDUs |
  14779. * rec N |-------------------------------------------------------------|
  14780. *
  14781. * where:
  14782. * A = is A-MPDU flag
  14783. * BA = block-ack failure flags
  14784. * BW = bandwidth spec
  14785. * SG = SGI enabled spec
  14786. * S = skipped rate ctrl
  14787. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  14788. *
  14789. * Header
  14790. * ------
  14791. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  14792. * dword0 - b'8:31 - reserved : Reserved for future use
  14793. *
  14794. * payload include below peer_stats information
  14795. * --------------------------------------------
  14796. * @TLV : HTT_PPDU_STATS_INFO_TLV
  14797. * @tx_success_bytes : total successful bytes in the PPDU.
  14798. * @tx_retry_bytes : total retried bytes in the PPDU.
  14799. * @tx_failed_bytes : total failed bytes in the PPDU.
  14800. * @tx_ratecode : rate code used for the PPDU.
  14801. * @is_ampdu : Indicates PPDU is AMPDU or not.
  14802. * @ba_ack_failed : BA/ACK failed for this PPDU
  14803. * b00 -> BA received
  14804. * b01 -> BA failed once
  14805. * b10 -> BA failed twice, when HW retry is enabled.
  14806. * @bw : BW
  14807. * b00 -> 20 MHz
  14808. * b01 -> 40 MHz
  14809. * b10 -> 80 MHz
  14810. * b11 -> 160 MHz (or 80+80)
  14811. * @sg : SGI enabled
  14812. * @s : skipped ratectrl
  14813. * @peer_id : peer id
  14814. * @tx_success_msdus : successful MSDUs
  14815. * @tx_retry_msdus : retried MSDUs
  14816. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  14817. * @tx_duration : Tx duration for the PPDU (microsecond units)
  14818. */
  14819. /**
  14820. * @brief target -> host backpressure event
  14821. *
  14822. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  14823. *
  14824. * @details
  14825. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  14826. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  14827. * This message will only be sent if the backpressure condition has existed
  14828. * continuously for an initial period (100 ms).
  14829. * Repeat messages with updated information will be sent after each
  14830. * subsequent period (100 ms) as long as the backpressure remains unabated.
  14831. * This message indicates the ring id along with current head and tail index
  14832. * locations (i.e. write and read indices).
  14833. * The backpressure time indicates the time in ms for which continous
  14834. * backpressure has been observed in the ring.
  14835. *
  14836. * The message format is as follows:
  14837. *
  14838. * |31 24|23 16|15 8|7 0|
  14839. * |----------------+----------------+----------------+----------------|
  14840. * | ring_id | ring_type | pdev_id | msg_type |
  14841. * |-------------------------------------------------------------------|
  14842. * | tail_idx | head_idx |
  14843. * |-------------------------------------------------------------------|
  14844. * | backpressure_time_ms |
  14845. * |-------------------------------------------------------------------|
  14846. *
  14847. * The message is interpreted as follows:
  14848. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  14849. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  14850. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  14851. * 1, 2, 3 indicates pdev_id 0,1,2 and
  14852. the msg is for LMAC ring.
  14853. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  14854. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  14855. * htt_backpressure_lmac_ring_id. This represents
  14856. * the ring id for which continous backpressure is seen
  14857. *
  14858. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  14859. * the ring indicated by the ring_id
  14860. *
  14861. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  14862. * the ring indicated by the ring id
  14863. *
  14864. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  14865. * backpressure has been seen in the ring
  14866. * indicated by the ring_id.
  14867. * Units = milliseconds
  14868. */
  14869. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  14870. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  14871. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  14872. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  14873. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  14874. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  14875. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  14876. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  14877. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  14878. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  14879. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  14880. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  14881. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  14882. do { \
  14883. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  14884. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  14885. } while (0)
  14886. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  14887. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  14888. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  14889. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  14890. do { \
  14891. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  14892. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  14893. } while (0)
  14894. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  14895. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  14896. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  14897. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  14898. do { \
  14899. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  14900. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  14901. } while (0)
  14902. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  14903. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  14904. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  14905. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  14906. do { \
  14907. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  14908. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  14909. } while (0)
  14910. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  14911. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  14912. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  14913. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  14914. do { \
  14915. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  14916. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  14917. } while (0)
  14918. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  14919. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  14920. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  14921. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  14922. do { \
  14923. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  14924. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  14925. } while (0)
  14926. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  14927. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  14928. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  14929. enum htt_backpressure_ring_type {
  14930. HTT_SW_RING_TYPE_UMAC,
  14931. HTT_SW_RING_TYPE_LMAC,
  14932. HTT_SW_RING_TYPE_MAX,
  14933. };
  14934. /* Ring id for which the message is sent to host */
  14935. enum htt_backpressure_umac_ringid {
  14936. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  14937. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  14938. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  14939. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  14940. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  14941. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  14942. HTT_SW_RING_IDX_REO_REO2FW_RING,
  14943. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  14944. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  14945. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  14946. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  14947. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  14948. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  14949. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  14950. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  14951. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  14952. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  14953. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  14954. HTT_SW_UMAC_RING_IDX_MAX,
  14955. };
  14956. enum htt_backpressure_lmac_ringid {
  14957. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  14958. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  14959. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  14960. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  14961. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  14962. HTT_SW_RING_IDX_RXDMA2FW_RING,
  14963. HTT_SW_RING_IDX_RXDMA2SW_RING,
  14964. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  14965. HTT_SW_RING_IDX_RXDMA2REO_RING,
  14966. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  14967. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  14968. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  14969. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  14970. HTT_SW_LMAC_RING_IDX_MAX,
  14971. };
  14972. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  14973. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  14974. pdev_id: 8,
  14975. ring_type: 8, /* htt_backpressure_ring_type */
  14976. /*
  14977. * ring_id holds an enum value from either
  14978. * htt_backpressure_umac_ringid or
  14979. * htt_backpressure_lmac_ringid, based on
  14980. * the ring_type setting.
  14981. */
  14982. ring_id: 8;
  14983. A_UINT16 head_idx;
  14984. A_UINT16 tail_idx;
  14985. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  14986. } POSTPACK;
  14987. /*
  14988. * Defines two 32 bit words that can be used by the target to indicate a per
  14989. * user RU allocation and rate information.
  14990. *
  14991. * This information is currently provided in the "sw_response_reference_ptr"
  14992. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  14993. * "rx_ppdu_end_user_stats" TLV.
  14994. *
  14995. * VALID:
  14996. * The consumer of these words must explicitly check the valid bit,
  14997. * and only attempt interpretation of any of the remaining fields if
  14998. * the valid bit is set to 1.
  14999. *
  15000. * VERSION:
  15001. * The consumer of these words must also explicitly check the version bit,
  15002. * and only use the V0 definition if the VERSION field is set to 0.
  15003. *
  15004. * Version 1 is currently undefined, with the exception of the VALID and
  15005. * VERSION fields.
  15006. *
  15007. * Version 0:
  15008. *
  15009. * The fields below are duplicated per BW.
  15010. *
  15011. * The consumer must determine which BW field to use, based on the UL OFDMA
  15012. * PPDU BW indicated by HW.
  15013. *
  15014. * RU_START: RU26 start index for the user.
  15015. * Note that this is always using the RU26 index, regardless
  15016. * of the actual RU assigned to the user
  15017. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  15018. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  15019. *
  15020. * For example, 20MHz (the value in the top row is RU_START)
  15021. *
  15022. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  15023. * RU Size 1 (52): | | | | | |
  15024. * RU Size 2 (106): | | | |
  15025. * RU Size 3 (242): | |
  15026. *
  15027. * RU_SIZE: Indicates the RU size, as defined by enum
  15028. * htt_ul_ofdma_user_info_ru_size.
  15029. *
  15030. * LDPC: LDPC enabled (if 0, BCC is used)
  15031. *
  15032. * DCM: DCM enabled
  15033. *
  15034. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  15035. * |---------------------------------+--------------------------------|
  15036. * |Ver|Valid| FW internal |
  15037. * |---------------------------------+--------------------------------|
  15038. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  15039. * |---------------------------------+--------------------------------|
  15040. */
  15041. enum htt_ul_ofdma_user_info_ru_size {
  15042. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  15043. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  15044. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  15045. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  15046. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  15047. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  15048. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  15049. };
  15050. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  15051. struct htt_ul_ofdma_user_info_v0 {
  15052. A_UINT32 word0;
  15053. A_UINT32 word1;
  15054. };
  15055. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  15056. A_UINT32 w0_fw_rsvd:30; \
  15057. A_UINT32 w0_valid:1; \
  15058. A_UINT32 w0_version:1;
  15059. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  15060. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15061. };
  15062. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  15063. A_UINT32 w1_nss:3; \
  15064. A_UINT32 w1_mcs:4; \
  15065. A_UINT32 w1_ldpc:1; \
  15066. A_UINT32 w1_dcm:1; \
  15067. A_UINT32 w1_ru_start:7; \
  15068. A_UINT32 w1_ru_size:3; \
  15069. A_UINT32 w1_trig_type:4; \
  15070. A_UINT32 w1_unused:9;
  15071. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  15072. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15073. };
  15074. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  15075. A_UINT32 w0_fw_rsvd:27; \
  15076. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  15077. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  15078. 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) */
  15079. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  15080. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15081. };
  15082. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  15083. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  15084. A_UINT32 w1_trig_type:4; \
  15085. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  15086. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  15087. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15088. };
  15089. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  15090. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  15091. union {
  15092. A_UINT32 word0;
  15093. struct {
  15094. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15095. };
  15096. };
  15097. union {
  15098. A_UINT32 word1;
  15099. struct {
  15100. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15101. };
  15102. };
  15103. } POSTPACK;
  15104. /*
  15105. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  15106. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  15107. * this should be picked.
  15108. */
  15109. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  15110. union {
  15111. A_UINT32 word0;
  15112. struct {
  15113. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15114. };
  15115. };
  15116. union {
  15117. A_UINT32 word1;
  15118. struct {
  15119. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15120. };
  15121. };
  15122. } POSTPACK;
  15123. enum HTT_UL_OFDMA_TRIG_TYPE {
  15124. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  15125. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  15126. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  15127. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  15128. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  15129. };
  15130. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  15131. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  15132. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  15133. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  15134. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  15135. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  15136. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  15137. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  15138. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  15139. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  15140. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  15141. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  15142. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  15143. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  15144. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  15145. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  15146. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  15147. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  15148. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  15149. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  15150. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  15151. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  15152. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  15153. /*--- word 0 ---*/
  15154. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  15155. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  15156. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  15157. do { \
  15158. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  15159. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  15160. } while (0)
  15161. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  15162. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  15163. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  15164. do { \
  15165. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  15166. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  15167. } while (0)
  15168. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  15169. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  15170. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  15171. do { \
  15172. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  15173. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  15174. } while (0)
  15175. /*--- word 1 ---*/
  15176. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  15177. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  15178. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  15179. do { \
  15180. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  15181. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  15182. } while (0)
  15183. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  15184. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  15185. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  15186. do { \
  15187. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  15188. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  15189. } while (0)
  15190. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  15191. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  15192. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  15193. do { \
  15194. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  15195. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  15196. } while (0)
  15197. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  15198. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  15199. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  15200. do { \
  15201. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  15202. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  15203. } while (0)
  15204. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  15205. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  15206. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  15207. do { \
  15208. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  15209. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  15210. } while (0)
  15211. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  15212. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  15213. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  15214. do { \
  15215. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  15216. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  15217. } while (0)
  15218. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  15219. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  15220. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  15221. do { \
  15222. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  15223. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  15224. } while (0)
  15225. /**
  15226. * @brief target -> host channel calibration data message
  15227. *
  15228. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  15229. *
  15230. * @brief host -> target channel calibration data message
  15231. *
  15232. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  15233. *
  15234. * @details
  15235. * The following field definitions describe the format of the channel
  15236. * calibration data message sent from the target to the host when
  15237. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  15238. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  15239. * The message is defined as htt_chan_caldata_msg followed by a variable
  15240. * number of 32-bit character values.
  15241. *
  15242. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  15243. * |------------------------------------------------------------------|
  15244. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  15245. * |------------------------------------------------------------------|
  15246. * | payload size | mhz |
  15247. * |------------------------------------------------------------------|
  15248. * | center frequency 2 | center frequency 1 |
  15249. * |------------------------------------------------------------------|
  15250. * | check sum |
  15251. * |------------------------------------------------------------------|
  15252. * | payload |
  15253. * |------------------------------------------------------------------|
  15254. * message info field:
  15255. * - MSG_TYPE
  15256. * Bits 7:0
  15257. * Purpose: identifies this as a channel calibration data message
  15258. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  15259. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  15260. * - SUB_TYPE
  15261. * Bits 11:8
  15262. * Purpose: T2H: indicates whether target is providing chan cal data
  15263. * to the host to store, or requesting that the host
  15264. * download previously-stored data.
  15265. * H2T: indicates whether the host is providing the requested
  15266. * channel cal data, or if it is rejecting the data
  15267. * request because it does not have the requested data.
  15268. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  15269. * - CHKSUM_VALID
  15270. * Bit 12
  15271. * Purpose: indicates if the checksum field is valid
  15272. * value:
  15273. * - FRAG
  15274. * Bit 19:16
  15275. * Purpose: indicates the fragment index for message
  15276. * value: 0 for first fragment, 1 for second fragment, ...
  15277. * - APPEND
  15278. * Bit 20
  15279. * Purpose: indicates if this is the last fragment
  15280. * value: 0 = final fragment, 1 = more fragments will be appended
  15281. *
  15282. * channel and payload size field
  15283. * - MHZ
  15284. * Bits 15:0
  15285. * Purpose: indicates the channel primary frequency
  15286. * Value:
  15287. * - PAYLOAD_SIZE
  15288. * Bits 31:16
  15289. * Purpose: indicates the bytes of calibration data in payload
  15290. * Value:
  15291. *
  15292. * center frequency field
  15293. * - CENTER FREQUENCY 1
  15294. * Bits 15:0
  15295. * Purpose: indicates the channel center frequency
  15296. * Value: channel center frequency, in MHz units
  15297. * - CENTER FREQUENCY 2
  15298. * Bits 31:16
  15299. * Purpose: indicates the secondary channel center frequency,
  15300. * only for 11acvht 80plus80 mode
  15301. * Value: secondary channel center frequeny, in MHz units, if applicable
  15302. *
  15303. * checksum field
  15304. * - CHECK_SUM
  15305. * Bits 31:0
  15306. * Purpose: check the payload data, it is just for this fragment.
  15307. * This is intended for the target to check that the channel
  15308. * calibration data returned by the host is the unmodified data
  15309. * that was previously provided to the host by the target.
  15310. * value: checksum of fragment payload
  15311. */
  15312. PREPACK struct htt_chan_caldata_msg {
  15313. /* DWORD 0: message info */
  15314. A_UINT32
  15315. msg_type: 8,
  15316. sub_type: 4 ,
  15317. chksum_valid: 1, /** 1:valid, 0:invalid */
  15318. reserved1: 3,
  15319. frag_idx: 4, /** fragment index for calibration data */
  15320. appending: 1, /** 0: no fragment appending,
  15321. * 1: extra fragment appending */
  15322. reserved2: 11;
  15323. /* DWORD 1: channel and payload size */
  15324. A_UINT32
  15325. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  15326. payload_size: 16; /** unit: bytes */
  15327. /* DWORD 2: center frequency */
  15328. A_UINT32
  15329. band_center_freq1: 16, /** Center frequency 1 in MHz */
  15330. band_center_freq2: 16; /** Center frequency 2 in MHz,
  15331. * valid only for 11acvht 80plus80 mode */
  15332. /* DWORD 3: check sum */
  15333. A_UINT32 chksum;
  15334. /* variable length for calibration data */
  15335. A_UINT32 payload[1/* or more */];
  15336. } POSTPACK;
  15337. /* T2H SUBTYPE */
  15338. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  15339. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  15340. /* H2T SUBTYPE */
  15341. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  15342. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  15343. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  15344. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  15345. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  15346. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  15347. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  15348. do { \
  15349. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  15350. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  15351. } while (0)
  15352. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  15353. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  15354. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  15355. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  15356. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  15357. do { \
  15358. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  15359. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  15360. } while (0)
  15361. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  15362. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  15363. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  15364. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  15365. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  15366. do { \
  15367. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  15368. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  15369. } while (0)
  15370. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  15371. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  15372. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  15373. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  15374. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  15375. do { \
  15376. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  15377. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  15378. } while (0)
  15379. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  15380. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  15381. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  15382. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  15383. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  15384. do { \
  15385. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  15386. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  15387. } while (0)
  15388. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  15389. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  15390. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  15391. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  15392. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  15393. do { \
  15394. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  15395. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  15396. } while (0)
  15397. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  15398. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  15399. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  15400. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  15401. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  15402. do { \
  15403. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  15404. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  15405. } while (0)
  15406. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  15407. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  15408. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  15409. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  15410. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  15411. do { \
  15412. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  15413. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  15414. } while (0)
  15415. /**
  15416. * @brief target -> host FSE CMEM based send
  15417. *
  15418. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  15419. *
  15420. * @details
  15421. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  15422. * FSE placement in CMEM is enabled.
  15423. *
  15424. * This message sends the non-secure CMEM base address.
  15425. * It will be sent to host in response to message
  15426. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  15427. * The message would appear as follows:
  15428. *
  15429. * |31 24|23 16|15 8|7 0|
  15430. * |----------------+----------------+----------------+----------------|
  15431. * | reserved | num_entries | msg_type |
  15432. * |----------------+----------------+----------------+----------------|
  15433. * | base_address_lo |
  15434. * |----------------+----------------+----------------+----------------|
  15435. * | base_address_hi |
  15436. * |-------------------------------------------------------------------|
  15437. *
  15438. * The message is interpreted as follows:
  15439. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  15440. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  15441. * b'8:15 - number_entries: Indicated the number of entries
  15442. * programmed.
  15443. * b'16:31 - reserved.
  15444. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  15445. * CMEM base address
  15446. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  15447. * CMEM base address
  15448. */
  15449. PREPACK struct htt_cmem_base_send_t {
  15450. A_UINT32 msg_type: 8,
  15451. num_entries: 8,
  15452. reserved: 16;
  15453. A_UINT32 base_address_lo;
  15454. A_UINT32 base_address_hi;
  15455. } POSTPACK;
  15456. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  15457. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  15458. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  15459. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  15460. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  15461. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  15462. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  15463. do { \
  15464. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  15465. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  15466. } while (0)
  15467. /**
  15468. * @brief - HTT PPDU ID format
  15469. *
  15470. * @details
  15471. * The following field definitions describe the format of the PPDU ID.
  15472. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  15473. *
  15474. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  15475. * +--------------------------------------------------------------------------
  15476. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  15477. * +--------------------------------------------------------------------------
  15478. *
  15479. * sch id :Schedule command id
  15480. * Bits [11 : 0] : monotonically increasing counter to track the
  15481. * PPDU posted to a specific transmit queue.
  15482. *
  15483. * hwq_id: Hardware Queue ID.
  15484. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  15485. *
  15486. * mac_id: MAC ID
  15487. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  15488. *
  15489. * seq_idx: Sequence index.
  15490. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  15491. * a particular TXOP.
  15492. *
  15493. * tqm_cmd: HWSCH/TQM flag.
  15494. * Bit [23] : Always set to 0.
  15495. *
  15496. * seq_cmd_type: Sequence command type.
  15497. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  15498. * Refer to enum HTT_STATS_FTYPE for values.
  15499. */
  15500. PREPACK struct htt_ppdu_id {
  15501. A_UINT32
  15502. sch_id: 12,
  15503. hwq_id: 5,
  15504. mac_id: 2,
  15505. seq_idx: 2,
  15506. reserved1: 2,
  15507. tqm_cmd: 1,
  15508. seq_cmd_type: 6,
  15509. reserved2: 2;
  15510. } POSTPACK;
  15511. #define HTT_PPDU_ID_SCH_ID_S 0
  15512. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  15513. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  15514. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  15515. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  15516. do { \
  15517. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  15518. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  15519. } while (0)
  15520. #define HTT_PPDU_ID_HWQ_ID_S 12
  15521. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  15522. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  15523. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  15524. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  15525. do { \
  15526. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  15527. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  15528. } while (0)
  15529. #define HTT_PPDU_ID_MAC_ID_S 17
  15530. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  15531. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  15532. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  15533. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  15534. do { \
  15535. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  15536. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  15537. } while (0)
  15538. #define HTT_PPDU_ID_SEQ_IDX_S 19
  15539. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  15540. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  15541. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  15542. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  15543. do { \
  15544. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  15545. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  15546. } while (0)
  15547. #define HTT_PPDU_ID_TQM_CMD_S 23
  15548. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  15549. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  15550. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  15551. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  15552. do { \
  15553. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  15554. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  15555. } while (0)
  15556. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  15557. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  15558. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  15559. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  15560. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  15561. do { \
  15562. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  15563. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  15564. } while (0)
  15565. /**
  15566. * @brief target -> RX PEER METADATA V0 format
  15567. * Host will know the peer metadata version from the wmi_service_ready_ext2
  15568. * message from target, and will confirm to the target which peer metadata
  15569. * version to use in the wmi_init message.
  15570. *
  15571. * The following diagram shows the format of the RX PEER METADATA.
  15572. *
  15573. * |31 24|23 16|15 8|7 0|
  15574. * |-----------------------------------------------------------------------|
  15575. * | Reserved | VDEV ID | PEER ID |
  15576. * |-----------------------------------------------------------------------|
  15577. */
  15578. PREPACK struct htt_rx_peer_metadata_v0 {
  15579. A_UINT32
  15580. peer_id: 16,
  15581. vdev_id: 8,
  15582. reserved1: 8;
  15583. } POSTPACK;
  15584. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  15585. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  15586. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  15587. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  15588. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  15589. do { \
  15590. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  15591. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  15592. } while (0)
  15593. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  15594. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  15595. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  15596. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  15597. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  15598. do { \
  15599. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  15600. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  15601. } while (0)
  15602. /**
  15603. * @brief target -> RX PEER METADATA V1 format
  15604. * Host will know the peer metadata version from the wmi_service_ready_ext2
  15605. * message from target, and will confirm to the target which peer metadata
  15606. * version to use in the wmi_init message.
  15607. *
  15608. * The following diagram shows the format of the RX PEER METADATA V1 format.
  15609. *
  15610. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  15611. * |-----------------------------------------------------------------------|
  15612. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  15613. * |-----------------------------------------------------------------------|
  15614. */
  15615. PREPACK struct htt_rx_peer_metadata_v1 {
  15616. A_UINT32
  15617. peer_id: 13,
  15618. ml_peer_valid: 1,
  15619. reserved1: 2,
  15620. vdev_id: 8,
  15621. lmac_id: 2,
  15622. chip_id: 3,
  15623. reserved2: 3;
  15624. } POSTPACK;
  15625. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  15626. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  15627. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  15628. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  15629. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  15630. do { \
  15631. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  15632. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  15633. } while (0)
  15634. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  15635. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  15636. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  15637. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  15638. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  15639. do { \
  15640. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  15641. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  15642. } while (0)
  15643. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  15644. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  15645. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  15646. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  15647. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  15648. do { \
  15649. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  15650. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  15651. } while (0)
  15652. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  15653. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  15654. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  15655. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  15656. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  15657. do { \
  15658. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  15659. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  15660. } while (0)
  15661. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  15662. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  15663. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  15664. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  15665. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  15666. do { \
  15667. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  15668. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  15669. } while (0)
  15670. /*
  15671. * In some systems, the host SW wants to specify priorities between
  15672. * different MSDU / flow queues within the same peer-TID.
  15673. * The below enums are used for the host to identify to the target
  15674. * which MSDU queue's priority it wants to adjust.
  15675. */
  15676. /*
  15677. * The MSDUQ index describe index of TCL HW, where each index is
  15678. * used for queuing particular types of MSDUs.
  15679. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  15680. */
  15681. enum HTT_MSDUQ_INDEX {
  15682. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  15683. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  15684. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  15685. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  15686. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  15687. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  15688. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  15689. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  15690. HTT_MSDUQ_MAX_INDEX,
  15691. };
  15692. /* MSDU qtype definition */
  15693. enum HTT_MSDU_QTYPE {
  15694. /*
  15695. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  15696. * relative priority. Instead, the relative priority of CRIT_0 versus
  15697. * CRIT_1 is controlled by the FW, through the configuration parameters
  15698. * it applies to the queues.
  15699. */
  15700. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  15701. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  15702. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  15703. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  15704. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  15705. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  15706. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  15707. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  15708. /* New MSDU_QTYPE should be added above this line */
  15709. /*
  15710. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  15711. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  15712. * any host/target message definitions. The QTYPE_MAX value can
  15713. * only be used internally within the host or within the target.
  15714. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  15715. * it must regard the unexpected value as a default qtype value,
  15716. * or ignore it.
  15717. */
  15718. HTT_MSDU_QTYPE_MAX,
  15719. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  15720. };
  15721. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  15722. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  15723. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  15724. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  15725. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  15726. };
  15727. /**
  15728. * @brief target -> host mlo timestamp offset indication
  15729. *
  15730. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  15731. *
  15732. * @details
  15733. * The following field definitions describe the format of the HTT target
  15734. * to host mlo timestamp offset indication message.
  15735. *
  15736. *
  15737. * |31 16|15 12|11 10|9 8|7 0 |
  15738. * |----------------------------------------------------------------------|
  15739. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  15740. * |----------------------------------------------------------------------|
  15741. * | Sync time stamp lo in us |
  15742. * |----------------------------------------------------------------------|
  15743. * | Sync time stamp hi in us |
  15744. * |----------------------------------------------------------------------|
  15745. * | mlo time stamp offset lo in us |
  15746. * |----------------------------------------------------------------------|
  15747. * | mlo time stamp offset hi in us |
  15748. * |----------------------------------------------------------------------|
  15749. * | mlo time stamp offset clocks in clock ticks |
  15750. * |----------------------------------------------------------------------|
  15751. * |31 26|25 16|15 0 |
  15752. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  15753. * | | compensation in clks | |
  15754. * |----------------------------------------------------------------------|
  15755. * |31 22|21 0 |
  15756. * | rsvd 3 | mlo time stamp comp timer period |
  15757. * |----------------------------------------------------------------------|
  15758. * The message is interpreted as follows:
  15759. *
  15760. * dword0 - b'0:7 - msg_type: This will be set to
  15761. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  15762. * value: 0x28
  15763. *
  15764. * dword0 - b'9:8 - pdev_id
  15765. *
  15766. * dword0 - b'11:10 - chip_id
  15767. *
  15768. * dword0 - b'15:12 - rsvd1: Reserved for future use
  15769. *
  15770. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  15771. *
  15772. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  15773. * which last sync interrupt was received
  15774. *
  15775. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  15776. * which last sync interrupt was received
  15777. *
  15778. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  15779. *
  15780. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  15781. *
  15782. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  15783. *
  15784. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  15785. *
  15786. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  15787. * for sub us resolution
  15788. *
  15789. * dword6 - b'31:26 - rsvd2: Reserved for future use
  15790. *
  15791. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  15792. * is applied, in us
  15793. *
  15794. * dword7 - b'31:22 - rsvd3: Reserved for future use
  15795. */
  15796. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  15797. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  15798. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  15799. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  15800. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  15801. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  15802. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  15803. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  15804. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  15805. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  15806. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  15807. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  15808. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  15809. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  15810. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  15811. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  15812. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  15813. do { \
  15814. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  15815. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  15816. } while (0)
  15817. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  15818. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  15819. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  15820. do { \
  15821. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  15822. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  15823. } while (0)
  15824. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  15825. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  15826. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  15827. do { \
  15828. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  15829. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  15830. } while (0)
  15831. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  15832. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  15833. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  15834. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  15835. do { \
  15836. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  15837. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  15838. } while (0)
  15839. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  15840. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  15841. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  15842. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  15843. do { \
  15844. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  15845. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  15846. } while (0)
  15847. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  15848. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  15849. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  15850. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  15851. do { \
  15852. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  15853. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  15854. } while (0)
  15855. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  15856. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  15857. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  15858. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  15859. do { \
  15860. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  15861. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  15862. } while (0)
  15863. typedef struct {
  15864. A_UINT32 msg_type: 8, /* bits 7:0 */
  15865. pdev_id: 2, /* bits 9:8 */
  15866. chip_id: 2, /* bits 11:10 */
  15867. reserved1: 4, /* bits 15:12 */
  15868. mac_clk_freq_mhz: 16; /* bits 31:16 */
  15869. A_UINT32 sync_timestamp_lo_us;
  15870. A_UINT32 sync_timestamp_hi_us;
  15871. A_UINT32 mlo_timestamp_offset_lo_us;
  15872. A_UINT32 mlo_timestamp_offset_hi_us;
  15873. A_UINT32 mlo_timestamp_offset_clks;
  15874. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  15875. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  15876. reserved2: 6; /* bits 31:26 */
  15877. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  15878. reserved3: 10; /* bits 31:22 */
  15879. } htt_t2h_mlo_offset_ind_t;
  15880. /*
  15881. * @brief target -> host VDEV TX RX STATS
  15882. *
  15883. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  15884. *
  15885. * @details
  15886. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  15887. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  15888. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  15889. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  15890. * periodically by target even in the absence of any further HTT request
  15891. * messages from host.
  15892. *
  15893. * The message is formatted as follows:
  15894. *
  15895. * |31 16|15 8|7 0|
  15896. * |---------------------------------+----------------+----------------|
  15897. * | payload_size | pdev_id | msg_type |
  15898. * |---------------------------------+----------------+----------------|
  15899. * | reserved0 |
  15900. * |-------------------------------------------------------------------|
  15901. * | reserved1 |
  15902. * |-------------------------------------------------------------------|
  15903. * | reserved2 |
  15904. * |-------------------------------------------------------------------|
  15905. * | |
  15906. * | VDEV specific Tx Rx stats info |
  15907. * | |
  15908. * |-------------------------------------------------------------------|
  15909. *
  15910. * The message is interpreted as follows:
  15911. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  15912. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  15913. * b'8:15 - pdev_id
  15914. * b'16:31 - size in bytes of the payload that follows the 16-byte
  15915. * message header fields (msg_type through reserved2)
  15916. * dword1 - b'0:31 - reserved0.
  15917. * dword2 - b'0:31 - reserved1.
  15918. * dword3 - b'0:31 - reserved2.
  15919. */
  15920. typedef struct {
  15921. A_UINT32 msg_type: 8,
  15922. pdev_id: 8,
  15923. payload_size: 16;
  15924. A_UINT32 reserved0;
  15925. A_UINT32 reserved1;
  15926. A_UINT32 reserved2;
  15927. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  15928. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  15929. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  15930. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  15931. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  15932. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  15933. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  15934. do { \
  15935. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  15936. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  15937. } while (0)
  15938. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  15939. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  15940. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  15941. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  15942. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  15943. do { \
  15944. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  15945. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  15946. } while (0)
  15947. /* SOC related stats */
  15948. typedef struct {
  15949. htt_tlv_hdr_t tlv_hdr;
  15950. /* When TQM is not able to find the peers during Tx, then it drops the packets
  15951. * This can be due to either the peer is deleted or deletion is ongoing
  15952. * */
  15953. A_UINT32 inv_peers_msdu_drop_count_lo;
  15954. A_UINT32 inv_peers_msdu_drop_count_hi;
  15955. } htt_t2h_soc_txrx_stats_common_tlv;
  15956. /* VDEV HW Tx/Rx stats */
  15957. typedef struct {
  15958. htt_tlv_hdr_t tlv_hdr;
  15959. A_UINT32 vdev_id;
  15960. /* Rx msdu byte cnt */
  15961. A_UINT32 rx_msdu_byte_cnt_lo;
  15962. A_UINT32 rx_msdu_byte_cnt_hi;
  15963. /* Rx msdu cnt */
  15964. A_UINT32 rx_msdu_cnt_lo;
  15965. A_UINT32 rx_msdu_cnt_hi;
  15966. /* tx msdu byte cnt */
  15967. A_UINT32 tx_msdu_byte_cnt_lo;
  15968. A_UINT32 tx_msdu_byte_cnt_hi;
  15969. /* tx msdu cnt */
  15970. A_UINT32 tx_msdu_cnt_lo;
  15971. A_UINT32 tx_msdu_cnt_hi;
  15972. /* tx excessive retry discarded msdu cnt */
  15973. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  15974. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  15975. /* TX congestion ctrl msdu drop cnt */
  15976. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  15977. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  15978. /* discarded tx msdus cnt coz of time to live expiry */
  15979. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  15980. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  15981. /* tx excessive retry discarded msdu byte cnt */
  15982. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  15983. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  15984. /* TX congestion ctrl msdu drop byte cnt */
  15985. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  15986. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  15987. /* discarded tx msdus byte cnt coz of time to live expiry */
  15988. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  15989. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  15990. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  15991. /*
  15992. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  15993. *
  15994. * @details
  15995. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  15996. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  15997. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  15998. * the default MSDU queues of the peer-TID specified in the
  15999. * SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  16000. * If the default MSDU queues of the specified peer-TID are not linked to
  16001. * a service class, the status field of the SAWF_DEF_QUEUES_MAP_REPORT_CONF
  16002. * will specify that no such mapping exists of the default MSDU queues to a
  16003. * service class.
  16004. *
  16005. * |31 16|15 12|11 8|7 0|
  16006. * |------------------------------+------+-------+--------------|
  16007. * | peer ID | rsvd | TID | msg type |
  16008. * |------------------------------+--------------+--------------|
  16009. * | reserved | svc class ID | status |
  16010. * |------------------------------------------------------------|
  16011. * Header fields:
  16012. * dword0 - b'7:0 - msg_type: This will be set to
  16013. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  16014. * b'11:8 - TID
  16015. * b'31:16 - peer ID
  16016. * dword1 - b'7:0 - status (htt_t2h_sawf_def_queues_map_report_status)
  16017. * b'15:8 - svc class ID (only valid if status == MAPPED)
  16018. */
  16019. enum htt_t2h_sawf_def_queues_map_report_status {
  16020. /* MAPPED:
  16021. * The default MSDU queues for the peer-TID are linked to a service class.
  16022. * The svc_class_id field shows which service class the default MSDU queues
  16023. * are associated with.
  16024. */
  16025. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_STATUS_MAPPED = 0,
  16026. /* UNMAPPED:
  16027. * The default MSDU queues for the peer-TID are not linked to any
  16028. * service class.
  16029. */
  16030. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_STATUS_UNMAPPED = 1,
  16031. /* INVALID_IDS:
  16032. * One or more of pdev_id, vdev_id, peer_id, and TID were invalid.
  16033. */
  16034. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_INVALID_IDS = 2,
  16035. };
  16036. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  16037. A_UINT32 msg_type :8,
  16038. tid :4,
  16039. reserved0 :4,
  16040. peer_id :16;
  16041. A_UINT32 status :8,
  16042. svc_class_id :8,
  16043. reserved1 :16;
  16044. } POSTPACK;
  16045. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_BYTES 8
  16046. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x00000F00
  16047. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 8
  16048. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  16049. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  16050. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  16051. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  16052. do { \
  16053. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  16054. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S));\
  16055. } while (0)
  16056. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  16057. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  16058. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  16059. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  16060. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  16061. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  16062. do { \
  16063. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  16064. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  16065. } while (0)
  16066. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_M 0x000000FF
  16067. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_S 0
  16068. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_GET(_var) \
  16069. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_M) >> \
  16070. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_S)
  16071. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_SET(_var, _val) \
  16072. do { \
  16073. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS, _val); \
  16074. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_S)); \
  16075. } while (0)
  16076. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  16077. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  16078. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  16079. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  16080. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  16081. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  16082. do { \
  16083. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  16084. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  16085. } while (0)
  16086. /*
  16087. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  16088. *
  16089. * @details
  16090. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  16091. * flow if the flow is seen the associated service class is conveyed to the
  16092. * target via TCL Data Command. Target on the other hand internally creates the
  16093. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  16094. * of the newly created MSDUQ and some other identifiers to uniquely identity
  16095. * the newly created MSDUQ
  16096. *
  16097. * |31 27| 24|23 16|15 11|10|9 8|7 4|3 0|
  16098. * |------------------------------+----------------------+--------------|
  16099. * | peer ID | HTT qtype | msg type |
  16100. * |--------+---------------------+---------------+--+---+-------+------|
  16101. * |reserved| Ast Index |FO|WC | HLOS | remap|
  16102. * | | | | | TID | TID |
  16103. * |---------------------+----------------------------------------------|
  16104. * | reserved1 | tgt_opaque_id |
  16105. * |---------------------+----------------------------------------------|
  16106. *
  16107. * Header fields:
  16108. *
  16109. * dword0 - b'7:0 - msg_type: This will be set to
  16110. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  16111. * b'15:8 - HTT qtype
  16112. * b'31:16 - peer ID
  16113. *
  16114. * dword1 - b'3:0 - remap TID, as assigned in firmware
  16115. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  16116. * hlos_tid : Common to Lithium and Beryllium
  16117. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  16118. * TCL Data Command : Beryllium
  16119. * b10 - flow_override (FO), as sent by host in
  16120. * TCL Data Command: Beryllium
  16121. * b11:26 - ast_index
  16122. * Dummy AST Index in case of Lithium,
  16123. * Default AST Index in case of Beryllium
  16124. * b27:32 - reserved
  16125. *
  16126. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  16127. * unique MSDUQ id in firmware
  16128. * b'24:31 - reserved1
  16129. */
  16130. PREPACK struct htt_t2h_sawf_msduq_event {
  16131. A_UINT32 msg_type : 8,
  16132. htt_qtype : 8,
  16133. peer_id :16;
  16134. A_UINT32 remap_tid : 4,
  16135. hlos_tid : 4,
  16136. who_classify_info_sel : 2,
  16137. flow_override : 1,
  16138. ast_index :16,
  16139. reserved : 5;
  16140. A_UINT32 tgt_opaque_id :24,
  16141. reserved1 : 8;
  16142. } POSTPACK;
  16143. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  16144. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  16145. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  16146. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  16147. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  16148. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  16149. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  16150. do { \
  16151. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  16152. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  16153. } while (0)
  16154. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  16155. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  16156. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  16157. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  16158. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  16159. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  16160. do { \
  16161. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  16162. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  16163. } while (0)
  16164. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  16165. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  16166. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  16167. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  16168. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  16169. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  16170. do { \
  16171. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  16172. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  16173. } while (0)
  16174. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  16175. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  16176. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  16177. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  16178. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  16179. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  16180. do { \
  16181. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  16182. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  16183. } while (0)
  16184. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  16185. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  16186. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  16187. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  16188. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  16189. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  16190. do { \
  16191. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  16192. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  16193. } while (0)
  16194. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  16195. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  16196. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  16197. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  16198. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  16199. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  16200. do { \
  16201. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  16202. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  16203. } while (0)
  16204. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_M 0x07FFF800
  16205. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_S 11
  16206. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_GET(_var) \
  16207. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_M) >> \
  16208. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_S)
  16209. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_SET(_var, _val) \
  16210. do { \
  16211. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX, _val); \
  16212. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_S)); \
  16213. } while (0)
  16214. #endif