htt.h 926 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  6. *
  7. *
  8. * Permission to use, copy, modify, and/or distribute this software for
  9. * any purpose with or without fee is hereby granted, provided that the
  10. * above copyright notice and this permission notice appear in all
  11. * copies.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  14. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  15. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  16. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  17. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  18. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  19. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20. * PERFORMANCE OF THIS SOFTWARE.
  21. */
  22. /*
  23. * This file was originally distributed by Qualcomm Atheros, Inc.
  24. * under proprietary terms before Copyright ownership was assigned
  25. * to the Linux Foundation.
  26. */
  27. /**
  28. * @file htt.h
  29. *
  30. * @details the public header file of HTT layer
  31. */
  32. #ifndef _HTT_H_
  33. #define _HTT_H_
  34. #include <htt_deps.h>
  35. #include <htt_common.h>
  36. /*
  37. * Unless explicitly specified to use 64 bits to represent physical addresses
  38. * (or more precisely, bus addresses), default to 32 bits.
  39. */
  40. #ifndef HTT_PADDR64
  41. #define HTT_PADDR64 0
  42. #endif
  43. #ifndef offsetof
  44. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  45. #endif
  46. /*
  47. * HTT version history:
  48. * 1.0 initial numbered version
  49. * 1.1 modifications to STATS messages.
  50. * These modifications are not backwards compatible, but since the
  51. * STATS messages themselves are non-essential (they are for debugging),
  52. * the 1.1 version of the HTT message library as a whole is compatible
  53. * with the 1.0 version.
  54. * 1.2 reset mask IE added to STATS_REQ message
  55. * 1.3 stat config IE added to STATS_REQ message
  56. *----
  57. * 2.0 FW rx PPDU desc added to RX_IND message
  58. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  59. *----
  60. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  61. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  62. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  63. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  64. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  65. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  66. * 3.5 Added flush and fail stats in rx_reorder stats structure
  67. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  68. * 3.7 Made changes to support EOS Mac_core 3.0
  69. * 3.8 Added txq_group information element definition;
  70. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  71. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  72. * Allow buffer addresses in bus-address format to be stored as
  73. * either 32 bits or 64 bits.
  74. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  75. * messages to specify which HTT options to use.
  76. * Initial TLV options cover:
  77. * - whether to use 32 or 64 bits to represent LL bus addresses
  78. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  79. * - how many tx queue groups to use
  80. * 3.11 Expand rx debug stats:
  81. * - Expand the rx_reorder_stats struct with stats about successful and
  82. * failed rx buffer allcoations.
  83. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  84. * the supply, allocation, use, and recycling of rx buffers for the
  85. * "remote ring" of rx buffers in host member in LL systems.
  86. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  87. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  88. * 3.13 Add constants + macros to support 64-bit address format for the
  89. * tx fragments descriptor, the rx ring buffer, and the rx ring
  90. * index shadow register.
  91. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  92. * - Add htt_tx_msdu_desc_ext_t struct def.
  93. * - Add TLV to specify whether the target supports the HTT tx MSDU
  94. * extension descriptor.
  95. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  96. * "extension" bit, to specify whether a HTT tx MSDU extension
  97. * descriptor is present.
  98. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  99. * (This allows the host to obtain key information about the MSDU
  100. * from a memory location already in the cache, rather than taking a
  101. * cache miss for each MSDU by reading the HW rx descs.)
  102. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  103. * whether a copy-engine classification result is appended to TX_FRM.
  104. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  105. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  106. * tx frames in the target after the peer has already been deleted.
  107. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  108. * 3.20 Expand rx_reorder_stats.
  109. * 3.21 Add optional rx channel spec to HL RX_IND.
  110. * 3.22 Expand rx_reorder_stats
  111. * (distinguish duplicates within vs. outside block ack window)
  112. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  113. * The justified rate is calculated by two steps. The first is to multiply
  114. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  115. * by a low pass filter.
  116. * This change allows HL download scheduling to consider the WLAN rate
  117. * that will be used for transmitting the downloaded frames.
  118. * 3.24 Expand rx_reorder_stats
  119. * (add counter for decrypt / MIC errors)
  120. * 3.25 Expand rx_reorder_stats
  121. * (add counter of frames received into both local + remote rings)
  122. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  123. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  124. * 3.27 Add a new interface for flow-control. The following t2h messages have
  125. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  126. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  127. * 3.28 Add a new interface for ring interface change. The following two h2t
  128. * and one t2h messages have been included:
  129. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  130. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  131. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  132. * information elements passed from the host to a Lithium target,
  133. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  134. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  135. * targets).
  136. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  137. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  138. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  139. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  140. * sharing stats
  141. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  142. * 3.34 Add HW_PEER_ID field to PEER_MAP
  143. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  144. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  145. * not yet in use)
  146. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  147. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  148. * 3.38 Add holes_no_filled field to rx_reorder_stats
  149. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  150. * 3.40 Add optional timestamps in the HTT tx completion
  151. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  152. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  153. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  154. * 3.44 Add htt_tx_wbm_completion_v2
  155. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  156. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  157. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  158. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  159. * HTT_T2H_MSG_TYPE_PKTLOG
  160. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  161. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  162. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  163. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  165. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  166. * 3.55 Add initiator / responder flags to RX_DELBA indication
  167. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  168. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  169. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  170. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  171. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  172. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  173. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  174. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  175. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  176. * array to the end of HTT_T2H TX_COMPL_IND msg
  177. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  178. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  179. * for a MSDU.
  180. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  181. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  182. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  183. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  184. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  185. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  186. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  187. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  188. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  189. * htt_tx_data_hdr_information
  190. * 3.73 Add channel pre-calibration data upload and download messages defs for
  191. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  192. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  193. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  194. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  195. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  196. * 3.78 Add htt_ppdu_id def.
  197. * 3.79 Add HTT_NUM_AC_WMM def.
  198. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  199. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  200. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  201. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  202. * 3.84 Add fisa_control_bits_v2 def.
  203. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  204. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  205. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  206. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  207. * 3.89 Add MSDU queue enumerations.
  208. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  209. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  210. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  211. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  212. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  213. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  214. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  215. * 3.96 Modify HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  216. * 3.97 Add tx MSDU drop byte count fields in vdev_txrx_stats_hw_stats TLV.
  217. * 3.98 Add htt_tx_tcl_metadata_v2 def.
  218. * 3.99 Add HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ, _UNMAP_REQ, _MAP_REPORT_REQ and
  219. * HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF defs.
  220. * 3.100 Add htt_tx_wbm_completion_v3 def.
  221. * 3.101 Add HTT_UL_OFDMA_USER_INFO_V1_BITMAP defs.
  222. * 3.102 Add HTT_H2T_MSG_TYPE_MSI_SETUP def.
  223. * 3.103 Add HTT_T2H_SAWF_MSDUQ_INFO_IND defs.
  224. * 3.104 Add mgmt/ctrl/data specs in rx ring cfg.
  225. * 3.105 Add HTT_H2T STREAMING_STATS_REQ + HTT_T2H STREAMING_STATS_IND defs.
  226. * 3.106 Add HTT_T2H_PPDU_ID_FMT_IND def.
  227. * 3.107 Add traffic_end_indication bitfield in htt_tx_msdu_desc_ext2_t.
  228. * 3.108 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP def.
  229. * 3.109 Add HTT_T2H RX_ADDBA_EXTN,RX_DELBA_EXTN defs.
  230. * 3.110 Add more word_mask fields in htt_tx_monitor_cfg_t.
  231. * 3.111 Add RXPCU filter enable flag in RX_RING_SELECTION_CFG msg.
  232. * 3.112 Add logical_link_id field in rx_peer_metadata_v1.
  233. * 3.113 Add add rx msdu,mpdu,ppdu fields in rx_ring_selection_cfg_t
  234. * 3.114 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET def.
  235. * 3.115 Add HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP and
  236. * HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE msg defs.
  237. * 3.116 Add HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE flag.
  238. * 3.117 Add HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND def.
  239. */
  240. #define HTT_CURRENT_VERSION_MAJOR 3
  241. #define HTT_CURRENT_VERSION_MINOR 117
  242. #define HTT_NUM_TX_FRAG_DESC 1024
  243. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  244. #define HTT_CHECK_SET_VAL(field, val) \
  245. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  246. /* macros to assist in sign-extending fields from HTT messages */
  247. #define HTT_SIGN_BIT_MASK(field) \
  248. ((field ## _M + (1 << field ## _S)) >> 1)
  249. #define HTT_SIGN_BIT(_val, field) \
  250. (_val & HTT_SIGN_BIT_MASK(field))
  251. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  252. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  253. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  254. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  255. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  256. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  257. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  258. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  259. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  260. /*
  261. * TEMPORARY:
  262. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  263. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  264. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  265. * updated.
  266. */
  267. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  268. /*
  269. * TEMPORARY:
  270. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  271. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  272. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  273. * updated.
  274. */
  275. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  276. /**
  277. * htt_dbg_stats_type -
  278. * bit positions for each stats type within a stats type bitmask
  279. * The bitmask contains 24 bits.
  280. */
  281. enum htt_dbg_stats_type {
  282. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  283. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  284. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  285. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  286. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  287. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  288. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  289. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  290. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  291. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  292. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  293. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  294. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  295. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  296. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  297. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  298. /* bits 16-23 currently reserved */
  299. /* keep this last */
  300. HTT_DBG_NUM_STATS
  301. };
  302. /*=== HTT option selection TLVs ===
  303. * Certain HTT messages have alternatives or options.
  304. * For such cases, the host and target need to agree on which option to use.
  305. * Option specification TLVs can be appended to the VERSION_REQ and
  306. * VERSION_CONF messages to select options other than the default.
  307. * These TLVs are entirely optional - if they are not provided, there is a
  308. * well-defined default for each option. If they are provided, they can be
  309. * provided in any order. Each TLV can be present or absent independent of
  310. * the presence / absence of other TLVs.
  311. *
  312. * The HTT option selection TLVs use the following format:
  313. * |31 16|15 8|7 0|
  314. * |---------------------------------+----------------+----------------|
  315. * | value (payload) | length | tag |
  316. * |-------------------------------------------------------------------|
  317. * The value portion need not be only 2 bytes; it can be extended by any
  318. * integer number of 4-byte units. The total length of the TLV, including
  319. * the tag and length fields, must be a multiple of 4 bytes. The length
  320. * field specifies the total TLV size in 4-byte units. Thus, the typical
  321. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  322. * field, would store 0x1 in its length field, to show that the TLV occupies
  323. * a single 4-byte unit.
  324. */
  325. /*--- TLV header format - applies to all HTT option TLVs ---*/
  326. enum HTT_OPTION_TLV_TAGS {
  327. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  328. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  329. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  330. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  331. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  332. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  333. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  334. };
  335. #define HTT_TCL_METADATA_VER_SZ 4
  336. PREPACK struct htt_option_tlv_header_t {
  337. A_UINT8 tag;
  338. A_UINT8 length;
  339. } POSTPACK;
  340. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  341. #define HTT_OPTION_TLV_TAG_S 0
  342. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  343. #define HTT_OPTION_TLV_LENGTH_S 8
  344. /*
  345. * value0 - 16 bit value field stored in word0
  346. * The TLV's value field may be longer than 2 bytes, in which case
  347. * the remainder of the value is stored in word1, word2, etc.
  348. */
  349. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  350. #define HTT_OPTION_TLV_VALUE0_S 16
  351. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  352. do { \
  353. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  354. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  355. } while (0)
  356. #define HTT_OPTION_TLV_TAG_GET(word) \
  357. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  358. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  359. do { \
  360. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  361. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  362. } while (0)
  363. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  364. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  365. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  366. do { \
  367. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  368. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  369. } while (0)
  370. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  371. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  372. /*--- format of specific HTT option TLVs ---*/
  373. /*
  374. * HTT option TLV for specifying LL bus address size
  375. * Some chips require bus addresses used by the target to access buffers
  376. * within the host's memory to be 32 bits; others require bus addresses
  377. * used by the target to access buffers within the host's memory to be
  378. * 64 bits.
  379. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  380. * a suffix to the VERSION_CONF message to specify which bus address format
  381. * the target requires.
  382. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  383. * default to providing bus addresses to the target in 32-bit format.
  384. */
  385. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  386. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  387. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  388. };
  389. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  390. struct htt_option_tlv_header_t hdr;
  391. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  392. } POSTPACK;
  393. /*
  394. * HTT option TLV for specifying whether HL systems should indicate
  395. * over-the-air tx completion for individual frames, or should instead
  396. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  397. * requests an OTA tx completion for a particular tx frame.
  398. * This option does not apply to LL systems, where the TX_COMPL_IND
  399. * is mandatory.
  400. * This option is primarily intended for HL systems in which the tx frame
  401. * downloads over the host --> target bus are as slow as or slower than
  402. * the transmissions over the WLAN PHY. For cases where the bus is faster
  403. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  404. * and consequently will send one TX_COMPL_IND message that covers several
  405. * tx frames. For cases where the WLAN PHY is faster than the bus,
  406. * the target will end up transmitting very short A-MPDUs, and consequently
  407. * sending many TX_COMPL_IND messages, which each cover a very small number
  408. * of tx frames.
  409. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  410. * a suffix to the VERSION_REQ message to request whether the host desires to
  411. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  412. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  413. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  414. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  415. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  416. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  417. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  418. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  419. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  420. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  421. * TLV.
  422. */
  423. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  424. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  425. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  426. };
  427. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  428. struct htt_option_tlv_header_t hdr;
  429. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  430. } POSTPACK;
  431. /*
  432. * HTT option TLV for specifying how many tx queue groups the target
  433. * may establish.
  434. * This TLV specifies the maximum value the target may send in the
  435. * txq_group_id field of any TXQ_GROUP information elements sent by
  436. * the target to the host. This allows the host to pre-allocate an
  437. * appropriate number of tx queue group structs.
  438. *
  439. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  440. * a suffix to the VERSION_REQ message to specify whether the host supports
  441. * tx queue groups at all, and if so if there is any limit on the number of
  442. * tx queue groups that the host supports.
  443. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  444. * a suffix to the VERSION_CONF message. If the host has specified in the
  445. * VER_REQ message a limit on the number of tx queue groups the host can
  446. * support, the target shall limit its specification of the maximum tx groups
  447. * to be no larger than this host-specified limit.
  448. *
  449. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  450. * shall preallocate 4 tx queue group structs, and the target shall not
  451. * specify a txq_group_id larger than 3.
  452. */
  453. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  454. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  455. /*
  456. * values 1 through N specify the max number of tx queue groups
  457. * the sender supports
  458. */
  459. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  460. };
  461. /* TEMPORARY backwards-compatibility alias for a typo fix -
  462. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  463. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  464. * to support the old name (with the typo) until all references to the
  465. * old name are replaced with the new name.
  466. */
  467. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  468. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  469. struct htt_option_tlv_header_t hdr;
  470. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  471. } POSTPACK;
  472. /*
  473. * HTT option TLV for specifying whether the target supports an extended
  474. * version of the HTT tx descriptor. If the target provides this TLV
  475. * and specifies in the TLV that the target supports an extended version
  476. * of the HTT tx descriptor, the target must check the "extension" bit in
  477. * the HTT tx descriptor, and if the extension bit is set, to expect a
  478. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  479. * descriptor. Furthermore, the target must provide room for the HTT
  480. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  481. * This option is intended for systems where the host needs to explicitly
  482. * control the transmission parameters such as tx power for individual
  483. * tx frames.
  484. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  485. * as a suffix to the VERSION_CONF message to explicitly specify whether
  486. * the target supports the HTT tx MSDU extension descriptor.
  487. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  488. * by the host as lack of target support for the HTT tx MSDU extension
  489. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  490. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  491. * the HTT tx MSDU extension descriptor.
  492. * The host is not required to provide the HTT tx MSDU extension descriptor
  493. * just because the target supports it; the target must check the
  494. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  495. * extension descriptor is present.
  496. */
  497. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  498. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  499. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  500. };
  501. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  502. struct htt_option_tlv_header_t hdr;
  503. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  504. } POSTPACK;
  505. /*
  506. * For the tcl data command V2 and higher support added a new
  507. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  508. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  509. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  510. * HTT option TLV for specifying which version of the TCL metadata struct
  511. * should be used:
  512. * V1 -> use htt_tx_tcl_metadata struct
  513. * V2 -> use htt_tx_tcl_metadata_v2 struct
  514. * Old FW will only support V1.
  515. * New FW will support V2. New FW will still support V1, at least during
  516. * a transition period.
  517. * Similarly, old host will only support V1, and new host will support V1 + V2.
  518. *
  519. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  520. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  521. * of TCL metadata the host supports. If the host doesn't provide a
  522. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  523. * is implicitly understood that the host only supports V1.
  524. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  525. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  526. * the host shall use. The target shall only select one of the versions
  527. * supported by the host. If the target doesn't provide a
  528. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  529. * is implicitly understood that the V1 TCL metadata shall be used.
  530. */
  531. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  532. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  533. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  534. };
  535. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  536. struct htt_option_tlv_header_t hdr;
  537. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  538. } POSTPACK;
  539. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  540. HTT_OPTION_TLV_VALUE0_SET(word, value)
  541. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  542. HTT_OPTION_TLV_VALUE0_GET(word)
  543. typedef struct {
  544. union {
  545. /* BIT [11 : 0] :- tag
  546. * BIT [23 : 12] :- length
  547. * BIT [31 : 24] :- reserved
  548. */
  549. A_UINT32 tag__length;
  550. /*
  551. * The following struct is not endian-portable.
  552. * It is suitable for use within the target, which is known to be
  553. * little-endian.
  554. * The host should use the above endian-portable macros to access
  555. * the tag and length bitfields in an endian-neutral manner.
  556. */
  557. struct {
  558. A_UINT32 tag : 12, /* BIT [11 : 0] */
  559. length : 12, /* BIT [23 : 12] */
  560. reserved : 8; /* BIT [31 : 24] */
  561. };
  562. };
  563. } htt_tlv_hdr_t;
  564. /** HTT stats TLV tag values */
  565. typedef enum {
  566. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  567. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  568. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  569. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  570. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  571. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  572. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  573. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  574. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  575. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  576. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  577. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  578. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  579. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  580. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  581. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  582. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  583. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  584. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  585. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  586. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  587. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  588. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  589. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  590. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  591. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  592. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  593. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  594. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  595. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  596. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  597. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  598. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  599. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  600. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  601. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  602. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  603. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  604. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  605. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  606. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  607. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  608. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  609. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  610. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  611. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  612. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  613. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  614. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  615. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  616. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  617. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  618. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  619. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  620. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  621. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  622. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  623. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  624. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  625. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  626. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  627. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  628. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  629. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  630. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  631. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  632. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  633. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  634. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  635. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  636. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  637. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  638. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  639. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  640. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  641. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  642. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  643. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  644. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  645. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  646. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  647. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  648. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  649. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  650. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  651. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  652. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  653. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  654. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  655. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  656. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  657. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  658. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  659. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  660. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  661. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  662. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  663. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  664. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  665. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  666. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  667. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  668. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  669. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  670. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  671. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  672. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  673. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  674. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  675. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  676. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  677. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  678. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  679. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv - DEPRECATED */
  680. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv - DEPRECATED */
  681. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv - DEPRECATED */
  682. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv - DEPRECATED */
  683. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  684. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  685. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  686. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  687. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  688. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  689. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  690. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  691. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  692. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  693. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  694. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  695. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  696. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  697. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  698. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  699. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  700. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  701. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  702. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  703. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  704. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  705. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  706. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  707. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  708. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  709. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  710. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  711. HTT_STATS_STRM_GEN_MPDUS_TAG = 145, /* htt_stats_strm_gen_mpdus_tlv_t */
  712. HTT_STATS_STRM_GEN_MPDUS_DETAILS_TAG = 146, /* htt_stats_strm_gen_mpdus_details_tlv_t */
  713. HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG = 147, /* htt_txbf_ofdma_ax_ndpa_stats_tlv */
  714. HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG = 148, /* htt_txbf_ofdma_ax_ndp_stats_tlv */
  715. HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG = 149, /* htt_txbf_ofdma_ax_brp_stats_tlv */
  716. HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG = 150, /* htt_txbf_ofdma_ax_steer_stats_tlv */
  717. HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG = 151, /* htt_txbf_ofdma_be_ndpa_stats_tlv */
  718. HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG = 152, /* htt_txbf_ofdma_be_ndp_stats_tlv */
  719. HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG = 153, /* htt_txbf_ofdma_be_brp_stats_tlv */
  720. HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG = 154, /* htt_txbf_ofdma_be_steer_stats_tlv */
  721. HTT_STATS_DMAC_RESET_STATS_TAG = 155, /* htt_dmac_reset_stats_tlv */
  722. HTT_STATS_RX_PDEV_BE_UL_OFDMA_USER_STATS_TAG = 156, /* htt_rx_pdev_be_ul_ofdma_user_stats_tlv */
  723. HTT_STATS_PHY_TPC_STATS_TAG = 157, /* htt_phy_tpc_stats_tlv */
  724. HTT_STATS_PDEV_PUNCTURE_STATS_TAG = 158, /* htt_pdev_puncture_stats_tlv */
  725. HTT_STATS_ML_PEER_DETAILS_TAG = 159, /* htt_ml_peer_details_tlv */
  726. HTT_STATS_ML_PEER_EXT_DETAILS_TAG = 160, /* htt_ml_peer_ext_details_tlv */
  727. HTT_STATS_ML_LINK_INFO_DETAILS_TAG = 161, /* htt_ml_link_info_tlv */
  728. HTT_STATS_TX_PDEV_PPDU_DUR_TAG = 162, /* htt_tx_pdev_ppdu_dur_stats_tlv */
  729. HTT_STATS_RX_PDEV_PPDU_DUR_TAG = 163, /* htt_rx_pdev_ppdu_dur_stats_tlv */
  730. HTT_STATS_ODD_PDEV_MANDATORY_TAG = 164, /* htt_odd_mandatory_pdev_stats_tlv */
  731. HTT_STATS_PDEV_SCHED_ALGO_OFDMA_STATS_TAG = 165, /* htt_pdev_sched_algo_ofdma_stats_tlv */
  732. HTT_DBG_ODD_MANDATORY_MUMIMO_TAG = 166, /* htt_odd_mandatory_mumimo_pdev_stats_tlv */
  733. HTT_DBG_ODD_MANDATORY_MUOFDMA_TAG = 167, /* htt_odd_mandatory_muofdma_pdev_stats_tlv */
  734. HTT_STATS_LATENCY_PROF_CAL_STATS_TAG = 168, /* htt_latency_prof_cal_stats_tlv */
  735. HTT_STATS_TX_PDEV_MUEDCA_PARAMS_STATS_TAG = 169, /* htt_tx_pdev_muedca_params_stats_tlv_v - DEPRECATED */
  736. HTT_STATS_PDEV_BW_MGR_STATS_TAG = 170, /* htt_pdev_bw_mgr_stats_tlv */
  737. HTT_STATS_TX_PDEV_AP_EDCA_PARAMS_STATS_TAG = 171, /* htt_tx_pdev_ap_edca_params_stats_tlv_v */
  738. HTT_STATS_TXBF_OFDMA_AX_STEER_MPDU_STATS_TAG = 172, /* htt_txbf_ofdma_ax_steer_mpdu_stats_tlv */
  739. HTT_STATS_TXBF_OFDMA_BE_STEER_MPDU_STATS_TAG = 173, /* htt_txbf_ofdma_be_steer_mpdu_stats_tlv */
  740. HTT_STATS_PEER_AX_OFDMA_STATS_TAG = 174, /* htt_peer_ax_ofdma_stats_tlv */
  741. HTT_STATS_TX_PDEV_MU_EDCA_PARAMS_STATS_TAG = 175, /* htt_tx_pdev_mu_edca_params_stats_tlv_v */
  742. HTT_STATS_PDEV_MBSSID_CTRL_FRAME_STATS_TAG = 176, /* htt_pdev_mbssid_ctrl_frame_stats_tlv */
  743. HTT_STATS_TX_PDEV_MLO_ABORT_TAG = 177, /* htt_tx_pdev_stats_mlo_abort_tlv_v */
  744. HTT_STATS_TX_PDEV_MLO_TXOP_ABORT_TAG = 178, /* htt_tx_pdev_stats_mlo_txop_abort_tlv_v */
  745. HTT_STATS_MAX_TAG,
  746. } htt_stats_tlv_tag_t;
  747. /* retain deprecated enum name as an alias for the current enum name */
  748. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  749. #define HTT_STATS_TLV_TAG_M 0x00000fff
  750. #define HTT_STATS_TLV_TAG_S 0
  751. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  752. #define HTT_STATS_TLV_LENGTH_S 12
  753. #define HTT_STATS_TLV_TAG_GET(_var) \
  754. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  755. HTT_STATS_TLV_TAG_S)
  756. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  757. do { \
  758. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  759. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  760. } while (0)
  761. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  762. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  763. HTT_STATS_TLV_LENGTH_S)
  764. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  765. do { \
  766. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  767. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  768. } while (0)
  769. /*=== host -> target messages ===============================================*/
  770. enum htt_h2t_msg_type {
  771. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  772. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  773. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  774. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  775. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  776. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  777. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  778. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  779. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  780. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  781. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  782. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  783. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  784. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  785. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  786. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  787. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  788. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  789. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  790. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  791. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  792. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  793. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  794. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  795. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  796. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  797. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  798. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  799. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  800. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  801. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  802. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  803. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  804. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP = 0x21,
  805. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET = 0x22,
  806. HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP = 0x23,
  807. /* keep this last */
  808. HTT_H2T_NUM_MSGS
  809. };
  810. /*
  811. * HTT host to target message type -
  812. * stored in bits 7:0 of the first word of the message
  813. */
  814. #define HTT_H2T_MSG_TYPE_M 0xff
  815. #define HTT_H2T_MSG_TYPE_S 0
  816. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  817. do { \
  818. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  819. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  820. } while (0)
  821. #define HTT_H2T_MSG_TYPE_GET(word) \
  822. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  823. /**
  824. * @brief host -> target version number request message definition
  825. *
  826. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  827. *
  828. *
  829. * |31 24|23 16|15 8|7 0|
  830. * |----------------+----------------+----------------+----------------|
  831. * | reserved | msg type |
  832. * |-------------------------------------------------------------------|
  833. * : option request TLV (optional) |
  834. * :...................................................................:
  835. *
  836. * The VER_REQ message may consist of a single 4-byte word, or may be
  837. * extended with TLVs that specify which HTT options the host is requesting
  838. * from the target.
  839. * The following option TLVs may be appended to the VER_REQ message:
  840. * - HL_SUPPRESS_TX_COMPL_IND
  841. * - HL_MAX_TX_QUEUE_GROUPS
  842. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  843. * may be appended to the VER_REQ message (but only one TLV of each type).
  844. *
  845. * Header fields:
  846. * - MSG_TYPE
  847. * Bits 7:0
  848. * Purpose: identifies this as a version number request message
  849. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  850. */
  851. #define HTT_VER_REQ_BYTES 4
  852. /* TBDXXX: figure out a reasonable number */
  853. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  854. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  855. /**
  856. * @brief HTT tx MSDU descriptor
  857. *
  858. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  859. *
  860. * @details
  861. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  862. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  863. * the target firmware needs for the FW's tx processing, particularly
  864. * for creating the HW msdu descriptor.
  865. * The same HTT tx descriptor is used for HL and LL systems, though
  866. * a few fields within the tx descriptor are used only by LL or
  867. * only by HL.
  868. * The HTT tx descriptor is defined in two manners: by a struct with
  869. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  870. * definitions.
  871. * The target should use the struct def, for simplicitly and clarity,
  872. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  873. * neutral. Specifically, the host shall use the get/set macros built
  874. * around the mask + shift defs.
  875. */
  876. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  877. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  878. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  879. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  880. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  881. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  882. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  883. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  884. #define HTT_TX_VDEV_ID_WORD 0
  885. #define HTT_TX_VDEV_ID_MASK 0x3f
  886. #define HTT_TX_VDEV_ID_SHIFT 16
  887. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  888. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  889. #define HTT_TX_MSDU_LEN_DWORD 1
  890. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  891. /*
  892. * HTT_VAR_PADDR macros
  893. * Allow physical / bus addresses to be either a single 32-bit value,
  894. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  895. */
  896. #define HTT_VAR_PADDR32(var_name) \
  897. A_UINT32 var_name
  898. #define HTT_VAR_PADDR64_LE(var_name) \
  899. struct { \
  900. /* little-endian: lo precedes hi */ \
  901. A_UINT32 lo; \
  902. A_UINT32 hi; \
  903. } var_name
  904. /*
  905. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  906. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  907. * addresses are stored in a XXX-bit field.
  908. * This macro is used to define both htt_tx_msdu_desc32_t and
  909. * htt_tx_msdu_desc64_t structs.
  910. */
  911. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  912. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  913. { \
  914. /* DWORD 0: flags and meta-data */ \
  915. A_UINT32 \
  916. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  917. \
  918. /* pkt_subtype - \
  919. * Detailed specification of the tx frame contents, extending the \
  920. * general specification provided by pkt_type. \
  921. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  922. * pkt_type | pkt_subtype \
  923. * ============================================================== \
  924. * 802.3 | bit 0:3 - Reserved \
  925. * | bit 4: 0x0 - Copy-Engine Classification Results \
  926. * | not appended to the HTT message \
  927. * | 0x1 - Copy-Engine Classification Results \
  928. * | appended to the HTT message in the \
  929. * | format: \
  930. * | [HTT tx desc, frame header, \
  931. * | CE classification results] \
  932. * | The CE classification results begin \
  933. * | at the next 4-byte boundary after \
  934. * | the frame header. \
  935. * ------------+------------------------------------------------- \
  936. * Eth2 | bit 0:3 - Reserved \
  937. * | bit 4: 0x0 - Copy-Engine Classification Results \
  938. * | not appended to the HTT message \
  939. * | 0x1 - Copy-Engine Classification Results \
  940. * | appended to the HTT message. \
  941. * | See the above specification of the \
  942. * | CE classification results location. \
  943. * ------------+------------------------------------------------- \
  944. * native WiFi | bit 0:3 - Reserved \
  945. * | bit 4: 0x0 - Copy-Engine Classification Results \
  946. * | not appended to the HTT message \
  947. * | 0x1 - Copy-Engine Classification Results \
  948. * | appended to the HTT message. \
  949. * | See the above specification of the \
  950. * | CE classification results location. \
  951. * ------------+------------------------------------------------- \
  952. * mgmt | 0x0 - 802.11 MAC header absent \
  953. * | 0x1 - 802.11 MAC header present \
  954. * ------------+------------------------------------------------- \
  955. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  956. * | 0x1 - 802.11 MAC header present \
  957. * | bit 1: 0x0 - allow aggregation \
  958. * | 0x1 - don't allow aggregation \
  959. * | bit 2: 0x0 - perform encryption \
  960. * | 0x1 - don't perform encryption \
  961. * | bit 3: 0x0 - perform tx classification / queuing \
  962. * | 0x1 - don't perform tx classification; \
  963. * | insert the frame into the "misc" \
  964. * | tx queue \
  965. * | bit 4: 0x0 - Copy-Engine Classification Results \
  966. * | not appended to the HTT message \
  967. * | 0x1 - Copy-Engine Classification Results \
  968. * | appended to the HTT message. \
  969. * | See the above specification of the \
  970. * | CE classification results location. \
  971. */ \
  972. pkt_subtype: 5, \
  973. \
  974. /* pkt_type - \
  975. * General specification of the tx frame contents. \
  976. * The htt_pkt_type enum should be used to specify and check the \
  977. * value of this field. \
  978. */ \
  979. pkt_type: 3, \
  980. \
  981. /* vdev_id - \
  982. * ID for the vdev that is sending this tx frame. \
  983. * For certain non-standard packet types, e.g. pkt_type == raw \
  984. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  985. * This field is used primarily for determining where to queue \
  986. * broadcast and multicast frames. \
  987. */ \
  988. vdev_id: 6, \
  989. /* ext_tid - \
  990. * The extended traffic ID. \
  991. * If the TID is unknown, the extended TID is set to \
  992. * HTT_TX_EXT_TID_INVALID. \
  993. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  994. * value of the QoS TID. \
  995. * If the tx frame is non-QoS data, then the extended TID is set to \
  996. * HTT_TX_EXT_TID_NON_QOS. \
  997. * If the tx frame is multicast or broadcast, then the extended TID \
  998. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  999. */ \
  1000. ext_tid: 5, \
  1001. \
  1002. /* postponed - \
  1003. * This flag indicates whether the tx frame has been downloaded to \
  1004. * the target before but discarded by the target, and now is being \
  1005. * downloaded again; or if this is a new frame that is being \
  1006. * downloaded for the first time. \
  1007. * This flag allows the target to determine the correct order for \
  1008. * transmitting new vs. old frames. \
  1009. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  1010. * This flag only applies to HL systems, since in LL systems, \
  1011. * the tx flow control is handled entirely within the target. \
  1012. */ \
  1013. postponed: 1, \
  1014. \
  1015. /* extension - \
  1016. * This flag indicates whether a HTT tx MSDU extension descriptor \
  1017. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  1018. * \
  1019. * 0x0 - no extension MSDU descriptor is present \
  1020. * 0x1 - an extension MSDU descriptor immediately follows the \
  1021. * regular MSDU descriptor \
  1022. */ \
  1023. extension: 1, \
  1024. \
  1025. /* cksum_offload - \
  1026. * This flag indicates whether checksum offload is enabled or not \
  1027. * for this frame. Target FW use this flag to turn on HW checksumming \
  1028. * 0x0 - No checksum offload \
  1029. * 0x1 - L3 header checksum only \
  1030. * 0x2 - L4 checksum only \
  1031. * 0x3 - L3 header checksum + L4 checksum \
  1032. */ \
  1033. cksum_offload: 2, \
  1034. \
  1035. /* tx_comp_req - \
  1036. * This flag indicates whether Tx Completion \
  1037. * from fw is required or not. \
  1038. * This flag is only relevant if tx completion is not \
  1039. * universally enabled. \
  1040. * For all LL systems, tx completion is mandatory, \
  1041. * so this flag will be irrelevant. \
  1042. * For HL systems tx completion is optional, but HL systems in which \
  1043. * the bus throughput exceeds the WLAN throughput will \
  1044. * probably want to always use tx completion, and thus \
  1045. * would not check this flag. \
  1046. * This flag is required when tx completions are not used universally, \
  1047. * but are still required for certain tx frames for which \
  1048. * an OTA delivery acknowledgment is needed by the host. \
  1049. * In practice, this would be for HL systems in which the \
  1050. * bus throughput is less than the WLAN throughput. \
  1051. * \
  1052. * 0x0 - Tx Completion Indication from Fw not required \
  1053. * 0x1 - Tx Completion Indication from Fw is required \
  1054. */ \
  1055. tx_compl_req: 1; \
  1056. \
  1057. \
  1058. /* DWORD 1: MSDU length and ID */ \
  1059. A_UINT32 \
  1060. len: 16, /* MSDU length, in bytes */ \
  1061. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1062. * and this id is used to calculate fragmentation \
  1063. * descriptor pointer inside the target based on \
  1064. * the base address, configured inside the target. \
  1065. */ \
  1066. \
  1067. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1068. /* frags_desc_ptr - \
  1069. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1070. * where the tx frame's fragments reside in memory. \
  1071. * This field only applies to LL systems, since in HL systems the \
  1072. * (degenerate single-fragment) fragmentation descriptor is created \
  1073. * within the target. \
  1074. */ \
  1075. _paddr__frags_desc_ptr_; \
  1076. \
  1077. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1078. /* \
  1079. * Peer ID : Target can use this value to know which peer-id packet \
  1080. * destined to. \
  1081. * It's intended to be specified by host in case of NAWDS. \
  1082. */ \
  1083. A_UINT16 peerid; \
  1084. \
  1085. /* \
  1086. * Channel frequency: This identifies the desired channel \
  1087. * frequency (in mhz) for tx frames. This is used by FW to help \
  1088. * determine when it is safe to transmit or drop frames for \
  1089. * off-channel operation. \
  1090. * The default value of zero indicates to FW that the corresponding \
  1091. * VDEV's home channel (if there is one) is the desired channel \
  1092. * frequency. \
  1093. */ \
  1094. A_UINT16 chanfreq; \
  1095. \
  1096. /* Reason reserved is commented is increasing the htt structure size \
  1097. * leads to some weird issues. \
  1098. * A_UINT32 reserved_dword3_bits0_31; \
  1099. */ \
  1100. } POSTPACK
  1101. /* define a htt_tx_msdu_desc32_t type */
  1102. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1103. /* define a htt_tx_msdu_desc64_t type */
  1104. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1105. /*
  1106. * Make htt_tx_msdu_desc_t be an alias for either
  1107. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1108. */
  1109. #if HTT_PADDR64
  1110. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1111. #else
  1112. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1113. #endif
  1114. /* decriptor information for Management frame*/
  1115. /*
  1116. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1117. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1118. */
  1119. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1120. extern A_UINT32 mgmt_hdr_len;
  1121. PREPACK struct htt_mgmt_tx_desc_t {
  1122. A_UINT32 msg_type;
  1123. #if HTT_PADDR64
  1124. A_UINT64 frag_paddr; /* DMAble address of the data */
  1125. #else
  1126. A_UINT32 frag_paddr; /* DMAble address of the data */
  1127. #endif
  1128. A_UINT32 desc_id; /* returned to host during completion
  1129. * to free the meory*/
  1130. A_UINT32 len; /* Fragment length */
  1131. A_UINT32 vdev_id; /* virtual device ID*/
  1132. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1133. } POSTPACK;
  1134. PREPACK struct htt_mgmt_tx_compl_ind {
  1135. A_UINT32 desc_id;
  1136. A_UINT32 status;
  1137. } POSTPACK;
  1138. /*
  1139. * This SDU header size comes from the summation of the following:
  1140. * 1. Max of:
  1141. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1142. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1143. * b. 802.11 header, for raw frames: 36 bytes
  1144. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1145. * QoS header, HT header)
  1146. * c. 802.3 header, for ethernet frames: 14 bytes
  1147. * (destination address, source address, ethertype / length)
  1148. * 2. Max of:
  1149. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1150. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1151. * 3. 802.1Q VLAN header: 4 bytes
  1152. * 4. LLC/SNAP header: 8 bytes
  1153. */
  1154. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1155. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1156. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1157. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1158. A_COMPILE_TIME_ASSERT(
  1159. htt_encap_hdr_size_max_check_nwifi,
  1160. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1161. A_COMPILE_TIME_ASSERT(
  1162. htt_encap_hdr_size_max_check_enet,
  1163. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1164. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1165. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1166. #define HTT_TX_HDR_SIZE_802_1Q 4
  1167. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1168. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1169. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1170. HTT_TX_HDR_SIZE_802_1Q + \
  1171. HTT_TX_HDR_SIZE_LLC_SNAP)
  1172. #define HTT_HL_TX_FRM_HDR_LEN \
  1173. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1174. #define HTT_LL_TX_FRM_HDR_LEN \
  1175. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1176. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1177. /* dword 0 */
  1178. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1179. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1180. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1181. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1182. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1183. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1184. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1185. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1186. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1187. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1188. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1189. #define HTT_TX_DESC_PKT_TYPE_S 13
  1190. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1191. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1192. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1193. #define HTT_TX_DESC_VDEV_ID_S 16
  1194. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1195. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1196. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1197. #define HTT_TX_DESC_EXT_TID_S 22
  1198. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1199. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1200. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1201. #define HTT_TX_DESC_POSTPONED_S 27
  1202. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1203. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1204. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1205. #define HTT_TX_DESC_EXTENSION_S 28
  1206. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1207. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1208. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1209. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1210. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1211. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1212. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1213. #define HTT_TX_DESC_TX_COMP_S 31
  1214. /* dword 1 */
  1215. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1216. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1217. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1218. #define HTT_TX_DESC_FRM_LEN_S 0
  1219. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1220. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1221. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1222. #define HTT_TX_DESC_FRM_ID_S 16
  1223. /* dword 2 */
  1224. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1225. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1226. /* for systems using 64-bit format for bus addresses */
  1227. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1228. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1229. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1230. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1231. /* for systems using 32-bit format for bus addresses */
  1232. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1233. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1234. /* dword 3 */
  1235. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1236. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1237. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1238. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1239. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1240. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1241. #if HTT_PADDR64
  1242. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1243. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1244. #else
  1245. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1246. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1247. #endif
  1248. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1249. #define HTT_TX_DESC_PEER_ID_S 0
  1250. /*
  1251. * TEMPORARY:
  1252. * The original definitions for the PEER_ID fields contained typos
  1253. * (with _DESC_PADDR appended to this PEER_ID field name).
  1254. * Retain deprecated original names for PEER_ID fields until all code that
  1255. * refers to them has been updated.
  1256. */
  1257. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1258. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1259. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1260. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1261. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1262. HTT_TX_DESC_PEER_ID_M
  1263. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1264. HTT_TX_DESC_PEER_ID_S
  1265. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1266. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1267. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1268. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1269. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1270. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1271. #if HTT_PADDR64
  1272. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1273. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1274. #else
  1275. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1276. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1277. #endif
  1278. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1279. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1280. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1281. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1282. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1283. do { \
  1284. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1285. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1286. } while (0)
  1287. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1288. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1289. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1290. do { \
  1291. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1292. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1293. } while (0)
  1294. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1295. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1296. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1297. do { \
  1298. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1299. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1300. } while (0)
  1301. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1302. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1303. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1304. do { \
  1305. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1306. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1307. } while (0)
  1308. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1309. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1310. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1311. do { \
  1312. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1313. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1314. } while (0)
  1315. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1316. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1317. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1318. do { \
  1319. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1320. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1321. } while (0)
  1322. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1323. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1324. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1325. do { \
  1326. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1327. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1328. } while (0)
  1329. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1330. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1331. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1332. do { \
  1333. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1334. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1335. } while (0)
  1336. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1337. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1338. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1339. do { \
  1340. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1341. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1342. } while (0)
  1343. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1344. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1345. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1346. do { \
  1347. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1348. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1349. } while (0)
  1350. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1351. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1352. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1353. do { \
  1354. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1355. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1356. } while (0)
  1357. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1358. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1359. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1360. do { \
  1361. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1362. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1363. } while (0)
  1364. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1365. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1366. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1367. do { \
  1368. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1369. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1370. } while (0)
  1371. /* enums used in the HTT tx MSDU extension descriptor */
  1372. enum {
  1373. htt_tx_guard_interval_regular = 0,
  1374. htt_tx_guard_interval_short = 1,
  1375. };
  1376. enum {
  1377. htt_tx_preamble_type_ofdm = 0,
  1378. htt_tx_preamble_type_cck = 1,
  1379. htt_tx_preamble_type_ht = 2,
  1380. htt_tx_preamble_type_vht = 3,
  1381. };
  1382. enum {
  1383. htt_tx_bandwidth_5MHz = 0,
  1384. htt_tx_bandwidth_10MHz = 1,
  1385. htt_tx_bandwidth_20MHz = 2,
  1386. htt_tx_bandwidth_40MHz = 3,
  1387. htt_tx_bandwidth_80MHz = 4,
  1388. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1389. };
  1390. /**
  1391. * @brief HTT tx MSDU extension descriptor
  1392. * @details
  1393. * If the target supports HTT tx MSDU extension descriptors, the host has
  1394. * the option of appending the following struct following the regular
  1395. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1396. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1397. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1398. * tx specs for each frame.
  1399. */
  1400. PREPACK struct htt_tx_msdu_desc_ext_t {
  1401. /* DWORD 0: flags */
  1402. A_UINT32
  1403. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1404. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1405. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1406. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1407. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1408. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1409. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1410. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1411. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1412. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1413. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1414. /* DWORD 1: tx power, tx rate, tx BW */
  1415. A_UINT32
  1416. /* pwr -
  1417. * Specify what power the tx frame needs to be transmitted at.
  1418. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1419. * The value needs to be appropriately sign-extended when extracting
  1420. * the value from the message and storing it in a variable that is
  1421. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1422. * automatically handles this sign-extension.)
  1423. * If the transmission uses multiple tx chains, this power spec is
  1424. * the total transmit power, assuming incoherent combination of
  1425. * per-chain power to produce the total power.
  1426. */
  1427. pwr: 8,
  1428. /* mcs_mask -
  1429. * Specify the allowable values for MCS index (modulation and coding)
  1430. * to use for transmitting the frame.
  1431. *
  1432. * For HT / VHT preamble types, this mask directly corresponds to
  1433. * the HT or VHT MCS indices that are allowed. For each bit N set
  1434. * within the mask, MCS index N is allowed for transmitting the frame.
  1435. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1436. * rates versus OFDM rates, so the host has the option of specifying
  1437. * that the target must transmit the frame with CCK or OFDM rates
  1438. * (not HT or VHT), but leaving the decision to the target whether
  1439. * to use CCK or OFDM.
  1440. *
  1441. * For CCK and OFDM, the bits within this mask are interpreted as
  1442. * follows:
  1443. * bit 0 -> CCK 1 Mbps rate is allowed
  1444. * bit 1 -> CCK 2 Mbps rate is allowed
  1445. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1446. * bit 3 -> CCK 11 Mbps rate is allowed
  1447. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1448. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1449. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1450. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1451. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1452. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1453. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1454. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1455. *
  1456. * The MCS index specification needs to be compatible with the
  1457. * bandwidth mask specification. For example, a MCS index == 9
  1458. * specification is inconsistent with a preamble type == VHT,
  1459. * Nss == 1, and channel bandwidth == 20 MHz.
  1460. *
  1461. * Furthermore, the host has only a limited ability to specify to
  1462. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1463. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1464. */
  1465. mcs_mask: 12,
  1466. /* nss_mask -
  1467. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1468. * Each bit in this mask corresponds to a Nss value:
  1469. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1470. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1471. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1472. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1473. * The values in the Nss mask must be suitable for the recipient, e.g.
  1474. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1475. * recipient which only supports 2x2 MIMO.
  1476. */
  1477. nss_mask: 4,
  1478. /* guard_interval -
  1479. * Specify a htt_tx_guard_interval enum value to indicate whether
  1480. * the transmission should use a regular guard interval or a
  1481. * short guard interval.
  1482. */
  1483. guard_interval: 1,
  1484. /* preamble_type_mask -
  1485. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1486. * may choose from for transmitting this frame.
  1487. * The bits in this mask correspond to the values in the
  1488. * htt_tx_preamble_type enum. For example, to allow the target
  1489. * to transmit the frame as either CCK or OFDM, this field would
  1490. * be set to
  1491. * (1 << htt_tx_preamble_type_ofdm) |
  1492. * (1 << htt_tx_preamble_type_cck)
  1493. */
  1494. preamble_type_mask: 4,
  1495. reserved1_31_29: 3; /* unused, set to 0x0 */
  1496. /* DWORD 2: tx chain mask, tx retries */
  1497. A_UINT32
  1498. /* chain_mask - specify which chains to transmit from */
  1499. chain_mask: 4,
  1500. /* retry_limit -
  1501. * Specify the maximum number of transmissions, including the
  1502. * initial transmission, to attempt before giving up if no ack
  1503. * is received.
  1504. * If the tx rate is specified, then all retries shall use the
  1505. * same rate as the initial transmission.
  1506. * If no tx rate is specified, the target can choose whether to
  1507. * retain the original rate during the retransmissions, or to
  1508. * fall back to a more robust rate.
  1509. */
  1510. retry_limit: 4,
  1511. /* bandwidth_mask -
  1512. * Specify what channel widths may be used for the transmission.
  1513. * A value of zero indicates "don't care" - the target may choose
  1514. * the transmission bandwidth.
  1515. * The bits within this mask correspond to the htt_tx_bandwidth
  1516. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1517. * The bandwidth_mask must be consistent with the preamble_type_mask
  1518. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1519. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1520. */
  1521. bandwidth_mask: 6,
  1522. reserved2_31_14: 18; /* unused, set to 0x0 */
  1523. /* DWORD 3: tx expiry time (TSF) LSBs */
  1524. A_UINT32 expire_tsf_lo;
  1525. /* DWORD 4: tx expiry time (TSF) MSBs */
  1526. A_UINT32 expire_tsf_hi;
  1527. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1528. } POSTPACK;
  1529. /* DWORD 0 */
  1530. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1531. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1532. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1533. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1534. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1535. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1536. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1537. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1538. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1539. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1540. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1541. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1542. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1543. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1544. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1545. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1546. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1547. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1548. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1549. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1550. /* DWORD 1 */
  1551. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1552. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1553. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1554. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1555. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1556. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1557. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1558. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1559. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1560. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1561. /* DWORD 2 */
  1562. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1563. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1564. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1565. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1566. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1567. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1568. /* DWORD 0 */
  1569. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1570. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1571. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1572. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1573. do { \
  1574. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1575. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1576. } while (0)
  1577. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1578. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1579. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1580. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1581. do { \
  1582. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1583. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1584. } while (0)
  1585. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1586. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1587. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1588. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1589. do { \
  1590. HTT_CHECK_SET_VAL( \
  1591. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1592. ((_var) |= ((_val) \
  1593. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1594. } while (0)
  1595. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1596. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1597. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1598. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1599. do { \
  1600. HTT_CHECK_SET_VAL( \
  1601. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1602. ((_var) |= ((_val) \
  1603. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1604. } while (0)
  1605. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1606. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1607. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1608. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1609. do { \
  1610. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1611. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1612. } while (0)
  1613. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1614. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1615. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1616. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1617. do { \
  1618. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1619. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1620. } while (0)
  1621. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1622. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1623. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1624. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1625. do { \
  1626. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1627. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1628. } while (0)
  1629. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1630. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1631. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1632. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1633. do { \
  1634. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1635. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1636. } while (0)
  1637. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1638. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1639. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1640. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1641. do { \
  1642. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1643. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1644. } while (0)
  1645. /* DWORD 1 */
  1646. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1647. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1648. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1649. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1650. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1651. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1652. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1653. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1654. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1655. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1656. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1657. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1658. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1659. do { \
  1660. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1661. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1662. } while (0)
  1663. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1664. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1665. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1666. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1667. do { \
  1668. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1669. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1670. } while (0)
  1671. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1672. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1673. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1674. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1675. do { \
  1676. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1677. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1678. } while (0)
  1679. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1680. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1681. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1682. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1683. do { \
  1684. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1685. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1686. } while (0)
  1687. /* DWORD 2 */
  1688. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1689. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1690. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1691. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1692. do { \
  1693. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1694. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1695. } while (0)
  1696. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1697. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1698. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1699. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1700. do { \
  1701. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1702. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1703. } while (0)
  1704. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1705. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1706. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1707. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1708. do { \
  1709. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1710. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1711. } while (0)
  1712. typedef enum {
  1713. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1714. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1715. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1716. } htt_11ax_ltf_subtype_t;
  1717. typedef enum {
  1718. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1719. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1720. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1721. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1722. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1723. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1724. } htt_tx_ext2_preamble_type_t;
  1725. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1726. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1727. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1728. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1729. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1730. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1731. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1732. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1733. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1734. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1735. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1736. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1737. /**
  1738. * @brief HTT tx MSDU extension descriptor v2
  1739. * @details
  1740. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1741. * is received as tcl_exit_base->host_meta_info in firmware.
  1742. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1743. * are already part of tcl_exit_base.
  1744. */
  1745. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1746. /* DWORD 0: flags */
  1747. A_UINT32
  1748. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1749. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1750. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1751. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1752. valid_retries : 1, /* if set, tx retries spec is valid */
  1753. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1754. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1755. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1756. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1757. valid_key_flags : 1, /* if set, key flags is valid */
  1758. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1759. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1760. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1761. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1762. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1763. 1 = ENCRYPT,
  1764. 2 ~ 3 - Reserved */
  1765. /* retry_limit -
  1766. * Specify the maximum number of transmissions, including the
  1767. * initial transmission, to attempt before giving up if no ack
  1768. * is received.
  1769. * If the tx rate is specified, then all retries shall use the
  1770. * same rate as the initial transmission.
  1771. * If no tx rate is specified, the target can choose whether to
  1772. * retain the original rate during the retransmissions, or to
  1773. * fall back to a more robust rate.
  1774. */
  1775. retry_limit : 4,
  1776. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1777. * Valid only for 11ax preamble types HE_SU
  1778. * and HE_EXT_SU
  1779. */
  1780. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1781. * Valid only for 11ax preamble types HE_SU
  1782. * and HE_EXT_SU
  1783. */
  1784. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1785. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1786. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1787. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1788. */
  1789. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1790. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1791. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1792. * Use cases:
  1793. * Any time firmware uses TQM-BYPASS for Data
  1794. * TID, firmware expect host to set this bit.
  1795. */
  1796. /* DWORD 1: tx power, tx rate */
  1797. A_UINT32
  1798. power : 8, /* unit of the power field is 0.5 dbm
  1799. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1800. * signed value ranging from -64dbm to 63.5 dbm
  1801. */
  1802. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1803. * Setting more than one MCS isn't currently
  1804. * supported by the target (but is supported
  1805. * in the interface in case in the future
  1806. * the target supports specifications of
  1807. * a limited set of MCS values.
  1808. */
  1809. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1810. * Setting more than one Nss isn't currently
  1811. * supported by the target (but is supported
  1812. * in the interface in case in the future
  1813. * the target supports specifications of
  1814. * a limited set of Nss values.
  1815. */
  1816. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1817. update_peer_cache : 1; /* When set these custom values will be
  1818. * used for all packets, until the next
  1819. * update via this ext header.
  1820. * This is to make sure not all packets
  1821. * need to include this header.
  1822. */
  1823. /* DWORD 2: tx chain mask, tx retries */
  1824. A_UINT32
  1825. /* chain_mask - specify which chains to transmit from */
  1826. chain_mask : 8,
  1827. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1828. * TODO: Update Enum values for key_flags
  1829. */
  1830. /*
  1831. * Channel frequency: This identifies the desired channel
  1832. * frequency (in MHz) for tx frames. This is used by FW to help
  1833. * determine when it is safe to transmit or drop frames for
  1834. * off-channel operation.
  1835. * The default value of zero indicates to FW that the corresponding
  1836. * VDEV's home channel (if there is one) is the desired channel
  1837. * frequency.
  1838. */
  1839. chanfreq : 16;
  1840. /* DWORD 3: tx expiry time (TSF) LSBs */
  1841. A_UINT32 expire_tsf_lo;
  1842. /* DWORD 4: tx expiry time (TSF) MSBs */
  1843. A_UINT32 expire_tsf_hi;
  1844. /* DWORD 5: flags to control routing / processing of the MSDU */
  1845. A_UINT32
  1846. /* learning_frame
  1847. * When this flag is set, this frame will be dropped by FW
  1848. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1849. */
  1850. learning_frame : 1,
  1851. /* send_as_standalone
  1852. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1853. * i.e. with no A-MSDU or A-MPDU aggregation.
  1854. * The scope is extended to other use-cases.
  1855. */
  1856. send_as_standalone : 1,
  1857. /* is_host_opaque_valid
  1858. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1859. * with valid information.
  1860. */
  1861. is_host_opaque_valid : 1,
  1862. traffic_end_indication: 1,
  1863. rsvd0 : 28;
  1864. /* DWORD 6 : Host opaque cookie for special frames */
  1865. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1866. rsvd1 : 16;
  1867. /*
  1868. * This structure can be expanded further up to 40 bytes
  1869. * by adding further DWORDs as needed.
  1870. */
  1871. } POSTPACK;
  1872. /* DWORD 0 */
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1880. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1881. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1882. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1883. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1884. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1885. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1886. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1887. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1888. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1889. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1890. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1891. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1892. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1893. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1894. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1895. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1896. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1897. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1898. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1899. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1900. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1901. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1902. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1903. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1904. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1905. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1906. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1907. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1908. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1909. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1910. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1911. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1912. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1913. /* DWORD 1 */
  1914. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1915. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1916. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1917. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1918. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1919. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1920. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1921. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1922. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1923. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1924. /* DWORD 2 */
  1925. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1926. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1927. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1928. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1929. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1930. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1931. /* DWORD 5 */
  1932. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1933. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1934. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1935. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1936. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1937. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1938. /* DWORD 6 */
  1939. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1940. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1941. /* DWORD 0 */
  1942. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1943. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1944. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1945. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1946. do { \
  1947. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1948. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1949. } while (0)
  1950. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1951. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1952. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1953. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1954. do { \
  1955. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1956. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1957. } while (0)
  1958. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1959. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1960. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1961. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1962. do { \
  1963. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1964. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1965. } while (0)
  1966. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1967. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1968. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1969. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1970. do { \
  1971. HTT_CHECK_SET_VAL( \
  1972. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1973. ((_var) |= ((_val) \
  1974. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1975. } while (0)
  1976. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1977. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1978. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1979. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1980. do { \
  1981. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1982. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1983. } while (0)
  1984. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1985. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1986. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1987. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1988. do { \
  1989. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1990. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1991. } while (0)
  1992. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1993. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1994. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1995. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1996. do { \
  1997. HTT_CHECK_SET_VAL( \
  1998. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1999. ((_var) |= ((_val) \
  2000. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  2001. } while (0)
  2002. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  2003. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  2004. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  2005. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  2006. do { \
  2007. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  2008. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  2009. } while (0)
  2010. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  2011. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  2012. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  2013. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  2014. do { \
  2015. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  2016. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  2017. } while (0)
  2018. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  2019. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  2020. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  2021. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  2022. do { \
  2023. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  2024. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  2025. } while (0)
  2026. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  2027. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  2028. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  2029. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  2030. do { \
  2031. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  2032. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  2033. } while (0)
  2034. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2035. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2036. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2037. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2038. do { \
  2039. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2040. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2041. } while (0)
  2042. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2043. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2044. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2045. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2046. do { \
  2047. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2048. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2049. } while (0)
  2050. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2051. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2052. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2053. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2054. do { \
  2055. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2056. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2057. } while (0)
  2058. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2059. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2060. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2061. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2062. do { \
  2063. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2064. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2065. } while (0)
  2066. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2067. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2068. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2069. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2070. do { \
  2071. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2072. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2073. } while (0)
  2074. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2075. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2076. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2077. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2078. do { \
  2079. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2080. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2081. } while (0)
  2082. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2083. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2084. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2085. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2086. do { \
  2087. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2088. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2089. } while (0)
  2090. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2091. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2092. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2093. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2094. do { \
  2095. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2096. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2097. } while (0)
  2098. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2099. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2100. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2101. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2102. do { \
  2103. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2104. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2105. } while (0)
  2106. /* DWORD 1 */
  2107. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2108. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2109. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2110. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2111. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2112. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2113. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2114. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2115. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2116. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2117. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2118. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2119. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2120. do { \
  2121. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2122. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2123. } while (0)
  2124. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2125. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2126. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2127. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2128. do { \
  2129. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2130. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2131. } while (0)
  2132. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2133. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2134. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2135. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2136. do { \
  2137. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2138. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2139. } while (0)
  2140. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2141. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2142. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2143. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2144. do { \
  2145. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2146. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2147. } while (0)
  2148. /* DWORD 2 */
  2149. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2150. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2151. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2152. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2153. do { \
  2154. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2155. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2156. } while (0)
  2157. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2158. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2159. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2160. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2161. do { \
  2162. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2163. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2164. } while (0)
  2165. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2166. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2167. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2168. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2169. do { \
  2170. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2171. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2172. } while (0)
  2173. /* DWORD 5 */
  2174. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2175. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2176. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2177. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2178. do { \
  2179. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2180. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2181. } while (0)
  2182. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2183. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2184. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2185. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2186. do { \
  2187. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2188. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2189. } while (0)
  2190. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2191. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2192. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2193. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2194. do { \
  2195. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2196. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2197. } while (0)
  2198. /* DWORD 6 */
  2199. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2200. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2201. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2202. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2203. do { \
  2204. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2205. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2206. } while (0)
  2207. typedef enum {
  2208. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2209. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2210. } htt_tcl_metadata_type;
  2211. /**
  2212. * @brief HTT TCL command number format
  2213. * @details
  2214. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2215. * available to firmware as tcl_exit_base->tcl_status_number.
  2216. * For regular / multicast packets host will send vdev and mac id and for
  2217. * NAWDS packets, host will send peer id.
  2218. * A_UINT32 is used to avoid endianness conversion problems.
  2219. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2220. */
  2221. typedef struct {
  2222. A_UINT32
  2223. type: 1, /* vdev_id based or peer_id based */
  2224. rsvd: 31;
  2225. } htt_tx_tcl_vdev_or_peer_t;
  2226. typedef struct {
  2227. A_UINT32
  2228. type: 1, /* vdev_id based or peer_id based */
  2229. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2230. vdev_id: 8,
  2231. pdev_id: 2,
  2232. host_inspected:1,
  2233. rsvd: 19;
  2234. } htt_tx_tcl_vdev_metadata;
  2235. typedef struct {
  2236. A_UINT32
  2237. type: 1, /* vdev_id based or peer_id based */
  2238. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2239. peer_id: 14,
  2240. rsvd: 16;
  2241. } htt_tx_tcl_peer_metadata;
  2242. PREPACK struct htt_tx_tcl_metadata {
  2243. union {
  2244. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2245. htt_tx_tcl_vdev_metadata vdev_meta;
  2246. htt_tx_tcl_peer_metadata peer_meta;
  2247. };
  2248. } POSTPACK;
  2249. /* DWORD 0 */
  2250. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2251. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2252. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2253. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2254. /* VDEV metadata */
  2255. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2256. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2257. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2258. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2259. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2260. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2261. /* PEER metadata */
  2262. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2263. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2264. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2265. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2266. HTT_TX_TCL_METADATA_TYPE_S)
  2267. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2268. do { \
  2269. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2270. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2271. } while (0)
  2272. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2273. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2274. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2275. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2276. do { \
  2277. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2278. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2279. } while (0)
  2280. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2281. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2282. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2283. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2284. do { \
  2285. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2286. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2287. } while (0)
  2288. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2289. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2290. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2291. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2292. do { \
  2293. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2294. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2295. } while (0)
  2296. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2297. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2298. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2299. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2300. do { \
  2301. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2302. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2303. } while (0)
  2304. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2305. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2306. HTT_TX_TCL_METADATA_PEER_ID_S)
  2307. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2308. do { \
  2309. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2310. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2311. } while (0)
  2312. /*------------------------------------------------------------------
  2313. * V2 Version of TCL Data Command
  2314. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2315. * MLO global_seq all flavours of TCL Data Cmd.
  2316. *-----------------------------------------------------------------*/
  2317. typedef enum {
  2318. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2319. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2320. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2321. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2322. } htt_tcl_metadata_type_v2;
  2323. /**
  2324. * @brief HTT TCL command number format
  2325. * @details
  2326. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2327. * available to firmware as tcl_exit_base->tcl_status_number.
  2328. * A_UINT32 is used to avoid endianness conversion problems.
  2329. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2330. */
  2331. typedef struct {
  2332. A_UINT32
  2333. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2334. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2335. vdev_id: 8,
  2336. pdev_id: 2,
  2337. host_inspected:1,
  2338. rsvd: 2,
  2339. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2340. } htt_tx_tcl_vdev_metadata_v2;
  2341. typedef struct {
  2342. A_UINT32
  2343. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2344. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2345. peer_id: 13,
  2346. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2347. } htt_tx_tcl_peer_metadata_v2;
  2348. typedef struct {
  2349. A_UINT32
  2350. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2351. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2352. svc_class_id: 8,
  2353. rsvd: 5,
  2354. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2355. } htt_tx_tcl_svc_class_id_metadata;
  2356. typedef struct {
  2357. A_UINT32
  2358. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2359. host_inspected: 1,
  2360. global_seq_no: 12,
  2361. rsvd: 1,
  2362. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2363. } htt_tx_tcl_global_seq_metadata;
  2364. PREPACK struct htt_tx_tcl_metadata_v2 {
  2365. union {
  2366. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2367. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2368. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2369. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2370. };
  2371. } POSTPACK;
  2372. /* DWORD 0 */
  2373. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2374. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2375. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2376. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2377. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2378. /* VDEV V2 metadata */
  2379. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2380. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2381. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2382. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2383. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2384. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2385. /* PEER V2 metadata */
  2386. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2387. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2388. /* SVC_CLASS_ID metadata */
  2389. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2390. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2391. /* Global Seq no metadata */
  2392. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2393. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2394. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2395. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2396. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2397. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2398. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2399. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2400. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2401. do { \
  2402. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2403. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2404. } while (0)
  2405. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2406. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2407. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2408. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2409. do { \
  2410. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2411. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2412. } while (0)
  2413. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2414. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2415. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2416. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2417. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2418. do { \
  2419. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2420. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2421. } while (0)
  2422. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2423. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2424. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2425. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2426. do { \
  2427. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2428. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2429. } while (0)
  2430. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2431. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2432. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2433. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2434. do { \
  2435. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2436. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2437. } while (0)
  2438. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2439. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2440. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2441. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2442. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2443. do { \
  2444. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2445. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2446. } while (0)
  2447. /*----- Get and Set V2 type field in Service Class fields ----*/
  2448. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2449. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2450. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2451. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2452. do { \
  2453. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2454. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2455. } while (0)
  2456. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2457. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2458. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2459. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2460. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2461. do { \
  2462. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2463. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2464. } while (0)
  2465. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2466. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2467. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2468. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2469. do { \
  2470. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2471. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2472. } while (0)
  2473. /*------------------------------------------------------------------
  2474. * End V2 Version of TCL Data Command
  2475. *-----------------------------------------------------------------*/
  2476. typedef enum {
  2477. HTT_TX_FW2WBM_TX_STATUS_OK,
  2478. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2479. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2480. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2481. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2482. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2483. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2484. HTT_TX_FW2WBM_TX_STATUS_MAX
  2485. } htt_tx_fw2wbm_tx_status_t;
  2486. typedef enum {
  2487. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2488. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2489. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2490. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2491. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2492. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2493. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2494. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2495. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2496. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2497. } htt_tx_fw2wbm_reinject_reason_t;
  2498. /**
  2499. * @brief HTT TX WBM Completion from firmware to host
  2500. * @details
  2501. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2502. * DWORD 3 and 4 for software based completions (Exception frames and
  2503. * TQM bypass frames)
  2504. * For software based completions, wbm_release_ring->release_source_module will
  2505. * be set to release_source_fw
  2506. */
  2507. PREPACK struct htt_tx_wbm_completion {
  2508. A_UINT32
  2509. sch_cmd_id: 24,
  2510. exception_frame: 1, /* If set, this packet was queued via exception path */
  2511. rsvd0_31_25: 7;
  2512. A_UINT32
  2513. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2514. * reception of an ACK or BA, this field indicates
  2515. * the RSSI of the received ACK or BA frame.
  2516. * When the frame is removed as result of a direct
  2517. * remove command from the SW, this field is set
  2518. * to 0x0 (which is never a valid value when real
  2519. * RSSI is available).
  2520. * Units: dB w.r.t noise floor
  2521. */
  2522. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2523. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2524. rsvd1_31_16: 16;
  2525. } POSTPACK;
  2526. /* DWORD 0 */
  2527. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2528. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2529. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2530. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2531. /* DWORD 1 */
  2532. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2533. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2534. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2535. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2536. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2537. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2538. /* DWORD 0 */
  2539. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2540. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2541. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2542. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2543. do { \
  2544. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2545. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2546. } while (0)
  2547. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2548. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2549. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2550. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2551. do { \
  2552. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2553. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2554. } while (0)
  2555. /* DWORD 1 */
  2556. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2557. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2558. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2559. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2560. do { \
  2561. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2562. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2563. } while (0)
  2564. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2565. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2566. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2567. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2568. do { \
  2569. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2570. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2571. } while (0)
  2572. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2573. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2574. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2575. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2576. do { \
  2577. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2578. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2579. } while (0)
  2580. /**
  2581. * @brief HTT TX WBM Completion from firmware to host
  2582. * @details
  2583. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2584. * (WBM) offload HW.
  2585. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2586. * For software based completions, release_source_module will
  2587. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2588. * struct wbm_release_ring and then switch to this after looking at
  2589. * release_source_module.
  2590. */
  2591. PREPACK struct htt_tx_wbm_completion_v2 {
  2592. A_UINT32
  2593. used_by_hw0; /* Refer to struct wbm_release_ring */
  2594. A_UINT32
  2595. used_by_hw1; /* Refer to struct wbm_release_ring */
  2596. A_UINT32
  2597. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2598. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2599. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2600. exception_frame: 1,
  2601. rsvd0: 12, /* For future use */
  2602. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2603. rsvd1: 1; /* For future use */
  2604. A_UINT32
  2605. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2606. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2607. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2608. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2609. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2610. */
  2611. A_UINT32
  2612. data1: 32;
  2613. A_UINT32
  2614. data2: 32;
  2615. A_UINT32
  2616. used_by_hw3; /* Refer to struct wbm_release_ring */
  2617. } POSTPACK;
  2618. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2619. /* DWORD 3 */
  2620. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2621. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2622. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2623. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2624. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2625. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2626. /* DWORD 3 */
  2627. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2628. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2629. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2630. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2631. do { \
  2632. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2633. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2634. } while (0)
  2635. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2636. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2637. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2638. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2639. do { \
  2640. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2641. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2642. } while (0)
  2643. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2644. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2645. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2646. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2647. do { \
  2648. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2649. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2650. } while (0)
  2651. /**
  2652. * @brief HTT TX WBM Completion from firmware to host (V3)
  2653. * @details
  2654. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2655. * (WBM) offload HW.
  2656. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2657. * For software based completions, release_source_module will
  2658. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2659. * struct wbm_release_ring and then switch to this after looking at
  2660. * release_source_module.
  2661. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2662. * by new generations of targets.
  2663. */
  2664. PREPACK struct htt_tx_wbm_completion_v3 {
  2665. A_UINT32
  2666. used_by_hw0; /* Refer to struct wbm_release_ring */
  2667. A_UINT32
  2668. used_by_hw1; /* Refer to struct wbm_release_ring */
  2669. A_UINT32
  2670. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2671. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2672. used_by_hw3: 15;
  2673. A_UINT32
  2674. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2675. exception_frame: 1,
  2676. rsvd0: 27; /* For future use */
  2677. A_UINT32
  2678. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2679. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2680. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2681. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2682. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2683. */
  2684. A_UINT32
  2685. data1: 32;
  2686. A_UINT32
  2687. data2: 32;
  2688. A_UINT32
  2689. rsvd1: 20,
  2690. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2691. } POSTPACK;
  2692. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2693. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2694. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2695. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2696. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2697. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2698. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2699. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2700. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2701. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2702. do { \
  2703. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2704. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2705. } while (0)
  2706. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2707. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2708. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2709. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2710. do { \
  2711. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2712. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2713. } while (0)
  2714. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2715. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2716. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2717. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2718. do { \
  2719. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2720. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2721. } while (0)
  2722. typedef enum {
  2723. TX_FRAME_TYPE_UNDEFINED = 0,
  2724. TX_FRAME_TYPE_EAPOL = 1,
  2725. } htt_tx_wbm_status_frame_type;
  2726. /**
  2727. * @brief HTT TX WBM transmit status from firmware to host
  2728. * @details
  2729. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2730. * (WBM) offload HW.
  2731. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2732. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2733. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2734. */
  2735. PREPACK struct htt_tx_wbm_transmit_status {
  2736. A_UINT32
  2737. sch_cmd_id: 24,
  2738. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2739. * reception of an ACK or BA, this field indicates
  2740. * the RSSI of the received ACK or BA frame.
  2741. * When the frame is removed as result of a direct
  2742. * remove command from the SW, this field is set
  2743. * to 0x0 (which is never a valid value when real
  2744. * RSSI is available).
  2745. * Units: dB w.r.t noise floor
  2746. */
  2747. A_UINT32
  2748. sw_peer_id: 16,
  2749. tid_num: 5,
  2750. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2751. * and tid_num fields contain valid data.
  2752. * If this "valid" flag is not set, the
  2753. * sw_peer_id and tid_num fields must be ignored.
  2754. */
  2755. mcast: 1,
  2756. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2757. * contains valid data.
  2758. */
  2759. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2760. reserved: 4;
  2761. A_UINT32
  2762. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2763. * packets in the wbm completion path
  2764. */
  2765. } POSTPACK;
  2766. /* DWORD 4 */
  2767. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2768. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2769. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2770. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2771. /* DWORD 5 */
  2772. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2773. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2774. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2775. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2776. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2777. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2778. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2779. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2780. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2781. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2782. /* DWORD 4 */
  2783. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2784. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2785. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2786. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2787. do { \
  2788. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2789. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2790. } while (0)
  2791. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2792. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2793. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2794. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2795. do { \
  2796. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2797. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2798. } while (0)
  2799. /* DWORD 5 */
  2800. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2801. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2802. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2803. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2804. do { \
  2805. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2806. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2807. } while (0)
  2808. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2809. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2810. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2811. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2812. do { \
  2813. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2814. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2815. } while (0)
  2816. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2817. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2818. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2819. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2820. do { \
  2821. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2822. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2823. } while (0)
  2824. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2825. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2826. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2827. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2828. do { \
  2829. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2830. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2831. } while (0)
  2832. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2833. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2834. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2835. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2836. do { \
  2837. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2838. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2839. } while (0)
  2840. /**
  2841. * @brief HTT TX WBM reinject status from firmware to host
  2842. * @details
  2843. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2844. * (WBM) offload HW.
  2845. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2846. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2847. */
  2848. PREPACK struct htt_tx_wbm_reinject_status {
  2849. A_UINT32
  2850. reserved0: 32;
  2851. A_UINT32
  2852. reserved1: 32;
  2853. A_UINT32
  2854. reserved2: 32;
  2855. } POSTPACK;
  2856. /**
  2857. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2858. * @details
  2859. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2860. * (WBM) offload HW.
  2861. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2862. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2863. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2864. * STA side.
  2865. */
  2866. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2867. A_UINT32
  2868. mec_sa_addr_31_0;
  2869. A_UINT32
  2870. mec_sa_addr_47_32: 16,
  2871. sa_ast_index: 16;
  2872. A_UINT32
  2873. vdev_id: 8,
  2874. reserved0: 24;
  2875. } POSTPACK;
  2876. /* DWORD 4 - mec_sa_addr_31_0 */
  2877. /* DWORD 5 */
  2878. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2879. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2880. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2881. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2882. /* DWORD 6 */
  2883. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2884. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2885. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2886. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2887. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2888. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2889. do { \
  2890. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2891. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2892. } while (0)
  2893. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2894. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2895. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2896. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2897. do { \
  2898. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2899. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2900. } while (0)
  2901. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2902. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2903. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2904. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2905. do { \
  2906. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2907. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2908. } while (0)
  2909. typedef enum {
  2910. TX_FLOW_PRIORITY_BE,
  2911. TX_FLOW_PRIORITY_HIGH,
  2912. TX_FLOW_PRIORITY_LOW,
  2913. } htt_tx_flow_priority_t;
  2914. typedef enum {
  2915. TX_FLOW_LATENCY_SENSITIVE,
  2916. TX_FLOW_LATENCY_INSENSITIVE,
  2917. } htt_tx_flow_latency_t;
  2918. typedef enum {
  2919. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2920. TX_FLOW_INTERACTIVE_TRAFFIC,
  2921. TX_FLOW_PERIODIC_TRAFFIC,
  2922. TX_FLOW_BURSTY_TRAFFIC,
  2923. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2924. } htt_tx_flow_traffic_pattern_t;
  2925. /**
  2926. * @brief HTT TX Flow search metadata format
  2927. * @details
  2928. * Host will set this metadata in flow table's flow search entry along with
  2929. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2930. * firmware and TQM ring if the flow search entry wins.
  2931. * This metadata is available to firmware in that first MSDU's
  2932. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2933. * to one of the available flows for specific tid and returns the tqm flow
  2934. * pointer as part of htt_tx_map_flow_info message.
  2935. */
  2936. PREPACK struct htt_tx_flow_metadata {
  2937. A_UINT32
  2938. rsvd0_1_0: 2,
  2939. tid: 4,
  2940. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2941. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2942. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2943. * Else choose final tid based on latency, priority.
  2944. */
  2945. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2946. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2947. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2948. } POSTPACK;
  2949. /* DWORD 0 */
  2950. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2951. #define HTT_TX_FLOW_METADATA_TID_S 2
  2952. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2953. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2954. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2955. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2956. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2957. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2958. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2959. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2960. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2961. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2962. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2963. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2964. /* DWORD 0 */
  2965. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2966. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2967. HTT_TX_FLOW_METADATA_TID_S)
  2968. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2969. do { \
  2970. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2971. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2972. } while (0)
  2973. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2974. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2975. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2976. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2977. do { \
  2978. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2979. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2980. } while (0)
  2981. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2982. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2983. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2984. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2985. do { \
  2986. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2987. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2988. } while (0)
  2989. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2990. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2991. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2992. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2993. do { \
  2994. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2995. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2996. } while (0)
  2997. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2998. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2999. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  3000. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  3001. do { \
  3002. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  3003. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  3004. } while (0)
  3005. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  3006. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  3007. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  3008. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  3009. do { \
  3010. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  3011. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  3012. } while (0)
  3013. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  3014. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  3015. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  3016. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  3017. do { \
  3018. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  3019. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  3020. } while (0)
  3021. /**
  3022. * @brief host -> target ADD WDS Entry
  3023. *
  3024. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  3025. *
  3026. * @brief host -> target DELETE WDS Entry
  3027. *
  3028. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  3029. *
  3030. * @details
  3031. * HTT wds entry from source port learning
  3032. * Host will learn wds entries from rx and send this message to firmware
  3033. * to enable firmware to configure/delete AST entries for wds clients.
  3034. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3035. * and when SA's entry is deleted, firmware removes this AST entry
  3036. *
  3037. * The message would appear as follows:
  3038. *
  3039. * |31 30|29 |17 16|15 8|7 0|
  3040. * |----------------+----------------+----------------+----------------|
  3041. * | rsvd0 |PDVID| vdev_id | msg_type |
  3042. * |-------------------------------------------------------------------|
  3043. * | sa_addr_31_0 |
  3044. * |-------------------------------------------------------------------|
  3045. * | | ta_peer_id | sa_addr_47_32 |
  3046. * |-------------------------------------------------------------------|
  3047. * Where PDVID = pdev_id
  3048. *
  3049. * The message is interpreted as follows:
  3050. *
  3051. * dword0 - b'0:7 - msg_type: This will be set to
  3052. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3053. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3054. *
  3055. * dword0 - b'8:15 - vdev_id
  3056. *
  3057. * dword0 - b'16:17 - pdev_id
  3058. *
  3059. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3060. *
  3061. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3062. *
  3063. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3064. *
  3065. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3066. */
  3067. PREPACK struct htt_wds_entry {
  3068. A_UINT32
  3069. msg_type: 8,
  3070. vdev_id: 8,
  3071. pdev_id: 2,
  3072. rsvd0: 14;
  3073. A_UINT32 sa_addr_31_0;
  3074. A_UINT32
  3075. sa_addr_47_32: 16,
  3076. ta_peer_id: 14,
  3077. rsvd2: 2;
  3078. } POSTPACK;
  3079. /* DWORD 0 */
  3080. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3081. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3082. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3083. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3084. /* DWORD 2 */
  3085. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3086. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3087. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3088. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3089. /* DWORD 0 */
  3090. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3091. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3092. HTT_WDS_ENTRY_VDEV_ID_S)
  3093. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3094. do { \
  3095. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3096. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3097. } while (0)
  3098. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3099. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3100. HTT_WDS_ENTRY_PDEV_ID_S)
  3101. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3102. do { \
  3103. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3104. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3105. } while (0)
  3106. /* DWORD 2 */
  3107. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3108. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3109. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3110. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3111. do { \
  3112. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3113. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3114. } while (0)
  3115. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3116. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3117. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3118. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3119. do { \
  3120. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3121. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3122. } while (0)
  3123. /**
  3124. * @brief MAC DMA rx ring setup specification
  3125. *
  3126. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3127. *
  3128. * @details
  3129. * To allow for dynamic rx ring reconfiguration and to avoid race
  3130. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3131. * it uses. Instead, it sends this message to the target, indicating how
  3132. * the rx ring used by the host should be set up and maintained.
  3133. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3134. * specifications.
  3135. *
  3136. * |31 16|15 8|7 0|
  3137. * |---------------------------------------------------------------|
  3138. * header: | reserved | num rings | msg type |
  3139. * |---------------------------------------------------------------|
  3140. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3141. #if HTT_PADDR64
  3142. * | FW_IDX shadow register physical address (bits 63:32) |
  3143. #endif
  3144. * |---------------------------------------------------------------|
  3145. * | rx ring base physical address (bits 31:0) |
  3146. #if HTT_PADDR64
  3147. * | rx ring base physical address (bits 63:32) |
  3148. #endif
  3149. * |---------------------------------------------------------------|
  3150. * | rx ring buffer size | rx ring length |
  3151. * |---------------------------------------------------------------|
  3152. * | FW_IDX initial value | enabled flags |
  3153. * |---------------------------------------------------------------|
  3154. * | MSDU payload offset | 802.11 header offset |
  3155. * |---------------------------------------------------------------|
  3156. * | PPDU end offset | PPDU start offset |
  3157. * |---------------------------------------------------------------|
  3158. * | MPDU end offset | MPDU start offset |
  3159. * |---------------------------------------------------------------|
  3160. * | MSDU end offset | MSDU start offset |
  3161. * |---------------------------------------------------------------|
  3162. * | frag info offset | rx attention offset |
  3163. * |---------------------------------------------------------------|
  3164. * payload 2, if present, has the same format as payload 1
  3165. * Header fields:
  3166. * - MSG_TYPE
  3167. * Bits 7:0
  3168. * Purpose: identifies this as an rx ring configuration message
  3169. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3170. * - NUM_RINGS
  3171. * Bits 15:8
  3172. * Purpose: indicates whether the host is setting up one rx ring or two
  3173. * Value: 1 or 2
  3174. * Payload:
  3175. * for systems using 64-bit format for bus addresses:
  3176. * - IDX_SHADOW_REG_PADDR_LO
  3177. * Bits 31:0
  3178. * Value: lower 4 bytes of physical address of the host's
  3179. * FW_IDX shadow register
  3180. * - IDX_SHADOW_REG_PADDR_HI
  3181. * Bits 31:0
  3182. * Value: upper 4 bytes of physical address of the host's
  3183. * FW_IDX shadow register
  3184. * - RING_BASE_PADDR_LO
  3185. * Bits 31:0
  3186. * Value: lower 4 bytes of physical address of the host's rx ring
  3187. * - RING_BASE_PADDR_HI
  3188. * Bits 31:0
  3189. * Value: uppper 4 bytes of physical address of the host's rx ring
  3190. * for systems using 32-bit format for bus addresses:
  3191. * - IDX_SHADOW_REG_PADDR
  3192. * Bits 31:0
  3193. * Value: physical address of the host's FW_IDX shadow register
  3194. * - RING_BASE_PADDR
  3195. * Bits 31:0
  3196. * Value: physical address of the host's rx ring
  3197. * - RING_LEN
  3198. * Bits 15:0
  3199. * Value: number of elements in the rx ring
  3200. * - RING_BUF_SZ
  3201. * Bits 31:16
  3202. * Value: size of the buffers referenced by the rx ring, in byte units
  3203. * - ENABLED_FLAGS
  3204. * Bits 15:0
  3205. * Value: 1-bit flags to show whether different rx fields are enabled
  3206. * bit 0: 802.11 header enabled (1) or disabled (0)
  3207. * bit 1: MSDU payload enabled (1) or disabled (0)
  3208. * bit 2: PPDU start enabled (1) or disabled (0)
  3209. * bit 3: PPDU end enabled (1) or disabled (0)
  3210. * bit 4: MPDU start enabled (1) or disabled (0)
  3211. * bit 5: MPDU end enabled (1) or disabled (0)
  3212. * bit 6: MSDU start enabled (1) or disabled (0)
  3213. * bit 7: MSDU end enabled (1) or disabled (0)
  3214. * bit 8: rx attention enabled (1) or disabled (0)
  3215. * bit 9: frag info enabled (1) or disabled (0)
  3216. * bit 10: unicast rx enabled (1) or disabled (0)
  3217. * bit 11: multicast rx enabled (1) or disabled (0)
  3218. * bit 12: ctrl rx enabled (1) or disabled (0)
  3219. * bit 13: mgmt rx enabled (1) or disabled (0)
  3220. * bit 14: null rx enabled (1) or disabled (0)
  3221. * bit 15: phy data rx enabled (1) or disabled (0)
  3222. * - IDX_INIT_VAL
  3223. * Bits 31:16
  3224. * Purpose: Specify the initial value for the FW_IDX.
  3225. * Value: the number of buffers initially present in the host's rx ring
  3226. * - OFFSET_802_11_HDR
  3227. * Bits 15:0
  3228. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3229. * - OFFSET_MSDU_PAYLOAD
  3230. * Bits 31:16
  3231. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3232. * - OFFSET_PPDU_START
  3233. * Bits 15:0
  3234. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3235. * - OFFSET_PPDU_END
  3236. * Bits 31:16
  3237. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3238. * - OFFSET_MPDU_START
  3239. * Bits 15:0
  3240. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3241. * - OFFSET_MPDU_END
  3242. * Bits 31:16
  3243. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3244. * - OFFSET_MSDU_START
  3245. * Bits 15:0
  3246. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3247. * - OFFSET_MSDU_END
  3248. * Bits 31:16
  3249. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3250. * - OFFSET_RX_ATTN
  3251. * Bits 15:0
  3252. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3253. * - OFFSET_FRAG_INFO
  3254. * Bits 31:16
  3255. * Value: offset in QUAD-bytes of frag info table
  3256. */
  3257. /* header fields */
  3258. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3259. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3260. /* payload fields */
  3261. /* for systems using a 64-bit format for bus addresses */
  3262. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3263. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3264. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3265. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3266. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3267. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3268. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3269. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3270. /* for systems using a 32-bit format for bus addresses */
  3271. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3272. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3273. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3274. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3275. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3276. #define HTT_RX_RING_CFG_LEN_S 0
  3277. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3278. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3279. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3280. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3281. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3282. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3283. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3284. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3285. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3286. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3287. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3288. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3289. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3290. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3291. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3292. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3293. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3294. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3295. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3296. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3297. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3298. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3299. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3300. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3301. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3302. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3303. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3304. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3305. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3306. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3307. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3308. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3309. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3310. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3311. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3312. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3313. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3314. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3315. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3316. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3317. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3318. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3319. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3320. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3321. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3322. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3323. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3324. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3325. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3326. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3327. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3328. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3329. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3330. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3331. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3332. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3333. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3334. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3335. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3336. #if HTT_PADDR64
  3337. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3338. #else
  3339. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3340. #endif
  3341. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3342. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3343. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3344. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3345. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3346. do { \
  3347. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3348. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3349. } while (0)
  3350. /* degenerate case for 32-bit fields */
  3351. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3352. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3353. ((_var) = (_val))
  3354. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3355. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3356. ((_var) = (_val))
  3357. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3358. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3359. ((_var) = (_val))
  3360. /* degenerate case for 32-bit fields */
  3361. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3362. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3363. ((_var) = (_val))
  3364. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3365. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3366. ((_var) = (_val))
  3367. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3368. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3369. ((_var) = (_val))
  3370. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3371. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3372. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3373. do { \
  3374. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3375. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3376. } while (0)
  3377. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3378. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3379. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3380. do { \
  3381. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3382. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3383. } while (0)
  3384. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3385. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3386. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3387. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3388. do { \
  3389. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3390. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3391. } while (0)
  3392. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3393. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3394. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3395. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3396. do { \
  3397. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3398. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3399. } while (0)
  3400. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3401. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3402. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3403. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3404. do { \
  3405. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3406. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3407. } while (0)
  3408. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3409. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3410. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3411. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3412. do { \
  3413. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3414. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3415. } while (0)
  3416. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3417. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3418. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3419. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3420. do { \
  3421. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3422. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3423. } while (0)
  3424. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3425. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3426. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3427. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3428. do { \
  3429. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3430. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3431. } while (0)
  3432. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3433. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3434. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3435. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3436. do { \
  3437. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3438. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3439. } while (0)
  3440. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3441. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3442. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3443. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3444. do { \
  3445. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3446. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3447. } while (0)
  3448. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3449. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3450. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3451. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3452. do { \
  3453. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3454. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3455. } while (0)
  3456. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3457. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3458. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3459. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3460. do { \
  3461. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3462. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3463. } while (0)
  3464. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3465. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3466. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3467. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3468. do { \
  3469. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3470. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3471. } while (0)
  3472. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3473. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3474. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3475. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3476. do { \
  3477. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3478. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3479. } while (0)
  3480. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3481. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3482. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3483. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3484. do { \
  3485. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3486. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3487. } while (0)
  3488. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3489. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3490. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3491. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3492. do { \
  3493. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3494. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3495. } while (0)
  3496. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3497. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3498. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3499. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3500. do { \
  3501. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3502. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3503. } while (0)
  3504. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3505. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3506. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3507. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3508. do { \
  3509. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3510. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3511. } while (0)
  3512. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3513. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3514. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3515. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3516. do { \
  3517. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3518. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3519. } while (0)
  3520. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3521. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3522. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3523. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3524. do { \
  3525. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3526. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3527. } while (0)
  3528. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3529. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3530. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3531. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3532. do { \
  3533. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3534. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3535. } while (0)
  3536. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3537. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3538. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3539. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3540. do { \
  3541. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3542. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3543. } while (0)
  3544. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3545. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3546. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3547. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3548. do { \
  3549. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3550. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3551. } while (0)
  3552. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3553. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3554. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3555. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3556. do { \
  3557. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3558. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3559. } while (0)
  3560. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3561. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3562. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3563. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3564. do { \
  3565. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3566. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3567. } while (0)
  3568. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3569. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3570. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3571. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3572. do { \
  3573. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3574. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3575. } while (0)
  3576. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3577. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3578. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3579. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3580. do { \
  3581. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3582. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3583. } while (0)
  3584. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3585. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3586. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3587. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3588. do { \
  3589. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3590. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3591. } while (0)
  3592. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3593. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3594. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3595. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3596. do { \
  3597. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3598. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3599. } while (0)
  3600. /**
  3601. * @brief host -> target FW statistics retrieve
  3602. *
  3603. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3604. *
  3605. * @details
  3606. * The following field definitions describe the format of the HTT host
  3607. * to target FW stats retrieve message. The message specifies the type of
  3608. * stats host wants to retrieve.
  3609. *
  3610. * |31 24|23 16|15 8|7 0|
  3611. * |-----------------------------------------------------------|
  3612. * | stats types request bitmask | msg type |
  3613. * |-----------------------------------------------------------|
  3614. * | stats types reset bitmask | reserved |
  3615. * |-----------------------------------------------------------|
  3616. * | stats type | config value |
  3617. * |-----------------------------------------------------------|
  3618. * | cookie LSBs |
  3619. * |-----------------------------------------------------------|
  3620. * | cookie MSBs |
  3621. * |-----------------------------------------------------------|
  3622. * Header fields:
  3623. * - MSG_TYPE
  3624. * Bits 7:0
  3625. * Purpose: identifies this is a stats upload request message
  3626. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3627. * - UPLOAD_TYPES
  3628. * Bits 31:8
  3629. * Purpose: identifies which types of FW statistics to upload
  3630. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3631. * - RESET_TYPES
  3632. * Bits 31:8
  3633. * Purpose: identifies which types of FW statistics to reset
  3634. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3635. * - CFG_VAL
  3636. * Bits 23:0
  3637. * Purpose: give an opaque configuration value to the specified stats type
  3638. * Value: stats-type specific configuration value
  3639. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3640. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3641. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3642. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3643. * - CFG_STAT_TYPE
  3644. * Bits 31:24
  3645. * Purpose: specify which stats type (if any) the config value applies to
  3646. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3647. * a valid configuration specification
  3648. * - COOKIE_LSBS
  3649. * Bits 31:0
  3650. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3651. * message with its preceding host->target stats request message.
  3652. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3653. * - COOKIE_MSBS
  3654. * Bits 31:0
  3655. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3656. * message with its preceding host->target stats request message.
  3657. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3658. */
  3659. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3660. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3661. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3662. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3663. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3664. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3665. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3666. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3667. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3668. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3669. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3670. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3671. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3672. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3673. do { \
  3674. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3675. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3676. } while (0)
  3677. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3678. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3679. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3680. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3681. do { \
  3682. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3683. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3684. } while (0)
  3685. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3686. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3687. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3688. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3689. do { \
  3690. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3691. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3692. } while (0)
  3693. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3694. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3695. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3696. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3697. do { \
  3698. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3699. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3700. } while (0)
  3701. /**
  3702. * @brief host -> target HTT out-of-band sync request
  3703. *
  3704. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3705. *
  3706. * @details
  3707. * The HTT SYNC tells the target to suspend processing of subsequent
  3708. * HTT host-to-target messages until some other target agent locally
  3709. * informs the target HTT FW that the current sync counter is equal to
  3710. * or greater than (in a modulo sense) the sync counter specified in
  3711. * the SYNC message.
  3712. * This allows other host-target components to synchronize their operation
  3713. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3714. * security key has been downloaded to and activated by the target.
  3715. * In the absence of any explicit synchronization counter value
  3716. * specification, the target HTT FW will use zero as the default current
  3717. * sync value.
  3718. *
  3719. * |31 24|23 16|15 8|7 0|
  3720. * |-----------------------------------------------------------|
  3721. * | reserved | sync count | msg type |
  3722. * |-----------------------------------------------------------|
  3723. * Header fields:
  3724. * - MSG_TYPE
  3725. * Bits 7:0
  3726. * Purpose: identifies this as a sync message
  3727. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3728. * - SYNC_COUNT
  3729. * Bits 15:8
  3730. * Purpose: specifies what sync value the HTT FW will wait for from
  3731. * an out-of-band specification to resume its operation
  3732. * Value: in-band sync counter value to compare against the out-of-band
  3733. * counter spec.
  3734. * The HTT target FW will suspend its host->target message processing
  3735. * as long as
  3736. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3737. */
  3738. #define HTT_H2T_SYNC_MSG_SZ 4
  3739. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3740. #define HTT_H2T_SYNC_COUNT_S 8
  3741. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3742. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3743. HTT_H2T_SYNC_COUNT_S)
  3744. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3745. do { \
  3746. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3747. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3748. } while (0)
  3749. /**
  3750. * @brief host -> target HTT aggregation configuration
  3751. *
  3752. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3753. */
  3754. #define HTT_AGGR_CFG_MSG_SZ 4
  3755. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3756. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3757. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3758. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3759. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3760. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3761. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3762. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3763. do { \
  3764. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3765. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3766. } while (0)
  3767. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3768. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3769. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3770. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3771. do { \
  3772. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3773. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3774. } while (0)
  3775. /**
  3776. * @brief host -> target HTT configure max amsdu info per vdev
  3777. *
  3778. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3779. *
  3780. * @details
  3781. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3782. *
  3783. * |31 21|20 16|15 8|7 0|
  3784. * |-----------------------------------------------------------|
  3785. * | reserved | vdev id | max amsdu | msg type |
  3786. * |-----------------------------------------------------------|
  3787. * Header fields:
  3788. * - MSG_TYPE
  3789. * Bits 7:0
  3790. * Purpose: identifies this as a aggr cfg ex message
  3791. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3792. * - MAX_NUM_AMSDU_SUBFRM
  3793. * Bits 15:8
  3794. * Purpose: max MSDUs per A-MSDU
  3795. * - VDEV_ID
  3796. * Bits 20:16
  3797. * Purpose: ID of the vdev to which this limit is applied
  3798. */
  3799. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3800. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3801. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3802. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3803. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3804. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3805. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3806. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3807. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3808. do { \
  3809. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3810. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3811. } while (0)
  3812. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3813. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3814. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3815. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3816. do { \
  3817. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3818. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3819. } while (0)
  3820. /**
  3821. * @brief HTT WDI_IPA Config Message
  3822. *
  3823. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3824. *
  3825. * @details
  3826. * The HTT WDI_IPA config message is created/sent by host at driver
  3827. * init time. It contains information about data structures used on
  3828. * WDI_IPA TX and RX path.
  3829. * TX CE ring is used for pushing packet metadata from IPA uC
  3830. * to WLAN FW
  3831. * TX Completion ring is used for generating TX completions from
  3832. * WLAN FW to IPA uC
  3833. * RX Indication ring is used for indicating RX packets from FW
  3834. * to IPA uC
  3835. * RX Ring2 is used as either completion ring or as second
  3836. * indication ring. when Ring2 is used as completion ring, IPA uC
  3837. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3838. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3839. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3840. * indicated in RX Indication ring. Please see WDI_IPA specification
  3841. * for more details.
  3842. * |31 24|23 16|15 8|7 0|
  3843. * |----------------+----------------+----------------+----------------|
  3844. * | tx pkt pool size | Rsvd | msg_type |
  3845. * |-------------------------------------------------------------------|
  3846. * | tx comp ring base (bits 31:0) |
  3847. #if HTT_PADDR64
  3848. * | tx comp ring base (bits 63:32) |
  3849. #endif
  3850. * |-------------------------------------------------------------------|
  3851. * | tx comp ring size |
  3852. * |-------------------------------------------------------------------|
  3853. * | tx comp WR_IDX physical address (bits 31:0) |
  3854. #if HTT_PADDR64
  3855. * | tx comp WR_IDX physical address (bits 63:32) |
  3856. #endif
  3857. * |-------------------------------------------------------------------|
  3858. * | tx CE WR_IDX physical address (bits 31:0) |
  3859. #if HTT_PADDR64
  3860. * | tx CE WR_IDX physical address (bits 63:32) |
  3861. #endif
  3862. * |-------------------------------------------------------------------|
  3863. * | rx indication ring base (bits 31:0) |
  3864. #if HTT_PADDR64
  3865. * | rx indication ring base (bits 63:32) |
  3866. #endif
  3867. * |-------------------------------------------------------------------|
  3868. * | rx indication ring size |
  3869. * |-------------------------------------------------------------------|
  3870. * | rx ind RD_IDX physical address (bits 31:0) |
  3871. #if HTT_PADDR64
  3872. * | rx ind RD_IDX physical address (bits 63:32) |
  3873. #endif
  3874. * |-------------------------------------------------------------------|
  3875. * | rx ind WR_IDX physical address (bits 31:0) |
  3876. #if HTT_PADDR64
  3877. * | rx ind WR_IDX physical address (bits 63:32) |
  3878. #endif
  3879. * |-------------------------------------------------------------------|
  3880. * |-------------------------------------------------------------------|
  3881. * | rx ring2 base (bits 31:0) |
  3882. #if HTT_PADDR64
  3883. * | rx ring2 base (bits 63:32) |
  3884. #endif
  3885. * |-------------------------------------------------------------------|
  3886. * | rx ring2 size |
  3887. * |-------------------------------------------------------------------|
  3888. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3889. #if HTT_PADDR64
  3890. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3891. #endif
  3892. * |-------------------------------------------------------------------|
  3893. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3894. #if HTT_PADDR64
  3895. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3896. #endif
  3897. * |-------------------------------------------------------------------|
  3898. *
  3899. * Header fields:
  3900. * Header fields:
  3901. * - MSG_TYPE
  3902. * Bits 7:0
  3903. * Purpose: Identifies this as WDI_IPA config message
  3904. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3905. * - TX_PKT_POOL_SIZE
  3906. * Bits 15:0
  3907. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3908. * WDI_IPA TX path
  3909. * For systems using 32-bit format for bus addresses:
  3910. * - TX_COMP_RING_BASE_ADDR
  3911. * Bits 31:0
  3912. * Purpose: TX Completion Ring base address in DDR
  3913. * - TX_COMP_RING_SIZE
  3914. * Bits 31:0
  3915. * Purpose: TX Completion Ring size (must be power of 2)
  3916. * - TX_COMP_WR_IDX_ADDR
  3917. * Bits 31:0
  3918. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3919. * updates the Write Index for WDI_IPA TX completion ring
  3920. * - TX_CE_WR_IDX_ADDR
  3921. * Bits 31:0
  3922. * Purpose: DDR address where IPA uC
  3923. * updates the WR Index for TX CE ring
  3924. * (needed for fusion platforms)
  3925. * - RX_IND_RING_BASE_ADDR
  3926. * Bits 31:0
  3927. * Purpose: RX Indication Ring base address in DDR
  3928. * - RX_IND_RING_SIZE
  3929. * Bits 31:0
  3930. * Purpose: RX Indication Ring size
  3931. * - RX_IND_RD_IDX_ADDR
  3932. * Bits 31:0
  3933. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3934. * RX indication ring
  3935. * - RX_IND_WR_IDX_ADDR
  3936. * Bits 31:0
  3937. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3938. * updates the Write Index for WDI_IPA RX indication ring
  3939. * - RX_RING2_BASE_ADDR
  3940. * Bits 31:0
  3941. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3942. * - RX_RING2_SIZE
  3943. * Bits 31:0
  3944. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3945. * - RX_RING2_RD_IDX_ADDR
  3946. * Bits 31:0
  3947. * Purpose: If Second RX ring is Indication ring, DDR address where
  3948. * IPA uC updates the Read Index for Ring2.
  3949. * If Second RX ring is completion ring, this is NOT used
  3950. * - RX_RING2_WR_IDX_ADDR
  3951. * Bits 31:0
  3952. * Purpose: If Second RX ring is Indication ring, DDR address where
  3953. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3954. * If second RX ring is completion ring, DDR address where
  3955. * IPA uC updates the Write Index for Ring 2.
  3956. * For systems using 64-bit format for bus addresses:
  3957. * - TX_COMP_RING_BASE_ADDR_LO
  3958. * Bits 31:0
  3959. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3960. * - TX_COMP_RING_BASE_ADDR_HI
  3961. * Bits 31:0
  3962. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3963. * - TX_COMP_RING_SIZE
  3964. * Bits 31:0
  3965. * Purpose: TX Completion Ring size (must be power of 2)
  3966. * - TX_COMP_WR_IDX_ADDR_LO
  3967. * Bits 31:0
  3968. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3969. * Lower 4 bytes of DDR address where WIFI FW
  3970. * updates the Write Index for WDI_IPA TX completion ring
  3971. * - TX_COMP_WR_IDX_ADDR_HI
  3972. * Bits 31:0
  3973. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3974. * Higher 4 bytes of DDR address where WIFI FW
  3975. * updates the Write Index for WDI_IPA TX completion ring
  3976. * - TX_CE_WR_IDX_ADDR_LO
  3977. * Bits 31:0
  3978. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3979. * updates the WR Index for TX CE ring
  3980. * (needed for fusion platforms)
  3981. * - TX_CE_WR_IDX_ADDR_HI
  3982. * Bits 31:0
  3983. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3984. * updates the WR Index for TX CE ring
  3985. * (needed for fusion platforms)
  3986. * - RX_IND_RING_BASE_ADDR_LO
  3987. * Bits 31:0
  3988. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3989. * - RX_IND_RING_BASE_ADDR_HI
  3990. * Bits 31:0
  3991. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3992. * - RX_IND_RING_SIZE
  3993. * Bits 31:0
  3994. * Purpose: RX Indication Ring size
  3995. * - RX_IND_RD_IDX_ADDR_LO
  3996. * Bits 31:0
  3997. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3998. * for WDI_IPA RX indication ring
  3999. * - RX_IND_RD_IDX_ADDR_HI
  4000. * Bits 31:0
  4001. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  4002. * for WDI_IPA RX indication ring
  4003. * - RX_IND_WR_IDX_ADDR_LO
  4004. * Bits 31:0
  4005. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  4006. * Lower 4 bytes of DDR address where WIFI FW
  4007. * updates the Write Index for WDI_IPA RX indication ring
  4008. * - RX_IND_WR_IDX_ADDR_HI
  4009. * Bits 31:0
  4010. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  4011. * Higher 4 bytes of DDR address where WIFI FW
  4012. * updates the Write Index for WDI_IPA RX indication ring
  4013. * - RX_RING2_BASE_ADDR_LO
  4014. * Bits 31:0
  4015. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4016. * - RX_RING2_BASE_ADDR_HI
  4017. * Bits 31:0
  4018. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4019. * - RX_RING2_SIZE
  4020. * Bits 31:0
  4021. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  4022. * - RX_RING2_RD_IDX_ADDR_LO
  4023. * Bits 31:0
  4024. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4025. * DDR address where IPA uC updates the Read Index for Ring2.
  4026. * If Second RX ring is completion ring, this is NOT used
  4027. * - RX_RING2_RD_IDX_ADDR_HI
  4028. * Bits 31:0
  4029. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4030. * DDR address where IPA uC updates the Read Index for Ring2.
  4031. * If Second RX ring is completion ring, this is NOT used
  4032. * - RX_RING2_WR_IDX_ADDR_LO
  4033. * Bits 31:0
  4034. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4035. * DDR address where WIFI FW updates the Write Index
  4036. * for WDI_IPA RX ring2
  4037. * If second RX ring is completion ring, lower 4 bytes of
  4038. * DDR address where IPA uC updates the Write Index for Ring 2.
  4039. * - RX_RING2_WR_IDX_ADDR_HI
  4040. * Bits 31:0
  4041. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4042. * DDR address where WIFI FW updates the Write Index
  4043. * for WDI_IPA RX ring2
  4044. * If second RX ring is completion ring, higher 4 bytes of
  4045. * DDR address where IPA uC updates the Write Index for Ring 2.
  4046. */
  4047. #if HTT_PADDR64
  4048. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4049. #else
  4050. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4051. #endif
  4052. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4053. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4054. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4055. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4056. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4057. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4058. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4059. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4060. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4061. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4062. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4063. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4064. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4065. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4066. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4067. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4068. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4069. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4070. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4071. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4072. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4073. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4074. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4075. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4076. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4077. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4078. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4079. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4080. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4081. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4082. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4083. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4084. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4085. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4086. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4087. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4088. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4089. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4090. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4091. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4092. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4093. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4094. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4095. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4096. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4097. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4098. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4099. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4100. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4101. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4102. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4103. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4104. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4105. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4106. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4107. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4108. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4109. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4110. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4111. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4112. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4113. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4114. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4115. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4116. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4117. do { \
  4118. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4119. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4120. } while (0)
  4121. /* for systems using 32-bit format for bus addr */
  4122. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4123. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4124. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4125. do { \
  4126. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4127. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4128. } while (0)
  4129. /* for systems using 64-bit format for bus addr */
  4130. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4131. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4132. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4133. do { \
  4134. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4135. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4136. } while (0)
  4137. /* for systems using 64-bit format for bus addr */
  4138. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4139. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4140. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4141. do { \
  4142. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4143. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4144. } while (0)
  4145. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4146. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4147. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4148. do { \
  4149. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4150. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4151. } while (0)
  4152. /* for systems using 32-bit format for bus addr */
  4153. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4154. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4155. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4156. do { \
  4157. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4158. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4159. } while (0)
  4160. /* for systems using 64-bit format for bus addr */
  4161. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4162. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4163. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4164. do { \
  4165. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4166. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4167. } while (0)
  4168. /* for systems using 64-bit format for bus addr */
  4169. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4170. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4171. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4172. do { \
  4173. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4174. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4175. } while (0)
  4176. /* for systems using 32-bit format for bus addr */
  4177. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4178. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4179. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4180. do { \
  4181. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4182. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4183. } while (0)
  4184. /* for systems using 64-bit format for bus addr */
  4185. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4186. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4187. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4188. do { \
  4189. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4190. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4191. } while (0)
  4192. /* for systems using 64-bit format for bus addr */
  4193. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4194. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4195. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4196. do { \
  4197. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4198. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4199. } while (0)
  4200. /* for systems using 32-bit format for bus addr */
  4201. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4202. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4203. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4204. do { \
  4205. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4206. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4207. } while (0)
  4208. /* for systems using 64-bit format for bus addr */
  4209. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4210. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4211. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4212. do { \
  4213. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4214. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4215. } while (0)
  4216. /* for systems using 64-bit format for bus addr */
  4217. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4218. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4219. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4220. do { \
  4221. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4222. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4223. } while (0)
  4224. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4225. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4226. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4227. do { \
  4228. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4229. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4230. } while (0)
  4231. /* for systems using 32-bit format for bus addr */
  4232. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4233. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4234. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4235. do { \
  4236. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4237. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4238. } while (0)
  4239. /* for systems using 64-bit format for bus addr */
  4240. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4241. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4242. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4243. do { \
  4244. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4245. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4246. } while (0)
  4247. /* for systems using 64-bit format for bus addr */
  4248. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4249. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4250. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4251. do { \
  4252. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4253. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4254. } while (0)
  4255. /* for systems using 32-bit format for bus addr */
  4256. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4257. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4258. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4259. do { \
  4260. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4261. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4262. } while (0)
  4263. /* for systems using 64-bit format for bus addr */
  4264. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4265. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4266. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4267. do { \
  4268. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4269. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4270. } while (0)
  4271. /* for systems using 64-bit format for bus addr */
  4272. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4273. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4274. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4275. do { \
  4276. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4277. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4278. } while (0)
  4279. /* for systems using 32-bit format for bus addr */
  4280. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4281. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4282. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4283. do { \
  4284. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4285. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4286. } while (0)
  4287. /* for systems using 64-bit format for bus addr */
  4288. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4289. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4290. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4291. do { \
  4292. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4293. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4294. } while (0)
  4295. /* for systems using 64-bit format for bus addr */
  4296. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4297. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4298. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4299. do { \
  4300. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4301. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4302. } while (0)
  4303. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4304. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4305. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4306. do { \
  4307. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4308. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4309. } while (0)
  4310. /* for systems using 32-bit format for bus addr */
  4311. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4312. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4313. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4314. do { \
  4315. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4316. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4317. } while (0)
  4318. /* for systems using 64-bit format for bus addr */
  4319. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4320. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4321. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4322. do { \
  4323. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4324. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4325. } while (0)
  4326. /* for systems using 64-bit format for bus addr */
  4327. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4328. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4329. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4330. do { \
  4331. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4332. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4333. } while (0)
  4334. /* for systems using 32-bit format for bus addr */
  4335. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4336. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4337. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4338. do { \
  4339. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4340. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4341. } while (0)
  4342. /* for systems using 64-bit format for bus addr */
  4343. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4344. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4345. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4346. do { \
  4347. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4348. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4349. } while (0)
  4350. /* for systems using 64-bit format for bus addr */
  4351. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4352. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4353. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4354. do { \
  4355. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4356. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4357. } while (0)
  4358. /*
  4359. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4360. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4361. * addresses are stored in a XXX-bit field.
  4362. * This macro is used to define both htt_wdi_ipa_config32_t and
  4363. * htt_wdi_ipa_config64_t structs.
  4364. */
  4365. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4366. _paddr__tx_comp_ring_base_addr_, \
  4367. _paddr__tx_comp_wr_idx_addr_, \
  4368. _paddr__tx_ce_wr_idx_addr_, \
  4369. _paddr__rx_ind_ring_base_addr_, \
  4370. _paddr__rx_ind_rd_idx_addr_, \
  4371. _paddr__rx_ind_wr_idx_addr_, \
  4372. _paddr__rx_ring2_base_addr_,\
  4373. _paddr__rx_ring2_rd_idx_addr_,\
  4374. _paddr__rx_ring2_wr_idx_addr_) \
  4375. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4376. { \
  4377. /* DWORD 0: flags and meta-data */ \
  4378. A_UINT32 \
  4379. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4380. reserved: 8, \
  4381. tx_pkt_pool_size: 16;\
  4382. /* DWORD 1 */\
  4383. _paddr__tx_comp_ring_base_addr_;\
  4384. /* DWORD 2 (or 3)*/\
  4385. A_UINT32 tx_comp_ring_size;\
  4386. /* DWORD 3 (or 4)*/\
  4387. _paddr__tx_comp_wr_idx_addr_;\
  4388. /* DWORD 4 (or 6)*/\
  4389. _paddr__tx_ce_wr_idx_addr_;\
  4390. /* DWORD 5 (or 8)*/\
  4391. _paddr__rx_ind_ring_base_addr_;\
  4392. /* DWORD 6 (or 10)*/\
  4393. A_UINT32 rx_ind_ring_size;\
  4394. /* DWORD 7 (or 11)*/\
  4395. _paddr__rx_ind_rd_idx_addr_;\
  4396. /* DWORD 8 (or 13)*/\
  4397. _paddr__rx_ind_wr_idx_addr_;\
  4398. /* DWORD 9 (or 15)*/\
  4399. _paddr__rx_ring2_base_addr_;\
  4400. /* DWORD 10 (or 17) */\
  4401. A_UINT32 rx_ring2_size;\
  4402. /* DWORD 11 (or 18) */\
  4403. _paddr__rx_ring2_rd_idx_addr_;\
  4404. /* DWORD 12 (or 20) */\
  4405. _paddr__rx_ring2_wr_idx_addr_;\
  4406. } POSTPACK
  4407. /* define a htt_wdi_ipa_config32_t type */
  4408. 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));
  4409. /* define a htt_wdi_ipa_config64_t type */
  4410. 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));
  4411. #if HTT_PADDR64
  4412. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4413. #else
  4414. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4415. #endif
  4416. enum htt_wdi_ipa_op_code {
  4417. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4418. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4419. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4420. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4421. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4422. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4423. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4424. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4425. /* keep this last */
  4426. HTT_WDI_IPA_OPCODE_MAX
  4427. };
  4428. /**
  4429. * @brief HTT WDI_IPA Operation Request Message
  4430. *
  4431. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4432. *
  4433. * @details
  4434. * HTT WDI_IPA Operation Request message is sent by host
  4435. * to either suspend or resume WDI_IPA TX or RX path.
  4436. * |31 24|23 16|15 8|7 0|
  4437. * |----------------+----------------+----------------+----------------|
  4438. * | op_code | Rsvd | msg_type |
  4439. * |-------------------------------------------------------------------|
  4440. *
  4441. * Header fields:
  4442. * - MSG_TYPE
  4443. * Bits 7:0
  4444. * Purpose: Identifies this as WDI_IPA Operation Request message
  4445. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4446. * - OP_CODE
  4447. * Bits 31:16
  4448. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4449. * value: = enum htt_wdi_ipa_op_code
  4450. */
  4451. PREPACK struct htt_wdi_ipa_op_request_t
  4452. {
  4453. /* DWORD 0: flags and meta-data */
  4454. A_UINT32
  4455. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4456. reserved: 8,
  4457. op_code: 16;
  4458. } POSTPACK;
  4459. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4460. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4461. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4462. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4463. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4464. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4465. do { \
  4466. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4467. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4468. } while (0)
  4469. /*
  4470. * @brief host -> target HTT_MSI_SETUP message
  4471. *
  4472. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4473. *
  4474. * @details
  4475. * After target is booted up, host can send MSI setup message so that
  4476. * target sets up HW registers based on setup message.
  4477. *
  4478. * The message would appear as follows:
  4479. * |31 24|23 16|15|14 8|7 0|
  4480. * |---------------+-----------------+-----------------+-----------------|
  4481. * | reserved | msi_type | pdev_id | msg_type |
  4482. * |---------------------------------------------------------------------|
  4483. * | msi_addr_lo |
  4484. * |---------------------------------------------------------------------|
  4485. * | msi_addr_hi |
  4486. * |---------------------------------------------------------------------|
  4487. * | msi_data |
  4488. * |---------------------------------------------------------------------|
  4489. *
  4490. * The message is interpreted as follows:
  4491. * dword0 - b'0:7 - msg_type: This will be set to
  4492. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4493. * b'8:15 - pdev_id:
  4494. * 0 (for rings at SOC/UMAC level),
  4495. * 1/2/3 mac id (for rings at LMAC level)
  4496. * b'16:23 - msi_type: identify which msi registers need to be setup
  4497. * more details can be got from enum htt_msi_setup_type
  4498. * b'24:31 - reserved
  4499. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4500. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4501. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4502. */
  4503. PREPACK struct htt_msi_setup_t {
  4504. A_UINT32 msg_type: 8,
  4505. pdev_id: 8,
  4506. msi_type: 8,
  4507. reserved: 8;
  4508. A_UINT32 msi_addr_lo;
  4509. A_UINT32 msi_addr_hi;
  4510. A_UINT32 msi_data;
  4511. } POSTPACK;
  4512. enum htt_msi_setup_type {
  4513. HTT_PPDU_END_MSI_SETUP_TYPE,
  4514. /* Insert new types here*/
  4515. };
  4516. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4517. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4518. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4519. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4520. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4521. HTT_MSI_SETUP_PDEV_ID_S)
  4522. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4523. do { \
  4524. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4525. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4526. } while (0)
  4527. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4528. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4529. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4530. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4531. HTT_MSI_SETUP_MSI_TYPE_S)
  4532. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4533. do { \
  4534. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4535. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4536. } while (0)
  4537. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4538. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4539. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4540. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4541. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4542. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4543. do { \
  4544. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4545. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4546. } while (0)
  4547. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4548. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4549. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4550. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4551. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4552. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4553. do { \
  4554. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4555. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4556. } while (0)
  4557. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4558. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4559. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4560. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4561. HTT_MSI_SETUP_MSI_DATA_S)
  4562. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4563. do { \
  4564. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4565. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4566. } while (0)
  4567. /*
  4568. * @brief host -> target HTT_SRING_SETUP message
  4569. *
  4570. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4571. *
  4572. * @details
  4573. * After target is booted up, Host can send SRING setup message for
  4574. * each host facing LMAC SRING. Target setups up HW registers based
  4575. * on setup message and confirms back to Host if response_required is set.
  4576. * Host should wait for confirmation message before sending new SRING
  4577. * setup message
  4578. *
  4579. * The message would appear as follows:
  4580. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4581. * |--------------- +-----------------+-----------------+-----------------|
  4582. * | ring_type | ring_id | pdev_id | msg_type |
  4583. * |----------------------------------------------------------------------|
  4584. * | ring_base_addr_lo |
  4585. * |----------------------------------------------------------------------|
  4586. * | ring_base_addr_hi |
  4587. * |----------------------------------------------------------------------|
  4588. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4589. * |----------------------------------------------------------------------|
  4590. * | ring_head_offset32_remote_addr_lo |
  4591. * |----------------------------------------------------------------------|
  4592. * | ring_head_offset32_remote_addr_hi |
  4593. * |----------------------------------------------------------------------|
  4594. * | ring_tail_offset32_remote_addr_lo |
  4595. * |----------------------------------------------------------------------|
  4596. * | ring_tail_offset32_remote_addr_hi |
  4597. * |----------------------------------------------------------------------|
  4598. * | ring_msi_addr_lo |
  4599. * |----------------------------------------------------------------------|
  4600. * | ring_msi_addr_hi |
  4601. * |----------------------------------------------------------------------|
  4602. * | ring_msi_data |
  4603. * |----------------------------------------------------------------------|
  4604. * | intr_timer_th |IM| intr_batch_counter_th |
  4605. * |----------------------------------------------------------------------|
  4606. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4607. * |----------------------------------------------------------------------|
  4608. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4609. * |----------------------------------------------------------------------|
  4610. * Where
  4611. * IM = sw_intr_mode
  4612. * RR = response_required
  4613. * PTCF = prefetch_timer_cfg
  4614. * IP = IPA drop flag
  4615. *
  4616. * The message is interpreted as follows:
  4617. * dword0 - b'0:7 - msg_type: This will be set to
  4618. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4619. * b'8:15 - pdev_id:
  4620. * 0 (for rings at SOC/UMAC level),
  4621. * 1/2/3 mac id (for rings at LMAC level)
  4622. * b'16:23 - ring_id: identify which ring is to setup,
  4623. * more details can be got from enum htt_srng_ring_id
  4624. * b'24:31 - ring_type: identify type of host rings,
  4625. * more details can be got from enum htt_srng_ring_type
  4626. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4627. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4628. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4629. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4630. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4631. * SW_TO_HW_RING.
  4632. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4633. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4634. * Lower 32 bits of memory address of the remote variable
  4635. * storing the 4-byte word offset that identifies the head
  4636. * element within the ring.
  4637. * (The head offset variable has type A_UINT32.)
  4638. * Valid for HW_TO_SW and SW_TO_SW rings.
  4639. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4640. * Upper 32 bits of memory address of the remote variable
  4641. * storing the 4-byte word offset that identifies the head
  4642. * element within the ring.
  4643. * (The head offset variable has type A_UINT32.)
  4644. * Valid for HW_TO_SW and SW_TO_SW rings.
  4645. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4646. * Lower 32 bits of memory address of the remote variable
  4647. * storing the 4-byte word offset that identifies the tail
  4648. * element within the ring.
  4649. * (The tail offset variable has type A_UINT32.)
  4650. * Valid for HW_TO_SW and SW_TO_SW rings.
  4651. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4652. * Upper 32 bits of memory address of the remote variable
  4653. * storing the 4-byte word offset that identifies the tail
  4654. * element within the ring.
  4655. * (The tail offset variable has type A_UINT32.)
  4656. * Valid for HW_TO_SW and SW_TO_SW rings.
  4657. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4658. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4659. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4660. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4661. * dword10 - b'0:31 - ring_msi_data: MSI data
  4662. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4663. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4664. * dword11 - b'0:14 - intr_batch_counter_th:
  4665. * batch counter threshold is in units of 4-byte words.
  4666. * HW internally maintains and increments batch count.
  4667. * (see SRING spec for detail description).
  4668. * When batch count reaches threshold value, an interrupt
  4669. * is generated by HW.
  4670. * b'15 - sw_intr_mode:
  4671. * This configuration shall be static.
  4672. * Only programmed at power up.
  4673. * 0: generate pulse style sw interrupts
  4674. * 1: generate level style sw interrupts
  4675. * b'16:31 - intr_timer_th:
  4676. * The timer init value when timer is idle or is
  4677. * initialized to start downcounting.
  4678. * In 8us units (to cover a range of 0 to 524 ms)
  4679. * dword12 - b'0:15 - intr_low_threshold:
  4680. * Used only by Consumer ring to generate ring_sw_int_p.
  4681. * Ring entries low threshold water mark, that is used
  4682. * in combination with the interrupt timer as well as
  4683. * the the clearing of the level interrupt.
  4684. * b'16:18 - prefetch_timer_cfg:
  4685. * Used only by Consumer ring to set timer mode to
  4686. * support Application prefetch handling.
  4687. * The external tail offset/pointer will be updated
  4688. * at following intervals:
  4689. * 3'b000: (Prefetch feature disabled; used only for debug)
  4690. * 3'b001: 1 usec
  4691. * 3'b010: 4 usec
  4692. * 3'b011: 8 usec (default)
  4693. * 3'b100: 16 usec
  4694. * Others: Reserved
  4695. * b'19 - response_required:
  4696. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4697. * b'20 - ipa_drop_flag:
  4698. Indicates that host will config ipa drop threshold percentage
  4699. * b'21:31 - reserved: reserved for future use
  4700. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4701. * b'8:15 - ipa drop high threshold percentage:
  4702. * b'16:31 - Reserved
  4703. */
  4704. PREPACK struct htt_sring_setup_t {
  4705. A_UINT32 msg_type: 8,
  4706. pdev_id: 8,
  4707. ring_id: 8,
  4708. ring_type: 8;
  4709. A_UINT32 ring_base_addr_lo;
  4710. A_UINT32 ring_base_addr_hi;
  4711. A_UINT32 ring_size: 16,
  4712. ring_entry_size: 8,
  4713. ring_misc_cfg_flag: 8;
  4714. A_UINT32 ring_head_offset32_remote_addr_lo;
  4715. A_UINT32 ring_head_offset32_remote_addr_hi;
  4716. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4717. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4718. A_UINT32 ring_msi_addr_lo;
  4719. A_UINT32 ring_msi_addr_hi;
  4720. A_UINT32 ring_msi_data;
  4721. A_UINT32 intr_batch_counter_th: 15,
  4722. sw_intr_mode: 1,
  4723. intr_timer_th: 16;
  4724. A_UINT32 intr_low_threshold: 16,
  4725. prefetch_timer_cfg: 3,
  4726. response_required: 1,
  4727. ipa_drop_flag: 1,
  4728. reserved1: 11;
  4729. A_UINT32 ipa_drop_low_threshold: 8,
  4730. ipa_drop_high_threshold: 8,
  4731. reserved: 16;
  4732. } POSTPACK;
  4733. enum htt_srng_ring_type {
  4734. HTT_HW_TO_SW_RING = 0,
  4735. HTT_SW_TO_HW_RING,
  4736. HTT_SW_TO_SW_RING,
  4737. /* Insert new ring types above this line */
  4738. };
  4739. enum htt_srng_ring_id {
  4740. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4741. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4742. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4743. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4744. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4745. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4746. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4747. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4748. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4749. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4750. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4751. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4752. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4753. HTT_LPASS_TO_FW_RXBUF_RING, /* new LPASS to FW refill ring to recycle rx buffers */
  4754. HTT_HOST3_TO_FW_RXBUF_RING, /* used by host for EasyMesh feature */
  4755. /* Add Other SRING which can't be directly configured by host software above this line */
  4756. };
  4757. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4758. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4759. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4760. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4761. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4762. HTT_SRING_SETUP_PDEV_ID_S)
  4763. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4764. do { \
  4765. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4766. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4767. } while (0)
  4768. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4769. #define HTT_SRING_SETUP_RING_ID_S 16
  4770. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4771. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4772. HTT_SRING_SETUP_RING_ID_S)
  4773. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4774. do { \
  4775. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4776. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4777. } while (0)
  4778. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4779. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4780. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4781. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4782. HTT_SRING_SETUP_RING_TYPE_S)
  4783. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4784. do { \
  4785. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4786. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4787. } while (0)
  4788. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4789. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4790. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4791. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4792. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4793. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4794. do { \
  4795. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4796. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4797. } while (0)
  4798. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4799. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4800. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4801. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4802. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4803. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4804. do { \
  4805. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4806. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4807. } while (0)
  4808. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4809. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4810. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4811. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4812. HTT_SRING_SETUP_RING_SIZE_S)
  4813. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4814. do { \
  4815. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4816. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4817. } while (0)
  4818. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4819. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4820. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4821. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4822. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4823. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4824. do { \
  4825. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4826. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4827. } while (0)
  4828. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4829. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4830. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4831. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4832. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4833. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4834. do { \
  4835. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4836. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4837. } while (0)
  4838. /* This control bit is applicable to only Producer, which updates Ring ID field
  4839. * of each descriptor before pushing into the ring.
  4840. * 0: updates ring_id(default)
  4841. * 1: ring_id updating disabled */
  4842. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4843. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4844. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4845. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4846. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4847. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4848. do { \
  4849. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4850. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4851. } while (0)
  4852. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4853. * of each descriptor before pushing into the ring.
  4854. * 0: updates Loopcnt(default)
  4855. * 1: Loopcnt updating disabled */
  4856. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4857. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4858. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4859. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4860. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4861. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4862. do { \
  4863. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4864. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4865. } while (0)
  4866. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4867. * into security_id port of GXI/AXI. */
  4868. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4869. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4870. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4871. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4872. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4873. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4874. do { \
  4875. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4876. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4877. } while (0)
  4878. /* During MSI write operation, SRNG drives value of this register bit into
  4879. * swap bit of GXI/AXI. */
  4880. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4881. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4882. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4883. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4884. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4885. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4886. do { \
  4887. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4888. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4889. } while (0)
  4890. /* During Pointer write operation, SRNG drives value of this register bit into
  4891. * swap bit of GXI/AXI. */
  4892. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4893. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4894. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4895. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4896. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4897. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4898. do { \
  4899. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4900. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4901. } while (0)
  4902. /* During any data or TLV write operation, SRNG drives value of this register
  4903. * bit into swap bit of GXI/AXI. */
  4904. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4905. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4906. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4907. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4908. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4909. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4910. do { \
  4911. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4912. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4913. } while (0)
  4914. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4915. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4916. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4917. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4918. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4919. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4920. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4921. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4922. do { \
  4923. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4924. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4925. } while (0)
  4926. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4927. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4928. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4929. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4930. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4931. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4932. do { \
  4933. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4934. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4935. } while (0)
  4936. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4937. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4938. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4939. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4940. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4941. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4942. do { \
  4943. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4944. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4945. } while (0)
  4946. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4947. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4948. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4949. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4950. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4951. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4952. do { \
  4953. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4954. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4955. } while (0)
  4956. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4957. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4958. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4959. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4960. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4961. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4962. do { \
  4963. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4964. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4965. } while (0)
  4966. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4967. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4968. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4969. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4970. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4971. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4972. do { \
  4973. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4974. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4975. } while (0)
  4976. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4977. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4978. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4979. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4980. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4981. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4982. do { \
  4983. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4984. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4985. } while (0)
  4986. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4987. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4988. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4989. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4990. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4991. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4992. do { \
  4993. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4994. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4995. } while (0)
  4996. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4997. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4998. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4999. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  5000. HTT_SRING_SETUP_SW_INTR_MODE_S)
  5001. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  5002. do { \
  5003. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  5004. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  5005. } while (0)
  5006. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  5007. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  5008. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  5009. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  5010. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  5011. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  5012. do { \
  5013. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  5014. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  5015. } while (0)
  5016. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  5017. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  5018. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  5019. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  5020. HTT_SRING_SETUP_INTR_LOW_TH_S)
  5021. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  5022. do { \
  5023. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  5024. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  5025. } while (0)
  5026. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  5027. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  5028. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  5029. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  5030. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  5031. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  5032. do { \
  5033. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  5034. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  5035. } while (0)
  5036. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5037. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5038. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5039. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5040. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5041. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5042. do { \
  5043. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5044. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5045. } while (0)
  5046. /**
  5047. * @brief host -> target RX ring selection config message
  5048. *
  5049. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5050. *
  5051. * @details
  5052. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5053. * configure RXDMA rings.
  5054. * The configuration is per ring based and includes both packet subtypes
  5055. * and PPDU/MPDU TLVs.
  5056. *
  5057. * The message would appear as follows:
  5058. *
  5059. * |31 28|27|26|25|24|23|22|21 19|18 16|15 | 11| 10|9 8|7 0|
  5060. * |-----+--+--+--+--+-----------------+----+---+---+---+---------------|
  5061. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5062. * |-----------------------+-----+-----+--------------------------------|
  5063. * |rsvd2|RX|RXHDL| CLD | CLC | CLM | ring_buffer_size |
  5064. * |--------------------------------------------------------------------|
  5065. * | packet_type_enable_flags_0 |
  5066. * |--------------------------------------------------------------------|
  5067. * | packet_type_enable_flags_1 |
  5068. * |--------------------------------------------------------------------|
  5069. * | packet_type_enable_flags_2 |
  5070. * |--------------------------------------------------------------------|
  5071. * | packet_type_enable_flags_3 |
  5072. * |--------------------------------------------------------------------|
  5073. * | tlv_filter_in_flags |
  5074. * |-----------------------------------+--------------------------------|
  5075. * | rx_header_offset | rx_packet_offset |
  5076. * |-----------------------------------+--------------------------------|
  5077. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5078. * |-----------------------------------+--------------------------------|
  5079. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5080. * |-----------------------------------+--------------------------------|
  5081. * | rsvd3 | rx_attention_offset |
  5082. * |--------------------------------------------------------------------|
  5083. * | rsvd4 | mo| fp| rx_drop_threshold |
  5084. * | |ndp|ndp| |
  5085. * |--------------------------------------------------------------------|
  5086. * Where:
  5087. * PS = pkt_swap
  5088. * SS = status_swap
  5089. * OV = rx_offsets_valid
  5090. * DT = drop_thresh_valid
  5091. * CLM = config_length_mgmt
  5092. * CLC = config_length_ctrl
  5093. * CLD = config_length_data
  5094. * RXHDL = rx_hdr_len
  5095. * RX = rxpcu_filter_enable_flag
  5096. * The message is interpreted as follows:
  5097. * dword0 - b'0:7 - msg_type: This will be set to
  5098. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5099. * b'8:15 - pdev_id:
  5100. * 0 (for rings at SOC/UMAC level),
  5101. * 1/2/3 mac id (for rings at LMAC level)
  5102. * b'16:23 - ring_id : Identify the ring to configure.
  5103. * More details can be got from enum htt_srng_ring_id
  5104. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5105. * BUF_RING_CFG_0 defs within HW .h files,
  5106. * e.g. wmac_top_reg_seq_hwioreg.h
  5107. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5108. * BUF_RING_CFG_0 defs within HW .h files,
  5109. * e.g. wmac_top_reg_seq_hwioreg.h
  5110. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5111. * configuration fields are valid
  5112. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5113. * rx_drop_threshold field is valid
  5114. * b'28 - rx_mon_global_en: Enable/Disable global register
  5115. 8 configuration in Rx monitor module.
  5116. * b'29:31 - rsvd1: reserved for future use
  5117. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5118. * in byte units.
  5119. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5120. * b'16:18 - config_length_mgmt (MGMT):
  5121. * Represents the length of mpdu bytes for mgmt pkt.
  5122. * valid values:
  5123. * 001 - 64bytes
  5124. * 010 - 128bytes
  5125. * 100 - 256bytes
  5126. * 111 - Full mpdu bytes
  5127. * b'19:21 - config_length_ctrl (CTRL):
  5128. * Represents the length of mpdu bytes for ctrl pkt.
  5129. * valid values:
  5130. * 001 - 64bytes
  5131. * 010 - 128bytes
  5132. * 100 - 256bytes
  5133. * 111 - Full mpdu bytes
  5134. * b'22:24 - config_length_data (DATA):
  5135. * Represents the length of mpdu bytes for data pkt.
  5136. * valid values:
  5137. * 001 - 64bytes
  5138. * 010 - 128bytes
  5139. * 100 - 256bytes
  5140. * 111 - Full mpdu bytes
  5141. * b'25:26 - rx_hdr_len:
  5142. * Specifies the number of bytes of recvd packet to copy
  5143. * into the rx_hdr tlv.
  5144. * supported values for now by host:
  5145. * 01 - 64bytes
  5146. * 10 - 128bytes
  5147. * 11 - 256bytes
  5148. * default - 128 bytes
  5149. * b'27 - rxpcu_filter_enable_flag
  5150. * For Scan Radio Host CPU utilization is very high.
  5151. * In order to reduce CPU utilization we need to filter out
  5152. * certain configured MAC frames.
  5153. * To filter out configured MAC address frames, RxPCU should
  5154. * be zero which means allow all frames for MD at RxOLE
  5155. * host wil fiter out frames.
  5156. * RxPCU (Filter IN) -> RxOLE (Filter In/Filter Out)
  5157. * b'28:31 - rsvd2: Reserved for future use
  5158. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5159. * Enable MGMT packet from 0b0000 to 0b1001
  5160. * bits from low to high: FP, MD, MO - 3 bits
  5161. * FP: Filter_Pass
  5162. * MD: Monitor_Direct
  5163. * MO: Monitor_Other
  5164. * 10 mgmt subtypes * 3 bits -> 30 bits
  5165. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5166. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5167. * Enable MGMT packet from 0b1010 to 0b1111
  5168. * bits from low to high: FP, MD, MO - 3 bits
  5169. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5170. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5171. * Enable CTRL packet from 0b0000 to 0b1001
  5172. * bits from low to high: FP, MD, MO - 3 bits
  5173. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5174. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5175. * Enable CTRL packet from 0b1010 to 0b1111,
  5176. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5177. * bits from low to high: FP, MD, MO - 3 bits
  5178. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5179. * dword6 - b'0:31 - tlv_filter_in_flags:
  5180. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5181. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5182. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5183. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5184. * A value of 0 will be considered as ignore this config.
  5185. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5186. * e.g. wmac_top_reg_seq_hwioreg.h
  5187. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5188. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5189. * A value of 0 will be considered as ignore this config.
  5190. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5191. * e.g. wmac_top_reg_seq_hwioreg.h
  5192. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5193. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5194. * A value of 0 will be considered as ignore this config.
  5195. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5196. * e.g. wmac_top_reg_seq_hwioreg.h
  5197. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5198. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5199. * A value of 0 will be considered as ignore this config.
  5200. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5201. * e.g. wmac_top_reg_seq_hwioreg.h
  5202. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5203. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5204. * A value of 0 will be considered as ignore this config.
  5205. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5206. * e.g. wmac_top_reg_seq_hwioreg.h
  5207. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5208. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5209. * A value of 0 will be considered as ignore this config.
  5210. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5211. * e.g. wmac_top_reg_seq_hwioreg.h
  5212. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5213. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5214. * A value of 0 will be considered as ignore this config.
  5215. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5216. * e.g. wmac_top_reg_seq_hwioreg.h
  5217. * - b'16:31 - rsvd3 for future use
  5218. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5219. * to source rings. Consumer drops packets if the available
  5220. * words in the ring falls below the configured threshold
  5221. * value.
  5222. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5223. * by host. 1 -> subscribed
  5224. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5225. * by host. 1 -> subscribed
  5226. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5227. * subscribed by host. 1 -> subscribed
  5228. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5229. * selection for the FP PHY ERR status tlv.
  5230. * 0 - wbm2rxdma_buf_source_ring
  5231. * 1 - fw2rxdma_buf_source_ring
  5232. * 2 - sw2rxdma_buf_source_ring
  5233. * 3 - no_buffer_ring
  5234. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5235. * selection for the FP PHY ERR status tlv.
  5236. * 0 - rxdma_release_ring
  5237. * 1 - rxdma2fw_ring
  5238. * 2 - rxdma2sw_ring
  5239. * 3 - rxdma2reo_ring
  5240. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5241. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5242. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5243. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5244. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5245. * 0: MSDU level logging
  5246. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5247. * 0: MSDU level logging
  5248. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5249. * 0: MSDU level logging
  5250. * - b'23 - word_mask_compaction: enable/disable word mask for
  5251. * mpdu/msdu start/end tlvs
  5252. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5253. * manager override
  5254. * - b'25:28 - rbm_override_val: return buffer manager override value
  5255. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5256. * which have to be posted to host from phy.
  5257. * Corresponding to errors defined in
  5258. * phyrx_abort_request_reason enums 0 to 31.
  5259. * Refer to RXPCU register definition header files for the
  5260. * phyrx_abort_request_reason enum definition.
  5261. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5262. * errors which have to be posted to host from phy.
  5263. * Corresponding to errors defined in
  5264. * phyrx_abort_request_reason enums 32 to 63.
  5265. * Refer to RXPCU register definition header files for the
  5266. * phyrx_abort_request_reason enum definition.
  5267. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5268. * applicable if word mask enabled
  5269. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5270. * applicable if word mask enabled
  5271. * - b'19:31 - rsvd7
  5272. * dword15- b'0:16 - rx_msdu_end_word_mask
  5273. * - b'17:31 - rsvd5
  5274. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5275. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5276. * buffer
  5277. * 1: RX_PKT TLV logging at specified offset for the
  5278. * subsequent buffer
  5279. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5280. */
  5281. PREPACK struct htt_rx_ring_selection_cfg_t {
  5282. A_UINT32 msg_type: 8,
  5283. pdev_id: 8,
  5284. ring_id: 8,
  5285. status_swap: 1,
  5286. pkt_swap: 1,
  5287. rx_offsets_valid: 1,
  5288. drop_thresh_valid: 1,
  5289. rx_mon_global_en: 1,
  5290. rsvd1: 3;
  5291. A_UINT32 ring_buffer_size: 16,
  5292. config_length_mgmt:3,
  5293. config_length_ctrl:3,
  5294. config_length_data:3,
  5295. rx_hdr_len: 2,
  5296. rxpcu_filter_enable_flag:1,
  5297. rsvd2: 4;
  5298. A_UINT32 packet_type_enable_flags_0;
  5299. A_UINT32 packet_type_enable_flags_1;
  5300. A_UINT32 packet_type_enable_flags_2;
  5301. A_UINT32 packet_type_enable_flags_3;
  5302. A_UINT32 tlv_filter_in_flags;
  5303. A_UINT32 rx_packet_offset: 16,
  5304. rx_header_offset: 16;
  5305. A_UINT32 rx_mpdu_end_offset: 16,
  5306. rx_mpdu_start_offset: 16;
  5307. A_UINT32 rx_msdu_end_offset: 16,
  5308. rx_msdu_start_offset: 16;
  5309. A_UINT32 rx_attn_offset: 16,
  5310. rsvd3: 16;
  5311. A_UINT32 rx_drop_threshold: 10,
  5312. fp_ndp: 1,
  5313. mo_ndp: 1,
  5314. fp_phy_err: 1,
  5315. fp_phy_err_buf_src: 2,
  5316. fp_phy_err_buf_dest: 2,
  5317. pkt_type_enable_msdu_or_mpdu_logging:3,
  5318. dma_mpdu_mgmt: 1,
  5319. dma_mpdu_ctrl: 1,
  5320. dma_mpdu_data: 1,
  5321. word_mask_compaction_enable:1,
  5322. rbm_override_enable: 1,
  5323. rbm_override_val: 4,
  5324. rsvd4: 3;
  5325. A_UINT32 phy_err_mask;
  5326. A_UINT32 phy_err_mask_cont;
  5327. A_UINT32 rx_mpdu_start_word_mask:16,
  5328. rx_mpdu_end_word_mask: 3,
  5329. rsvd7: 13;
  5330. A_UINT32 rx_msdu_end_word_mask: 17,
  5331. rsvd5: 15;
  5332. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5333. rx_pkt_tlv_offset: 15,
  5334. rsvd6: 16;
  5335. A_UINT32 rx_mpdu_start_word_mask_v2: 20,
  5336. rx_mpdu_end_word_mask_v2: 8,
  5337. rsvd8: 4;
  5338. A_UINT32 rx_msdu_end_word_mask_v2: 20,
  5339. rsvd9: 12;
  5340. A_UINT32 rx_ppdu_end_usr_stats_word_mask_v2: 20,
  5341. rsvd10: 12;
  5342. A_UINT32 packet_type_enable_fpmo_flags0;
  5343. A_UINT32 packet_type_enable_fpmo_flags1;
  5344. } POSTPACK;
  5345. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5346. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5347. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5348. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5349. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5350. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5351. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5352. do { \
  5353. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5354. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5355. } while (0)
  5356. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5357. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5358. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5359. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5360. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5361. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5362. do { \
  5363. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5364. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5365. } while (0)
  5366. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5367. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5368. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5369. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5370. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5371. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5372. do { \
  5373. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5374. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5375. } while (0)
  5376. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5377. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5378. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5379. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5380. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5381. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5382. do { \
  5383. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5384. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5385. } while (0)
  5386. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5387. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5388. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5389. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5390. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5391. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5392. do { \
  5393. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5394. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5395. } while (0)
  5396. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5397. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5398. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5399. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5400. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5401. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5402. do { \
  5403. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5404. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5405. } while (0)
  5406. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5407. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5408. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5409. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5410. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5411. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5412. do { \
  5413. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5414. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5415. } while (0)
  5416. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5417. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5418. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5419. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5420. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5421. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5422. do { \
  5423. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5424. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5425. } while (0)
  5426. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5427. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5428. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5429. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5430. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5431. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5432. do { \
  5433. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5434. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5435. } while (0)
  5436. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5437. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5438. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5439. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5440. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5441. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5442. do { \
  5443. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5444. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5445. } while (0)
  5446. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5447. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5448. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5449. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5450. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5451. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5452. do { \
  5453. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5454. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5455. } while (0)
  5456. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5457. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5458. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5459. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5460. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5461. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5462. do { \
  5463. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5464. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5465. } while(0)
  5466. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M 0x08000000
  5467. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S 27
  5468. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_GET(_var) \
  5469. (((_var) & HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M) >> \
  5470. HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S)
  5471. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_SET(_var, _val) \
  5472. do { \
  5473. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER, _val); \
  5474. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S));\
  5475. } while(0)
  5476. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5477. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5479. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5480. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5481. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5482. do { \
  5483. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5484. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5485. } while (0)
  5486. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5487. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5488. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5489. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5490. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5491. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5492. do { \
  5493. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5494. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5495. } while (0)
  5496. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5497. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5498. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5499. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5500. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5501. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5502. do { \
  5503. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5504. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5505. } while (0)
  5506. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5507. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5509. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5510. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5511. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5512. do { \
  5513. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5514. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5515. } while (0)
  5516. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5517. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5518. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5519. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5520. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5521. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5522. do { \
  5523. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5524. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5525. } while (0)
  5526. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5527. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5528. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5529. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5530. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5531. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5532. do { \
  5533. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5534. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5535. } while (0)
  5536. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5537. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5538. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5539. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5540. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5541. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5542. do { \
  5543. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5544. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5545. } while (0)
  5546. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5547. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5548. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5549. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5550. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5551. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5552. do { \
  5553. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5554. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5555. } while (0)
  5556. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5557. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5558. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5559. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5560. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5561. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5562. do { \
  5563. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5564. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5565. } while (0)
  5566. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5567. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5568. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5569. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5570. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5571. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5572. do { \
  5573. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5574. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5575. } while (0)
  5576. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5577. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5578. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5579. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5580. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5581. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5582. do { \
  5583. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5584. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5585. } while (0)
  5586. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5587. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5588. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5589. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5590. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5591. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5592. do { \
  5593. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5594. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5595. } while (0)
  5596. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5597. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5598. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5599. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5600. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5601. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5602. do { \
  5603. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5604. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5605. } while (0)
  5606. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5607. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5608. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5609. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5610. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5611. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5612. do { \
  5613. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5614. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5615. } while (0)
  5616. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5617. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5618. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5619. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5620. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5621. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5622. do { \
  5623. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5624. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5625. } while (0)
  5626. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5627. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5628. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5629. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5630. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5631. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5632. do { \
  5633. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5634. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5635. } while (0)
  5636. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5637. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5638. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5639. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5640. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5641. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5642. do { \
  5643. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5644. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5645. } while (0)
  5646. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5647. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5648. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5649. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5650. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5651. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5652. do { \
  5653. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5654. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5655. } while (0)
  5656. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5657. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5658. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5659. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5660. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5661. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5662. do { \
  5663. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5664. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5665. } while (0)
  5666. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5667. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5668. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5669. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5670. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5671. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5672. do { \
  5673. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5674. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5675. } while (0)
  5676. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5677. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5678. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5679. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5680. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5681. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5682. do { \
  5683. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5684. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5685. } while (0)
  5686. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5687. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5688. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5689. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5690. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5691. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5692. do { \
  5693. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5694. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5695. } while (0)
  5696. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5697. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5698. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5699. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5700. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5701. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5702. do { \
  5703. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5704. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5705. } while (0)
  5706. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5707. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5708. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5709. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5710. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5711. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5712. do { \
  5713. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5714. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5715. } while (0)
  5716. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5717. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5718. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5719. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5720. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5721. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5722. do { \
  5723. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5724. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5725. } while (0)
  5726. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5727. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5728. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5729. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5730. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5731. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5732. do { \
  5733. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5734. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5735. } while (0)
  5736. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5737. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5738. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5739. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5740. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5741. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5742. do { \
  5743. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5744. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5745. } while (0)
  5746. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5747. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5748. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5749. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5750. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5751. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5752. do { \
  5753. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5754. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5755. } while (0)
  5756. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5757. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5758. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5759. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5760. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5761. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5762. do { \
  5763. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5764. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5765. } while (0)
  5766. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5767. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5768. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5769. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5770. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5771. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5772. do { \
  5773. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5774. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5775. } while (0)
  5776. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5777. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5778. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5779. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5780. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5781. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5782. do { \
  5783. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5784. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5785. } while (0)
  5786. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5787. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5788. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5789. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5790. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5791. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5792. do { \
  5793. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5794. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5795. } while (0)
  5796. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M 0x000FFFFF
  5797. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S 0
  5798. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_GET(_var) \
  5799. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M)>> \
  5800. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)
  5801. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_SET(_var, _val) \
  5802. do { \
  5803. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2, _val);\
  5804. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)); \
  5805. } while (0)
  5806. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M 0x0FF00000
  5807. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S 20
  5808. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_GET(_var) \
  5809. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M)>> \
  5810. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)
  5811. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_SET(_var, _val) \
  5812. do { \
  5813. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2, _val);\
  5814. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)); \
  5815. } while (0)
  5816. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M 0x000FFFFF
  5817. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S 0
  5818. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_GET(_var) \
  5819. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M)>> \
  5820. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)
  5821. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_SET(_var, _val) \
  5822. do { \
  5823. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2, _val);\
  5824. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)); \
  5825. } while (0)
  5826. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M 0x000FFFFF
  5827. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S 0
  5828. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_GET(_var) \
  5829. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M)>> \
  5830. HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)
  5831. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_SET(_var, _val) \
  5832. do { \
  5833. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2, _val);\
  5834. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)); \
  5835. } while (0)
  5836. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M 0xFFFFFFFF
  5837. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S 0
  5838. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_GET(_var) \
  5839. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M)>> \
  5840. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)
  5841. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_SET(_var, _val) \
  5842. do { \
  5843. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0, _val); \
  5844. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)); \
  5845. } while (0)
  5846. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M 0xFFFFFFFF
  5847. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S 0
  5848. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_GET(_var) \
  5849. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M)>> \
  5850. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)
  5851. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_SET(_var, _val) \
  5852. do { \
  5853. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1, _val); \
  5854. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)); \
  5855. } while (0)
  5856. /*
  5857. * Subtype based MGMT frames enable bits.
  5858. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5859. */
  5860. /* association request */
  5861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5867. /* association response */
  5868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5874. /* Reassociation request */
  5875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5881. /* Reassociation response */
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5888. /* Probe request */
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5895. /* Probe response */
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5902. /* Timing Advertisement */
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5909. /* Reserved */
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5916. /* Beacon */
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5923. /* ATIM */
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5930. /* Disassociation */
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5937. /* Authentication */
  5938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5944. /* Deauthentication */
  5945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5951. /* Action */
  5952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5958. /* Action No Ack */
  5959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5965. /* Reserved */
  5966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5972. /*
  5973. * Subtype based CTRL frames enable bits.
  5974. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5975. */
  5976. /* Reserved */
  5977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5983. /* Reserved */
  5984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5990. /* Reserved */
  5991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5997. /* Reserved */
  5998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  6000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  6001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  6002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  6003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  6004. /* Reserved */
  6005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  6006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  6007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  6008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  6009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  6010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  6011. /* Reserved */
  6012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  6013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  6014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  6015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  6016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  6017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  6018. /* Reserved */
  6019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  6020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  6021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  6022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  6023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  6024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  6025. /* Control Wrapper */
  6026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  6027. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  6028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  6029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  6030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  6031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  6032. /* Block Ack Request */
  6033. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  6034. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  6035. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  6036. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  6037. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  6038. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  6039. /* Block Ack*/
  6040. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  6041. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  6042. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  6043. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  6044. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  6045. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  6046. /* PS-POLL */
  6047. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  6048. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  6049. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  6050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  6051. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  6052. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  6053. /* RTS */
  6054. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  6055. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  6056. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  6057. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  6058. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  6059. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  6060. /* CTS */
  6061. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  6062. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  6063. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  6064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  6065. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  6066. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  6067. /* ACK */
  6068. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  6069. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  6070. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  6071. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  6072. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  6073. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  6074. /* CF-END */
  6075. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  6076. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  6077. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  6078. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  6079. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  6080. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  6081. /* CF-END + CF-ACK */
  6082. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  6083. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  6084. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  6085. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  6086. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  6087. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  6088. /* Multicast data */
  6089. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  6090. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  6091. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  6092. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  6093. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  6094. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  6095. /* Unicast data */
  6096. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  6097. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  6098. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  6099. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  6100. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  6101. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  6102. /* NULL data */
  6103. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  6104. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  6105. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  6106. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  6107. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  6108. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  6109. /* FPMO mode flags */
  6110. /* MGMT */
  6111. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_M 0x00000001
  6112. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_S 0
  6113. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_M 0x00000002
  6114. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_S 1
  6115. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_M 0x00000004
  6116. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_S 2
  6117. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_M 0x00000008
  6118. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_S 3
  6119. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_M 0x00000010
  6120. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_S 4
  6121. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_M 0x00000020
  6122. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_S 5
  6123. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_M 0x00000040
  6124. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_S 6
  6125. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_M 0x00000080
  6126. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_S 7
  6127. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_M 0x00000100
  6128. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_S 8
  6129. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_M 0x00000200
  6130. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_S 9
  6131. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_M 0x00000400
  6132. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_S 10
  6133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_M 0x00000800
  6134. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_S 11
  6135. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_M 0x00001000
  6136. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_S 12
  6137. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_M 0x00002000
  6138. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_S 13
  6139. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_M 0x00004000
  6140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_S 14
  6141. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_M 0x00008000
  6142. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_S 15
  6143. /* CTRL */
  6144. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_M 0x00010000
  6145. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_S 16
  6146. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_M 0x00020000
  6147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_S 17
  6148. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_M 0x00040000
  6149. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_S 18
  6150. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_M 0x00080000
  6151. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_S 19
  6152. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_M 0x00100000
  6153. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_S 20
  6154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_M 0x00200000
  6155. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_S 21
  6156. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_M 0x00400000
  6157. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_S 22
  6158. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_M 0x00800000
  6159. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_S 23
  6160. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_M 0x01000000
  6161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_S 24
  6162. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_M 0x02000000
  6163. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_S 25
  6164. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_M 0x04000000
  6165. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_S 26
  6166. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_M 0x08000000
  6167. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_S 27
  6168. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_M 0x10000000
  6169. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_S 28
  6170. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_M 0x20000000
  6171. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_S 29
  6172. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_M 0x40000000
  6173. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_S 30
  6174. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_M 0x80000000
  6175. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_S 31
  6176. /* DATA */
  6177. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_M 0x00000001
  6178. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_S 0
  6179. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_M 0x00000002
  6180. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_S 1
  6181. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_M 0x00000004
  6182. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_S 2
  6183. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_M 0x00000008
  6184. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_S 3
  6185. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_M 0x00000010
  6186. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_S 4
  6187. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  6188. do { \
  6189. HTT_CHECK_SET_VAL(httsym, value); \
  6190. (word) |= (value) << httsym##_S; \
  6191. } while (0)
  6192. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  6193. (((word) & httsym##_M) >> httsym##_S)
  6194. #define htt_rx_ring_pkt_enable_subtype_set( \
  6195. word, flag, mode, type, subtype, val) \
  6196. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  6197. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  6198. #define htt_rx_ring_pkt_enable_subtype_get( \
  6199. word, flag, mode, type, subtype) \
  6200. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  6201. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  6202. /* Definition to filter in TLVs */
  6203. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  6204. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  6205. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  6206. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  6207. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6208. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6209. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6210. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6211. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6212. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6213. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6214. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6215. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6216. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6217. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6218. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6219. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6220. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6221. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6222. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6223. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6224. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6225. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6226. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6227. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6228. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6229. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6230. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6231. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6232. do { \
  6233. HTT_CHECK_SET_VAL(httsym, enable); \
  6234. (word) |= (enable) << httsym##_S; \
  6235. } while (0)
  6236. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6237. (((word) & httsym##_M) >> httsym##_S)
  6238. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6239. HTT_RX_RING_TLV_ENABLE_SET( \
  6240. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6241. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6242. HTT_RX_RING_TLV_ENABLE_GET( \
  6243. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6244. /**
  6245. * @brief host -> target TX monitor config message
  6246. *
  6247. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6248. *
  6249. * @details
  6250. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6251. * configure RXDMA rings.
  6252. * The configuration is per ring based and includes both packet types
  6253. * and PPDU/MPDU TLVs.
  6254. *
  6255. * The message would appear as follows:
  6256. *
  6257. * |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|
  6258. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6259. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6260. * |-----------+--------+--------+-----+------------------------------------|
  6261. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6262. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6263. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6264. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6265. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6266. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6267. * |------------------------------------------------------------------------|
  6268. * | tlv_filter_mask_in0 |
  6269. * |------------------------------------------------------------------------|
  6270. * | tlv_filter_mask_in1 |
  6271. * |------------------------------------------------------------------------|
  6272. * | tlv_filter_mask_in2 |
  6273. * |------------------------------------------------------------------------|
  6274. * | tlv_filter_mask_in3 |
  6275. * |-----------------+-----------------+---------------------+--------------|
  6276. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6277. * |------------------------------------------------------------------------|
  6278. * | pcu_ppdu_setup_word_mask |
  6279. * |--------------------+--+--+--+-----+---------------------+--------------|
  6280. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6281. * |------------------------------------------------------------------------|
  6282. *
  6283. * Where:
  6284. * PS = pkt_swap
  6285. * SS = status_swap
  6286. * The message is interpreted as follows:
  6287. * dword0 - b'0:7 - msg_type: This will be set to
  6288. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6289. * b'8:15 - pdev_id:
  6290. * 0 (for rings at SOC level),
  6291. * 1/2/3 mac id (for rings at LMAC level)
  6292. * b'16:23 - ring_id : Identify the ring to configure.
  6293. * More details can be got from enum htt_srng_ring_id
  6294. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6295. * BUF_RING_CFG_0 defs within HW .h files,
  6296. * e.g. wmac_top_reg_seq_hwioreg.h
  6297. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6298. * BUF_RING_CFG_0 defs within HW .h files,
  6299. * e.g. wmac_top_reg_seq_hwioreg.h
  6300. * b'26 - tx_mon_global_en: Enable/Disable global register
  6301. * configuration in Tx monitor module.
  6302. * b'27:31 - rsvd1: reserved for future use
  6303. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6304. * in byte units.
  6305. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6306. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6307. * 64, 128, 256.
  6308. * If all 3 bits are set config length is > 256.
  6309. * if val is '0', then ignore this field.
  6310. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6311. * 64, 128, 256.
  6312. * If all 3 bits are set config length is > 256.
  6313. * if val is '0', then ignore this field.
  6314. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6315. * 64, 128, 256.
  6316. * If all 3 bits are set config length is > 256.
  6317. * If val is '0', then ignore this field.
  6318. * - b'25:31 - rsvd2: Reserved for future use
  6319. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6320. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6321. * If packet_type_enable_flags is '1' for MGMT type,
  6322. * monitor will ignore this bit and allow this TLV.
  6323. * If packet_type_enable_flags is '0' for MGMT type,
  6324. * monitor will use this bit to enable/disable logging
  6325. * of this TLV.
  6326. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6327. * If packet_type_enable_flags is '1' for CTRL type,
  6328. * monitor will ignore this bit and allow this TLV.
  6329. * If packet_type_enable_flags is '0' for CTRL type,
  6330. * monitor will use this bit to enable/disable logging
  6331. * of this TLV.
  6332. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6333. * If packet_type_enable_flags is '1' for DATA type,
  6334. * monitor will ignore this bit and allow this TLV.
  6335. * If packet_type_enable_flags is '0' for DATA type,
  6336. * monitor will use this bit to enable/disable logging
  6337. * of this TLV.
  6338. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6339. * If packet_type_enable_flags is '1' for MGMT type,
  6340. * monitor will ignore this bit and allow this TLV.
  6341. * If packet_type_enable_flags is '0' for MGMT type,
  6342. * monitor will use this bit to enable/disable logging
  6343. * of this TLV.
  6344. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6345. * If packet_type_enable_flags is '1' for CTRL type,
  6346. * monitor will ignore this bit and allow this TLV.
  6347. * If packet_type_enable_flags is '0' for CTRL type,
  6348. * monitor will use this bit to enable/disable logging
  6349. * of this TLV.
  6350. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6351. * If packet_type_enable_flags is '1' for DATA type,
  6352. * monitor will ignore this bit and allow this TLV.
  6353. * If packet_type_enable_flags is '0' for DATA type,
  6354. * monitor will use this bit to enable/disable logging
  6355. * of this TLV.
  6356. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6357. * If packet_type_enable_flags is '1' for MGMT type,
  6358. * monitor will ignore this bit and allow this TLV.
  6359. * If packet_type_enable_flags is '0' for MGMT type,
  6360. * monitor will use this bit to enable/disable logging
  6361. * of this TLV.
  6362. * If filter_in_TX_MPDU_START = 1 it is recommended
  6363. * to set this bit.
  6364. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6365. * If packet_type_enable_flags is '1' for CTRL type,
  6366. * monitor will ignore this bit and allow this TLV.
  6367. * If packet_type_enable_flags is '0' for CTRL type,
  6368. * monitor will use this bit to enable/disable logging
  6369. * of this TLV.
  6370. * If filter_in_TX_MPDU_START = 1 it is recommended
  6371. * to set this bit.
  6372. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6373. * If packet_type_enable_flags is '1' for DATA type,
  6374. * monitor will ignore this bit and allow this TLV.
  6375. * If packet_type_enable_flags is '0' for DATA type,
  6376. * monitor will use this bit to enable/disable logging
  6377. * of this TLV.
  6378. * If filter_in_TX_MPDU_START = 1 it is recommended
  6379. * to set this bit.
  6380. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6381. * If packet_type_enable_flags is '1' for MGMT type,
  6382. * monitor will ignore this bit and allow this TLV.
  6383. * If packet_type_enable_flags is '0' for MGMT type,
  6384. * monitor will use this bit to enable/disable logging
  6385. * of this TLV.
  6386. * If filter_in_TX_MSDU_START = 1 it is recommended
  6387. * to set this bit.
  6388. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6389. * If packet_type_enable_flags is '1' for CTRL type,
  6390. * monitor will ignore this bit and allow this TLV.
  6391. * If packet_type_enable_flags is '0' for CTRL type,
  6392. * monitor will use this bit to enable/disable logging
  6393. * of this TLV.
  6394. * If filter_in_TX_MSDU_START = 1 it is recommended
  6395. * to set this bit.
  6396. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6397. * If packet_type_enable_flags is '1' for DATA type,
  6398. * monitor will ignore this bit and allow this TLV.
  6399. * If packet_type_enable_flags is '0' for DATA type,
  6400. * monitor will use this bit to enable/disable logging
  6401. * of this TLV.
  6402. * If filter_in_TX_MSDU_START = 1 it is recommended
  6403. * to set this bit.
  6404. * b'15:31 - rsvd3: Reserved for future use
  6405. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6406. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6407. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6408. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6409. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6410. * - b'8:15 - tx_peer_entry_word_mask:
  6411. * - b'16:23 - tx_queue_ext_word_mask:
  6412. * - b'24:31 - tx_msdu_start_word_mask:
  6413. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6414. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6415. * - b'8:15 - rxpcu_user_setup_word_mask:
  6416. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6417. * MGMT, CTRL, DATA
  6418. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6419. * 0 -> MSDU level logging is enabled
  6420. * (valid only if bit is set in
  6421. * pkt_type_enable_msdu_or_mpdu_logging)
  6422. * 1 -> MPDU level logging is enabled
  6423. * (valid only if bit is set in
  6424. * pkt_type_enable_msdu_or_mpdu_logging)
  6425. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6426. * 0 -> MSDU level logging is enabled
  6427. * (valid only if bit is set in
  6428. * pkt_type_enable_msdu_or_mpdu_logging)
  6429. * 1 -> MPDU level logging is enabled
  6430. * (valid only if bit is set in
  6431. * pkt_type_enable_msdu_or_mpdu_logging)
  6432. * - b'21 - dma_mpdu_data(D) : For DATA
  6433. * 0 -> MSDU level logging is enabled
  6434. * (valid only if bit is set in
  6435. * pkt_type_enable_msdu_or_mpdu_logging)
  6436. * 1 -> MPDU level logging is enabled
  6437. * (valid only if bit is set in
  6438. * pkt_type_enable_msdu_or_mpdu_logging)
  6439. * - b'22:31 - rsvd4 for future use
  6440. */
  6441. PREPACK struct htt_tx_monitor_cfg_t {
  6442. A_UINT32 msg_type: 8,
  6443. pdev_id: 8,
  6444. ring_id: 8,
  6445. status_swap: 1,
  6446. pkt_swap: 1,
  6447. tx_mon_global_en: 1,
  6448. rsvd1: 5;
  6449. A_UINT32 ring_buffer_size: 16,
  6450. config_length_mgmt: 3,
  6451. config_length_ctrl: 3,
  6452. config_length_data: 3,
  6453. rsvd2: 7;
  6454. A_UINT32 pkt_type_enable_flags: 3,
  6455. filter_in_tx_mpdu_start_mgmt: 1,
  6456. filter_in_tx_mpdu_start_ctrl: 1,
  6457. filter_in_tx_mpdu_start_data: 1,
  6458. filter_in_tx_msdu_start_mgmt: 1,
  6459. filter_in_tx_msdu_start_ctrl: 1,
  6460. filter_in_tx_msdu_start_data: 1,
  6461. filter_in_tx_mpdu_end_mgmt: 1,
  6462. filter_in_tx_mpdu_end_ctrl: 1,
  6463. filter_in_tx_mpdu_end_data: 1,
  6464. filter_in_tx_msdu_end_mgmt: 1,
  6465. filter_in_tx_msdu_end_ctrl: 1,
  6466. filter_in_tx_msdu_end_data: 1,
  6467. word_mask_compaction_enable: 1,
  6468. rsvd3: 16;
  6469. A_UINT32 tlv_filter_mask_in0;
  6470. A_UINT32 tlv_filter_mask_in1;
  6471. A_UINT32 tlv_filter_mask_in2;
  6472. A_UINT32 tlv_filter_mask_in3;
  6473. A_UINT32 tx_fes_setup_word_mask: 8,
  6474. tx_peer_entry_word_mask: 8,
  6475. tx_queue_ext_word_mask: 8,
  6476. tx_msdu_start_word_mask: 8;
  6477. A_UINT32 pcu_ppdu_setup_word_mask;
  6478. A_UINT32 tx_mpdu_start_word_mask: 8,
  6479. rxpcu_user_setup_word_mask: 8,
  6480. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6481. dma_mpdu_mgmt: 1,
  6482. dma_mpdu_ctrl: 1,
  6483. dma_mpdu_data: 1,
  6484. rsvd4: 10;
  6485. A_UINT32 tx_queue_ext_v2_word_mask: 12,
  6486. tx_peer_entry_v2_word_mask: 12,
  6487. rsvd5: 10;
  6488. A_UINT32 fes_status_end_word_mask: 16,
  6489. response_end_status_word_mask: 16;
  6490. A_UINT32 fes_status_prot_word_mask: 11,
  6491. rsvd6: 21;
  6492. } POSTPACK;
  6493. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6494. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6495. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6496. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6497. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6498. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6499. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6500. do { \
  6501. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6502. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6503. } while (0)
  6504. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6505. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6506. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6507. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6508. HTT_TX_MONITOR_CFG_RING_ID_S)
  6509. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6510. do { \
  6511. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6512. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6513. } while (0)
  6514. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6515. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6516. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6517. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6518. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6519. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6520. do { \
  6521. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6522. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6523. } while (0)
  6524. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6525. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6526. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6527. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6528. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6529. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6530. do { \
  6531. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6532. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6533. } while (0)
  6534. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6535. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6536. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6537. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6538. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6539. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6540. do { \
  6541. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6542. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6543. } while (0)
  6544. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6545. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6546. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6547. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6548. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6549. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6550. do { \
  6551. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6552. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6553. } while (0)
  6554. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6555. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6556. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6557. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6558. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6559. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6560. do { \
  6561. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6562. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6563. } while (0)
  6564. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6565. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6566. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6567. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6568. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6569. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6570. do { \
  6571. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6572. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6573. } while (0)
  6574. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6575. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6576. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6577. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6578. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6579. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6580. do { \
  6581. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6582. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6583. } while (0)
  6584. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6585. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6586. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6587. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6588. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6589. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6590. do { \
  6591. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6592. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6593. } while (0)
  6594. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6595. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6596. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6597. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6598. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6599. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6600. do { \
  6601. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6602. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6603. } while (0)
  6604. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6605. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6606. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6607. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6608. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6609. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6610. do { \
  6611. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6612. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6613. } while (0)
  6614. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6615. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6616. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6617. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6618. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6619. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6620. do { \
  6621. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6622. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6623. } while (0)
  6624. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6625. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6626. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6627. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6628. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6629. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6630. do { \
  6631. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6632. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6633. } while (0)
  6634. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6635. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6636. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6637. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6638. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6639. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6640. do { \
  6641. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6642. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6643. } while (0)
  6644. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6645. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6646. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6647. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6648. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6649. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6650. do { \
  6651. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6652. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6653. } while (0)
  6654. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6655. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6656. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6657. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6658. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6659. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6660. do { \
  6661. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6662. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6663. } while (0)
  6664. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6665. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6666. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6667. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6668. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6669. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6670. do { \
  6671. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6672. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6673. } while (0)
  6674. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6675. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6676. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6677. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6678. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6679. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6680. do { \
  6681. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6682. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6683. } while (0)
  6684. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6685. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6686. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6687. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6688. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6689. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6690. do { \
  6691. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6692. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6693. } while (0)
  6694. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6695. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6696. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6697. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6698. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6699. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6700. do { \
  6701. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6702. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6703. } while (0)
  6704. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6705. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6706. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6707. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6708. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6709. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6710. do { \
  6711. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6712. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6713. } while (0)
  6714. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00008000
  6715. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S 15
  6716. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  6717. (((_var) & HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  6718. HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  6719. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  6720. do { \
  6721. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  6722. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  6723. } while (0)
  6724. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6725. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6726. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6727. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6728. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6729. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6730. do { \
  6731. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6732. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6733. } while (0)
  6734. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6735. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6736. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6737. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6738. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6739. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6740. do { \
  6741. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6742. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6743. } while (0)
  6744. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6745. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6746. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6747. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6748. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6749. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6750. do { \
  6751. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6752. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6753. } while (0)
  6754. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6755. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6756. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6757. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6758. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6759. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6760. do { \
  6761. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6762. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6763. } while (0)
  6764. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6765. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6766. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6767. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6768. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6769. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6770. do { \
  6771. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6772. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6773. } while (0)
  6774. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6775. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6776. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6777. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6778. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6779. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6780. do { \
  6781. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6782. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6783. } while (0)
  6784. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6785. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6786. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6787. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6788. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6789. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6790. do { \
  6791. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6792. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6793. } while (0)
  6794. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6795. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6796. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6797. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6798. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6799. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6800. do { \
  6801. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6802. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6803. } while (0)
  6804. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6805. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6806. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6807. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6808. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6809. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6810. do { \
  6811. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6812. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6813. } while (0)
  6814. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6815. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6816. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6817. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6818. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6819. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6820. do { \
  6821. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6822. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6823. } while (0)
  6824. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6825. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6826. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6827. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6828. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6829. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6830. do { \
  6831. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6832. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6833. } while (0)
  6834. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6835. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6836. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6837. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6838. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6839. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6840. do { \
  6841. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6842. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6843. } while (0)
  6844. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M 0x00000fff
  6845. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S 0
  6846. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_GET(_var) \
  6847. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M) >> \
  6848. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)
  6849. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_SET(_var, _val) \
  6850. do { \
  6851. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK, _val); \
  6852. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)); \
  6853. } while (0)
  6854. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M 0x00fff000
  6855. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S 12
  6856. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_GET(_var) \
  6857. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M) >> \
  6858. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)
  6859. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_SET(_var, _val) \
  6860. do { \
  6861. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK, _val); \
  6862. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)); \
  6863. } while (0)
  6864. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M 0x0000ffff
  6865. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S 0
  6866. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_GET(_var) \
  6867. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M) >> \
  6868. HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)
  6869. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_SET(_var, _val) \
  6870. do { \
  6871. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK, _val); \
  6872. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)); \
  6873. } while (0)
  6874. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M 0xffff0000
  6875. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S 16
  6876. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_GET(_var) \
  6877. (((_var) & HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M) >> \
  6878. HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)
  6879. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_SET(_var, _val) \
  6880. do { \
  6881. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK, _val); \
  6882. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)); \
  6883. } while (0)
  6884. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M 0x000007ff
  6885. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S 0
  6886. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_GET(_var) \
  6887. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M) >> \
  6888. HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)
  6889. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_SET(_var, _val) \
  6890. do { \
  6891. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK, _val); \
  6892. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)); \
  6893. } while (0)
  6894. /*
  6895. * pkt_type_enable_flags
  6896. */
  6897. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6898. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6899. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6900. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6901. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6902. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6903. /*
  6904. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6905. */
  6906. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6907. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6908. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6909. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6910. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6911. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6912. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6913. do { \
  6914. HTT_CHECK_SET_VAL(httsym, value); \
  6915. (word) |= (value) << httsym##_S; \
  6916. } while (0)
  6917. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6918. (((word) & httsym##_M) >> httsym##_S)
  6919. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6920. * type -> MGMT, CTRL, DATA*/
  6921. #define htt_tx_ring_pkt_type_set( \
  6922. word, mode, type, val) \
  6923. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6924. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6925. #define htt_tx_ring_pkt_type_get( \
  6926. word, mode, type) \
  6927. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6928. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6929. /* Definition to filter in TLVs */
  6930. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6931. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6932. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6933. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6934. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6935. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6936. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6937. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6938. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6939. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6940. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6941. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6942. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6943. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6944. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6945. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6946. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6947. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6948. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6949. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6950. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6951. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6952. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6953. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6954. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6955. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6956. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6957. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6958. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6959. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6960. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6961. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6962. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6963. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6964. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6965. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6966. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6967. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6968. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6969. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6970. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6971. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6972. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6973. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6974. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6975. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6976. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6977. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6978. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6979. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6980. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6981. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6982. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6983. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6984. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6985. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6986. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6987. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6988. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6989. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6990. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6991. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6992. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6993. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6994. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6995. do { \
  6996. HTT_CHECK_SET_VAL(httsym, enable); \
  6997. (word) |= (enable) << httsym##_S; \
  6998. } while (0)
  6999. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  7000. (((word) & httsym##_M) >> httsym##_S)
  7001. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  7002. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  7003. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  7004. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  7005. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  7006. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  7007. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  7008. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  7009. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  7010. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  7011. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  7012. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  7013. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  7014. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  7015. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  7016. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  7017. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  7018. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  7019. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  7020. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  7021. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  7022. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  7023. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  7024. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  7025. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  7026. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  7027. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  7028. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  7029. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  7030. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  7031. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  7032. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  7033. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  7034. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  7035. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  7036. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  7037. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  7038. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  7039. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  7040. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  7041. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  7042. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  7043. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  7044. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  7045. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  7046. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  7047. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  7048. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  7049. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  7050. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  7051. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  7052. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  7053. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  7054. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  7055. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  7056. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  7057. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  7058. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  7059. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  7060. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  7061. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  7062. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  7063. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  7064. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  7065. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  7066. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  7067. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  7068. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  7069. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  7070. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  7071. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  7072. do { \
  7073. HTT_CHECK_SET_VAL(httsym, enable); \
  7074. (word) |= (enable) << httsym##_S; \
  7075. } while (0)
  7076. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  7077. (((word) & httsym##_M) >> httsym##_S)
  7078. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  7079. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  7080. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  7081. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  7082. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  7083. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  7084. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  7085. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  7086. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  7087. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  7088. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  7089. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  7090. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  7091. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  7092. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  7093. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  7094. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  7095. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  7096. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  7097. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  7098. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  7099. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  7100. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  7101. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  7102. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  7103. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  7104. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  7105. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  7106. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  7107. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  7108. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  7109. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  7110. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  7111. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  7112. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  7113. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  7114. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  7115. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  7116. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  7117. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  7118. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  7119. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  7120. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  7121. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  7122. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  7123. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  7124. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  7125. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  7126. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  7127. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  7128. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  7129. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  7130. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  7131. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  7132. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  7133. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  7134. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  7135. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  7136. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  7137. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  7138. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  7139. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  7140. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  7141. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  7142. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  7143. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  7144. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  7145. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  7146. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  7147. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  7148. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  7149. do { \
  7150. HTT_CHECK_SET_VAL(httsym, enable); \
  7151. (word) |= (enable) << httsym##_S; \
  7152. } while (0)
  7153. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  7154. (((word) & httsym##_M) >> httsym##_S)
  7155. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  7156. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  7157. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  7158. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  7159. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  7160. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  7161. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  7162. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  7163. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  7164. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  7165. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  7166. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  7167. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  7168. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  7169. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  7170. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  7171. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  7172. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  7173. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  7174. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  7175. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  7176. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  7177. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  7178. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  7179. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  7180. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  7181. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  7182. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  7183. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  7184. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  7185. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  7186. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  7187. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  7188. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  7189. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  7190. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  7191. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  7192. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  7193. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  7194. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  7195. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  7196. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  7197. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  7198. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  7199. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  7200. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  7201. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  7202. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  7203. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  7204. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  7205. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  7206. do { \
  7207. HTT_CHECK_SET_VAL(httsym, enable); \
  7208. (word) |= (enable) << httsym##_S; \
  7209. } while (0)
  7210. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  7211. (((word) & httsym##_M) >> httsym##_S)
  7212. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  7213. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  7214. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  7215. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  7216. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  7217. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  7218. /**
  7219. * @brief host --> target Receive Flow Steering configuration message definition
  7220. *
  7221. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  7222. *
  7223. * host --> target Receive Flow Steering configuration message definition.
  7224. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7225. * The reason for this is we want RFS to be configured and ready before MAC
  7226. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7227. *
  7228. * |31 24|23 16|15 9|8|7 0|
  7229. * |----------------+----------------+----------------+----------------|
  7230. * | reserved |E| msg type |
  7231. * |-------------------------------------------------------------------|
  7232. * Where E = RFS enable flag
  7233. *
  7234. * The RFS_CONFIG message consists of a single 4-byte word.
  7235. *
  7236. * Header fields:
  7237. * - MSG_TYPE
  7238. * Bits 7:0
  7239. * Purpose: identifies this as a RFS config msg
  7240. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  7241. * - RFS_CONFIG
  7242. * Bit 8
  7243. * Purpose: Tells target whether to enable (1) or disable (0)
  7244. * flow steering feature when sending rx indication messages to host
  7245. */
  7246. #define HTT_H2T_RFS_CONFIG_M 0x100
  7247. #define HTT_H2T_RFS_CONFIG_S 8
  7248. #define HTT_RX_RFS_CONFIG_GET(_var) \
  7249. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  7250. HTT_H2T_RFS_CONFIG_S)
  7251. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  7252. do { \
  7253. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  7254. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  7255. } while (0)
  7256. #define HTT_RFS_CFG_REQ_BYTES 4
  7257. /**
  7258. * @brief host -> target FW extended statistics request
  7259. *
  7260. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  7261. *
  7262. * @details
  7263. * The following field definitions describe the format of the HTT host
  7264. * to target FW extended stats retrieve message.
  7265. * The message specifies the type of stats the host wants to retrieve.
  7266. *
  7267. * |31 24|23 16|15 8|7 0|
  7268. * |-----------------------------------------------------------|
  7269. * | reserved | stats type | pdev_mask | msg type |
  7270. * |-----------------------------------------------------------|
  7271. * | config param [0] |
  7272. * |-----------------------------------------------------------|
  7273. * | config param [1] |
  7274. * |-----------------------------------------------------------|
  7275. * | config param [2] |
  7276. * |-----------------------------------------------------------|
  7277. * | config param [3] |
  7278. * |-----------------------------------------------------------|
  7279. * | reserved |
  7280. * |-----------------------------------------------------------|
  7281. * | cookie LSBs |
  7282. * |-----------------------------------------------------------|
  7283. * | cookie MSBs |
  7284. * |-----------------------------------------------------------|
  7285. * Header fields:
  7286. * - MSG_TYPE
  7287. * Bits 7:0
  7288. * Purpose: identifies this is a extended stats upload request message
  7289. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7290. * - PDEV_MASK
  7291. * Bits 8:15
  7292. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7293. * Value: This is a overloaded field, refer to usage and interpretation of
  7294. * PDEV in interface document.
  7295. * Bit 8 : Reserved for SOC stats
  7296. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7297. * Indicates MACID_MASK in DBS
  7298. * - STATS_TYPE
  7299. * Bits 23:16
  7300. * Purpose: identifies which FW statistics to upload
  7301. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7302. * - Reserved
  7303. * Bits 31:24
  7304. * - CONFIG_PARAM [0]
  7305. * Bits 31:0
  7306. * Purpose: give an opaque configuration value to the specified stats type
  7307. * Value: stats-type specific configuration value
  7308. * Refer to htt_stats.h for interpretation for each stats sub_type
  7309. * - CONFIG_PARAM [1]
  7310. * Bits 31:0
  7311. * Purpose: give an opaque configuration value to the specified stats type
  7312. * Value: stats-type specific configuration value
  7313. * Refer to htt_stats.h for interpretation for each stats sub_type
  7314. * - CONFIG_PARAM [2]
  7315. * Bits 31:0
  7316. * Purpose: give an opaque configuration value to the specified stats type
  7317. * Value: stats-type specific configuration value
  7318. * Refer to htt_stats.h for interpretation for each stats sub_type
  7319. * - CONFIG_PARAM [3]
  7320. * Bits 31:0
  7321. * Purpose: give an opaque configuration value to the specified stats type
  7322. * Value: stats-type specific configuration value
  7323. * Refer to htt_stats.h for interpretation for each stats sub_type
  7324. * - Reserved [31:0] for future use.
  7325. * - COOKIE_LSBS
  7326. * Bits 31:0
  7327. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7328. * message with its preceding host->target stats request message.
  7329. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7330. * - COOKIE_MSBS
  7331. * Bits 31:0
  7332. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7333. * message with its preceding host->target stats request message.
  7334. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7335. */
  7336. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7337. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7338. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7339. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7340. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7341. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7342. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7343. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7344. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7345. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7346. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7347. do { \
  7348. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7349. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7350. } while (0)
  7351. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7352. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7353. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7354. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7355. do { \
  7356. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7357. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7358. } while (0)
  7359. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7360. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7361. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7362. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7363. do { \
  7364. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7365. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7366. } while (0)
  7367. /**
  7368. * @brief host -> target FW streaming statistics request
  7369. *
  7370. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7371. *
  7372. * @details
  7373. * The following field definitions describe the format of the HTT host
  7374. * to target message that requests the target to start or stop producing
  7375. * ongoing stats of the specified type.
  7376. *
  7377. * |31|30 |23 16|15 8|7 0|
  7378. * |-----------------------------------------------------------|
  7379. * |EN| reserved | stats type | reserved | msg type |
  7380. * |-----------------------------------------------------------|
  7381. * | config param [0] |
  7382. * |-----------------------------------------------------------|
  7383. * | config param [1] |
  7384. * |-----------------------------------------------------------|
  7385. * | config param [2] |
  7386. * |-----------------------------------------------------------|
  7387. * | config param [3] |
  7388. * |-----------------------------------------------------------|
  7389. * Where:
  7390. * - EN is an enable/disable flag
  7391. * Header fields:
  7392. * - MSG_TYPE
  7393. * Bits 7:0
  7394. * Purpose: identifies this is a streaming stats upload request message
  7395. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7396. * - STATS_TYPE
  7397. * Bits 23:16
  7398. * Purpose: identifies which FW statistics to upload
  7399. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7400. * Only the htt_dbg_ext_stats_type values identified as streaming
  7401. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7402. * - ENABLE
  7403. * Bit 31
  7404. * Purpose: enable/disable the target's ongoing stats of the specified type
  7405. * Value:
  7406. * 0 - disable ongoing production of the specified stats type
  7407. * 1 - enable ongoing production of the specified stats type
  7408. * - CONFIG_PARAM [0]
  7409. * Bits 31:0
  7410. * Purpose: give an opaque configuration value to the specified stats type
  7411. * Value: stats-type specific configuration value
  7412. * Refer to htt_stats.h for interpretation for each stats sub_type
  7413. * - CONFIG_PARAM [1]
  7414. * Bits 31:0
  7415. * Purpose: give an opaque configuration value to the specified stats type
  7416. * Value: stats-type specific configuration value
  7417. * Refer to htt_stats.h for interpretation for each stats sub_type
  7418. * - CONFIG_PARAM [2]
  7419. * Bits 31:0
  7420. * Purpose: give an opaque configuration value to the specified stats type
  7421. * Value: stats-type specific configuration value
  7422. * Refer to htt_stats.h for interpretation for each stats sub_type
  7423. * - CONFIG_PARAM [3]
  7424. * Bits 31:0
  7425. * Purpose: give an opaque configuration value to the specified stats type
  7426. * Value: stats-type specific configuration value
  7427. * Refer to htt_stats.h for interpretation for each stats sub_type
  7428. */
  7429. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7430. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7431. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7432. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7433. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7434. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7435. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7436. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7437. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7438. do { \
  7439. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7440. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7441. } while (0)
  7442. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7443. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7444. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7445. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7446. do { \
  7447. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7448. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7449. } while (0)
  7450. /**
  7451. * @brief host -> target FW PPDU_STATS request message
  7452. *
  7453. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7454. *
  7455. * @details
  7456. * The following field definitions describe the format of the HTT host
  7457. * to target FW for PPDU_STATS_CFG msg.
  7458. * The message allows the host to configure the PPDU_STATS_IND messages
  7459. * produced by the target.
  7460. *
  7461. * |31 24|23 16|15 8|7 0|
  7462. * |-----------------------------------------------------------|
  7463. * | REQ bit mask | pdev_mask | msg type |
  7464. * |-----------------------------------------------------------|
  7465. * Header fields:
  7466. * - MSG_TYPE
  7467. * Bits 7:0
  7468. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7469. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7470. * - PDEV_MASK
  7471. * Bits 8:15
  7472. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7473. * Value: This is a overloaded field, refer to usage and interpretation of
  7474. * PDEV in interface document.
  7475. * Bit 8 : Reserved for SOC stats
  7476. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7477. * Indicates MACID_MASK in DBS
  7478. * - REQ_TLV_BIT_MASK
  7479. * Bits 16:31
  7480. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7481. * needs to be included in the target's PPDU_STATS_IND messages.
  7482. * Value: refer htt_ppdu_stats_tlv_tag_t
  7483. *
  7484. */
  7485. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7486. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7487. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7488. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7489. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7490. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7491. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7492. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7493. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7494. do { \
  7495. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7496. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7497. } while (0)
  7498. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7499. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7500. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7501. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7502. do { \
  7503. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7504. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7505. } while (0)
  7506. /**
  7507. * @brief Host-->target HTT RX FSE setup message
  7508. *
  7509. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7510. *
  7511. * @details
  7512. * Through this message, the host will provide details of the flow tables
  7513. * in host DDR along with hash keys.
  7514. * This message can be sent per SOC or per PDEV, which is differentiated
  7515. * by pdev id values.
  7516. * The host will allocate flow search table and sends table size,
  7517. * physical DMA address of flow table, and hash keys to firmware to
  7518. * program into the RXOLE FSE HW block.
  7519. *
  7520. * The following field definitions describe the format of the RX FSE setup
  7521. * message sent from the host to target
  7522. *
  7523. * Header fields:
  7524. * dword0 - b'7:0 - msg_type: This will be set to
  7525. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7526. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7527. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7528. * pdev's LMAC ring.
  7529. * b'31:16 - reserved : Reserved for future use
  7530. * dword1 - b'19:0 - number of records: This field indicates the number of
  7531. * entries in the flow table. For example: 8k number of
  7532. * records is equivalent to
  7533. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7534. * b'27:20 - max search: This field specifies the skid length to FSE
  7535. * parser HW module whenever match is not found at the
  7536. * exact index pointed by hash.
  7537. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7538. * Refer htt_ip_da_sa_prefix below for more details.
  7539. * b'31:30 - reserved: Reserved for future use
  7540. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7541. * table allocated by host in DDR
  7542. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7543. * table allocated by host in DDR
  7544. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7545. * entry hashing
  7546. *
  7547. *
  7548. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7549. * |---------------------------------------------------------------|
  7550. * | reserved | pdev_id | MSG_TYPE |
  7551. * |---------------------------------------------------------------|
  7552. * |resvd|IPDSA| max_search | Number of records |
  7553. * |---------------------------------------------------------------|
  7554. * | base address lo |
  7555. * |---------------------------------------------------------------|
  7556. * | base address high |
  7557. * |---------------------------------------------------------------|
  7558. * | toeplitz key 31_0 |
  7559. * |---------------------------------------------------------------|
  7560. * | toeplitz key 63_32 |
  7561. * |---------------------------------------------------------------|
  7562. * | toeplitz key 95_64 |
  7563. * |---------------------------------------------------------------|
  7564. * | toeplitz key 127_96 |
  7565. * |---------------------------------------------------------------|
  7566. * | toeplitz key 159_128 |
  7567. * |---------------------------------------------------------------|
  7568. * | toeplitz key 191_160 |
  7569. * |---------------------------------------------------------------|
  7570. * | toeplitz key 223_192 |
  7571. * |---------------------------------------------------------------|
  7572. * | toeplitz key 255_224 |
  7573. * |---------------------------------------------------------------|
  7574. * | toeplitz key 287_256 |
  7575. * |---------------------------------------------------------------|
  7576. * | reserved | toeplitz key 314_288(26:0 bits) |
  7577. * |---------------------------------------------------------------|
  7578. * where:
  7579. * IPDSA = ip_da_sa
  7580. */
  7581. /**
  7582. * @brief: htt_ip_da_sa_prefix
  7583. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7584. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7585. * documentation per RFC3849
  7586. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7587. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7588. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7589. */
  7590. enum htt_ip_da_sa_prefix {
  7591. HTT_RX_IPV6_20010db8,
  7592. HTT_RX_IPV4_MAPPED_IPV6,
  7593. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7594. HTT_RX_IPV6_64FF9B,
  7595. };
  7596. /**
  7597. * @brief Host-->target HTT RX FISA configure and enable
  7598. *
  7599. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7600. *
  7601. * @details
  7602. * The host will send this command down to configure and enable the FISA
  7603. * operational params.
  7604. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7605. * register.
  7606. * Should configure both the MACs.
  7607. *
  7608. * dword0 - b'7:0 - msg_type:
  7609. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7610. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7611. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7612. * pdev's LMAC ring.
  7613. * b'31:16 - reserved : Reserved for future use
  7614. *
  7615. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7616. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7617. * packets. 1 flow search will be skipped
  7618. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7619. * tcp,udp packets
  7620. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7621. * calculation
  7622. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7623. * calculation
  7624. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7625. * calculation
  7626. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7627. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7628. * length
  7629. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7630. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7631. * length
  7632. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7633. * num jump
  7634. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7635. * num jump
  7636. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7637. * data type switch has happened for MPDU Sequence num jump
  7638. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7639. * for MPDU Sequence num jump
  7640. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7641. * for decrypt errors
  7642. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7643. * while aggregating a msdu
  7644. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7645. * The aggregation is done until (number of MSDUs aggregated
  7646. * < LIMIT + 1)
  7647. * b'31:18 - Reserved
  7648. *
  7649. * fisa_control_value - 32bit value FW can write to register
  7650. *
  7651. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7652. * Threshold value for FISA timeout (units are microseconds).
  7653. * When the global timestamp exceeds this threshold, FISA
  7654. * aggregation will be restarted.
  7655. * A value of 0 means timeout is disabled.
  7656. * Compare the threshold register with timestamp field in
  7657. * flow entry to generate timeout for the flow.
  7658. *
  7659. * |31 18 |17 16|15 8|7 0|
  7660. * |-------------------------------------------------------------|
  7661. * | reserved | pdev_mask | msg type |
  7662. * |-------------------------------------------------------------|
  7663. * | reserved | FISA_CTRL |
  7664. * |-------------------------------------------------------------|
  7665. * | FISA_TIMEOUT_THRESH |
  7666. * |-------------------------------------------------------------|
  7667. */
  7668. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7669. A_UINT32 msg_type:8,
  7670. pdev_id:8,
  7671. reserved0:16;
  7672. /**
  7673. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7674. * [17:0]
  7675. */
  7676. union {
  7677. /*
  7678. * fisa_control_bits structure is deprecated.
  7679. * Please use fisa_control_bits_v2 going forward.
  7680. */
  7681. struct {
  7682. A_UINT32 fisa_enable: 1,
  7683. ipsec_skip_search: 1,
  7684. nontcp_skip_search: 1,
  7685. add_ipv4_fixed_hdr_len: 1,
  7686. add_ipv6_fixed_hdr_len: 1,
  7687. add_tcp_fixed_hdr_len: 1,
  7688. add_udp_hdr_len: 1,
  7689. chksum_cum_ip_len_en: 1,
  7690. disable_tid_check: 1,
  7691. disable_ta_check: 1,
  7692. disable_qos_check: 1,
  7693. disable_raw_check: 1,
  7694. disable_decrypt_err_check: 1,
  7695. disable_msdu_drop_check: 1,
  7696. fisa_aggr_limit: 4,
  7697. reserved: 14;
  7698. } fisa_control_bits;
  7699. struct {
  7700. A_UINT32 fisa_enable: 1,
  7701. fisa_aggr_limit: 4,
  7702. reserved: 27;
  7703. } fisa_control_bits_v2;
  7704. A_UINT32 fisa_control_value;
  7705. } u_fisa_control;
  7706. /**
  7707. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7708. * timeout threshold for aggregation. Unit in usec.
  7709. * [31:0]
  7710. */
  7711. A_UINT32 fisa_timeout_threshold;
  7712. } POSTPACK;
  7713. /* DWord 0: pdev-ID */
  7714. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7715. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7716. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7717. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7718. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7719. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7720. do { \
  7721. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7722. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7723. } while (0)
  7724. /* Dword 1: fisa_control_value fisa config */
  7725. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7726. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7727. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7728. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7729. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7730. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7731. do { \
  7732. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7733. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7734. } while (0)
  7735. /* Dword 1: fisa_control_value ipsec_skip_search */
  7736. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7737. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7738. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7739. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7740. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7741. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7742. do { \
  7743. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7744. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7745. } while (0)
  7746. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7747. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7748. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7749. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7750. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7751. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7752. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7753. do { \
  7754. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7755. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7756. } while (0)
  7757. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7758. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7759. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7760. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7761. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7762. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7763. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7764. do { \
  7765. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7766. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7767. } while (0)
  7768. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7769. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7770. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7771. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7772. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7773. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7774. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7775. do { \
  7776. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7777. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7778. } while (0)
  7779. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7780. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7781. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7782. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7783. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7784. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7785. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7786. do { \
  7787. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7788. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7789. } while (0)
  7790. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7791. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7792. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7793. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7794. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7795. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7796. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7797. do { \
  7798. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7799. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7800. } while (0)
  7801. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7802. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7803. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7804. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7805. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7806. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7807. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7808. do { \
  7809. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7810. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7811. } while (0)
  7812. /* Dword 1: fisa_control_value disable_tid_check */
  7813. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7814. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7815. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7816. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7817. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7818. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7819. do { \
  7820. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7821. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7822. } while (0)
  7823. /* Dword 1: fisa_control_value disable_ta_check */
  7824. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7825. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7826. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7827. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7828. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7829. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7830. do { \
  7831. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7832. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7833. } while (0)
  7834. /* Dword 1: fisa_control_value disable_qos_check */
  7835. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7836. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7837. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7838. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7839. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7840. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7841. do { \
  7842. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7843. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7844. } while (0)
  7845. /* Dword 1: fisa_control_value disable_raw_check */
  7846. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7847. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7848. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7849. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7850. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7851. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7852. do { \
  7853. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7854. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7855. } while (0)
  7856. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7857. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7858. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7859. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7860. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7861. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7862. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7863. do { \
  7864. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7865. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7866. } while (0)
  7867. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7868. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7869. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7870. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7871. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7872. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7873. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7874. do { \
  7875. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7876. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7877. } while (0)
  7878. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7879. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7880. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7881. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7882. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7883. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7884. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7885. do { \
  7886. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7887. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7888. } while (0)
  7889. /* Dword 1: fisa_control_value fisa config */
  7890. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7891. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7892. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7893. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7894. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7895. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7896. do { \
  7897. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7898. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7899. } while (0)
  7900. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7901. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7902. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7903. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7904. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7905. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7906. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7907. do { \
  7908. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7909. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7910. } while (0)
  7911. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7912. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7913. pdev_id:8,
  7914. reserved0:16;
  7915. A_UINT32 num_records:20,
  7916. max_search:8,
  7917. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7918. reserved1:2;
  7919. A_UINT32 base_addr_lo;
  7920. A_UINT32 base_addr_hi;
  7921. A_UINT32 toeplitz31_0;
  7922. A_UINT32 toeplitz63_32;
  7923. A_UINT32 toeplitz95_64;
  7924. A_UINT32 toeplitz127_96;
  7925. A_UINT32 toeplitz159_128;
  7926. A_UINT32 toeplitz191_160;
  7927. A_UINT32 toeplitz223_192;
  7928. A_UINT32 toeplitz255_224;
  7929. A_UINT32 toeplitz287_256;
  7930. A_UINT32 toeplitz314_288:27,
  7931. reserved2:5;
  7932. } POSTPACK;
  7933. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7934. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7935. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7936. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7937. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7938. /* DWORD 0: Pdev ID */
  7939. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7940. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7941. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7942. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7943. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7944. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7945. do { \
  7946. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7947. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7948. } while (0)
  7949. /* DWORD 1:num of records */
  7950. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7951. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7952. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7953. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7954. HTT_RX_FSE_SETUP_NUM_REC_S)
  7955. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7956. do { \
  7957. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7958. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7959. } while (0)
  7960. /* DWORD 1:max_search */
  7961. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7962. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7963. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7964. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7965. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7966. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7967. do { \
  7968. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7969. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7970. } while (0)
  7971. /* DWORD 1:ip_da_sa prefix */
  7972. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7973. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7974. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7975. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7976. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7977. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7978. do { \
  7979. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7980. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7981. } while (0)
  7982. /* DWORD 2: Base Address LO */
  7983. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7984. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7985. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7986. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7987. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7988. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7989. do { \
  7990. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7991. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7992. } while (0)
  7993. /* DWORD 3: Base Address High */
  7994. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7995. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7996. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7997. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7998. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7999. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  8000. do { \
  8001. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  8002. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  8003. } while (0)
  8004. /* DWORD 4-12: Hash Value */
  8005. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  8006. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  8007. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  8008. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  8009. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  8010. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  8011. do { \
  8012. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  8013. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  8014. } while (0)
  8015. /* DWORD 13: Hash Value 314:288 bits */
  8016. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  8017. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  8018. HTT_RX_FSE_SETUP_HASH_314_288_S)
  8019. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  8020. do { \
  8021. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  8022. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  8023. } while (0)
  8024. /**
  8025. * @brief Host-->target HTT RX FSE operation message
  8026. *
  8027. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  8028. *
  8029. * @details
  8030. * The host will send this Flow Search Engine (FSE) operation message for
  8031. * every flow add/delete operation.
  8032. * The FSE operation includes FSE full cache invalidation or individual entry
  8033. * invalidation.
  8034. * This message can be sent per SOC or per PDEV which is differentiated
  8035. * by pdev id values.
  8036. *
  8037. * |31 16|15 8|7 1|0|
  8038. * |-------------------------------------------------------------|
  8039. * | reserved | pdev_id | MSG_TYPE |
  8040. * |-------------------------------------------------------------|
  8041. * | reserved | operation |I|
  8042. * |-------------------------------------------------------------|
  8043. * | ip_src_addr_31_0 |
  8044. * |-------------------------------------------------------------|
  8045. * | ip_src_addr_63_32 |
  8046. * |-------------------------------------------------------------|
  8047. * | ip_src_addr_95_64 |
  8048. * |-------------------------------------------------------------|
  8049. * | ip_src_addr_127_96 |
  8050. * |-------------------------------------------------------------|
  8051. * | ip_dst_addr_31_0 |
  8052. * |-------------------------------------------------------------|
  8053. * | ip_dst_addr_63_32 |
  8054. * |-------------------------------------------------------------|
  8055. * | ip_dst_addr_95_64 |
  8056. * |-------------------------------------------------------------|
  8057. * | ip_dst_addr_127_96 |
  8058. * |-------------------------------------------------------------|
  8059. * | l4_dst_port | l4_src_port |
  8060. * | (32-bit SPI incase of IPsec) |
  8061. * |-------------------------------------------------------------|
  8062. * | reserved | l4_proto |
  8063. * |-------------------------------------------------------------|
  8064. *
  8065. * where I is 1-bit ipsec_valid.
  8066. *
  8067. * The following field definitions describe the format of the RX FSE operation
  8068. * message sent from the host to target for every add/delete flow entry to flow
  8069. * table.
  8070. *
  8071. * Header fields:
  8072. * dword0 - b'7:0 - msg_type: This will be set to
  8073. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  8074. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8075. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8076. * specified pdev's LMAC ring.
  8077. * b'31:16 - reserved : Reserved for future use
  8078. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  8079. * (Internet Protocol Security).
  8080. * IPsec describes the framework for providing security at
  8081. * IP layer. IPsec is defined for both versions of IP:
  8082. * IPV4 and IPV6.
  8083. * Please refer to htt_rx_flow_proto enumeration below for
  8084. * more info.
  8085. * ipsec_valid = 1 for IPSEC packets
  8086. * ipsec_valid = 0 for IP Packets
  8087. * b'7:1 - operation: This indicates types of FSE operation.
  8088. * Refer to htt_rx_fse_operation enumeration:
  8089. * 0 - No Cache Invalidation required
  8090. * 1 - Cache invalidate only one entry given by IP
  8091. * src/dest address at DWORD[2:9]
  8092. * 2 - Complete FSE Cache Invalidation
  8093. * 3 - FSE Disable
  8094. * 4 - FSE Enable
  8095. * b'31:8 - reserved: Reserved for future use
  8096. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  8097. * for per flow addition/deletion
  8098. * For IPV4 src/dest addresses, the first A_UINT32 is used
  8099. * and the subsequent 3 A_UINT32 will be padding bytes.
  8100. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  8101. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  8102. * from 0 to 65535 but only 0 to 1023 are designated as
  8103. * well-known ports. Refer to [RFC1700] for more details.
  8104. * This field is valid only if
  8105. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  8106. * - L4 dest port (31:16): 16-bit Destination Port numbers
  8107. * range from 0 to 65535 but only 0 to 1023 are designated
  8108. * as well-known ports. Refer to [RFC1700] for more details.
  8109. * This field is valid only if
  8110. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  8111. * - SPI (31:0): Security Parameters Index is an
  8112. * identification tag added to the header while using IPsec
  8113. * for tunneling the IP traffici.
  8114. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  8115. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  8116. * Assigned Internet Protocol Numbers.
  8117. * l4_proto numbers for standard protocol like UDP/TCP
  8118. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  8119. * l4_proto = 17 for UDP etc.
  8120. * b'31:8 - reserved: Reserved for future use.
  8121. *
  8122. */
  8123. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  8124. A_UINT32 msg_type:8,
  8125. pdev_id:8,
  8126. reserved0:16;
  8127. A_UINT32 ipsec_valid:1,
  8128. operation:7,
  8129. reserved1:24;
  8130. A_UINT32 ip_src_addr_31_0;
  8131. A_UINT32 ip_src_addr_63_32;
  8132. A_UINT32 ip_src_addr_95_64;
  8133. A_UINT32 ip_src_addr_127_96;
  8134. A_UINT32 ip_dest_addr_31_0;
  8135. A_UINT32 ip_dest_addr_63_32;
  8136. A_UINT32 ip_dest_addr_95_64;
  8137. A_UINT32 ip_dest_addr_127_96;
  8138. union {
  8139. A_UINT32 spi;
  8140. struct {
  8141. A_UINT32 l4_src_port:16,
  8142. l4_dest_port:16;
  8143. } ip;
  8144. } u;
  8145. A_UINT32 l4_proto:8,
  8146. reserved:24;
  8147. } POSTPACK;
  8148. /**
  8149. * @brief Host-->target HTT RX Full monitor mode register configuration message
  8150. *
  8151. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  8152. *
  8153. * @details
  8154. * The host will send this Full monitor mode register configuration message.
  8155. * This message can be sent per SOC or per PDEV which is differentiated
  8156. * by pdev id values.
  8157. *
  8158. * |31 16|15 11|10 8|7 3|2|1|0|
  8159. * |-------------------------------------------------------------|
  8160. * | reserved | pdev_id | MSG_TYPE |
  8161. * |-------------------------------------------------------------|
  8162. * | reserved |Release Ring |N|Z|E|
  8163. * |-------------------------------------------------------------|
  8164. *
  8165. * where E is 1-bit full monitor mode enable/disable.
  8166. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  8167. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  8168. *
  8169. * The following field definitions describe the format of the full monitor
  8170. * mode configuration message sent from the host to target for each pdev.
  8171. *
  8172. * Header fields:
  8173. * dword0 - b'7:0 - msg_type: This will be set to
  8174. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  8175. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8176. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8177. * specified pdev's LMAC ring.
  8178. * b'31:16 - reserved : Reserved for future use.
  8179. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  8180. * monitor mode rxdma register is to be enabled or disabled.
  8181. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  8182. * additional descriptors at ppdu end for zero mpdus
  8183. * enabled or disabled.
  8184. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  8185. * additional descriptors at ppdu end for non zero mpdus
  8186. * enabled or disabled.
  8187. * b'10:3 - release_ring: This indicates the destination ring
  8188. * selection for the descriptor at the end of PPDU
  8189. * 0 - REO ring select
  8190. * 1 - FW ring select
  8191. * 2 - SW ring select
  8192. * 3 - Release ring select
  8193. * Refer to htt_rx_full_mon_release_ring.
  8194. * b'31:11 - reserved for future use
  8195. */
  8196. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  8197. A_UINT32 msg_type:8,
  8198. pdev_id:8,
  8199. reserved0:16;
  8200. A_UINT32 full_monitor_mode_enable:1,
  8201. addnl_descs_zero_mpdus_end:1,
  8202. addnl_descs_non_zero_mpdus_end:1,
  8203. release_ring:8,
  8204. reserved1:21;
  8205. } POSTPACK;
  8206. /**
  8207. * Enumeration for full monitor mode destination ring select
  8208. * 0 - REO destination ring select
  8209. * 1 - FW destination ring select
  8210. * 2 - SW destination ring select
  8211. * 3 - Release destination ring select
  8212. */
  8213. enum htt_rx_full_mon_release_ring {
  8214. HTT_RX_MON_RING_REO,
  8215. HTT_RX_MON_RING_FW,
  8216. HTT_RX_MON_RING_SW,
  8217. HTT_RX_MON_RING_RELEASE,
  8218. };
  8219. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  8220. /* DWORD 0: Pdev ID */
  8221. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  8222. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  8223. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  8224. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  8225. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  8226. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  8227. do { \
  8228. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  8229. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  8230. } while (0)
  8231. /* DWORD 1:ENABLE */
  8232. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  8233. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  8234. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  8235. do { \
  8236. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  8237. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  8238. } while (0)
  8239. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  8240. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  8241. /* DWORD 1:ZERO_MPDU */
  8242. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  8243. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  8244. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  8245. do { \
  8246. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  8247. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  8248. } while (0)
  8249. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  8250. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  8251. /* DWORD 1:NON_ZERO_MPDU */
  8252. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  8253. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  8254. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  8255. do { \
  8256. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  8257. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  8258. } while (0)
  8259. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  8260. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  8261. /* DWORD 1:RELEASE_RINGS */
  8262. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  8263. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  8264. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  8265. do { \
  8266. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  8267. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  8268. } while (0)
  8269. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  8270. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  8271. /**
  8272. * Enumeration for IP Protocol or IPSEC Protocol
  8273. * IPsec describes the framework for providing security at IP layer.
  8274. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  8275. */
  8276. enum htt_rx_flow_proto {
  8277. HTT_RX_FLOW_IP_PROTO,
  8278. HTT_RX_FLOW_IPSEC_PROTO,
  8279. };
  8280. /**
  8281. * Enumeration for FSE Cache Invalidation
  8282. * 0 - No Cache Invalidation required
  8283. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8284. * 2 - Complete FSE Cache Invalidation
  8285. * 3 - FSE Disable
  8286. * 4 - FSE Enable
  8287. */
  8288. enum htt_rx_fse_operation {
  8289. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8290. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8291. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8292. HTT_RX_FSE_DISABLE,
  8293. HTT_RX_FSE_ENABLE,
  8294. };
  8295. /* DWORD 0: Pdev ID */
  8296. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8297. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8298. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8299. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8300. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8301. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8302. do { \
  8303. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8304. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8305. } while (0)
  8306. /* DWORD 1:IP PROTO or IPSEC */
  8307. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8308. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8309. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8310. do { \
  8311. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8312. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8313. } while (0)
  8314. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8315. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8316. /* DWORD 1:FSE Operation */
  8317. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8318. #define HTT_RX_FSE_OPERATION_S 1
  8319. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8320. do { \
  8321. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8322. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8323. } while (0)
  8324. #define HTT_RX_FSE_OPERATION_GET(word) \
  8325. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8326. /* DWORD 2-9:IP Address */
  8327. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8328. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8329. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8330. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8331. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8332. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8333. do { \
  8334. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8335. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8336. } while (0)
  8337. /* DWORD 10:Source Port Number */
  8338. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8339. #define HTT_RX_FSE_SOURCEPORT_S 0
  8340. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8341. do { \
  8342. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8343. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8344. } while (0)
  8345. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8346. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8347. /* DWORD 11:Destination Port Number */
  8348. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8349. #define HTT_RX_FSE_DESTPORT_S 16
  8350. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8351. do { \
  8352. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8353. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8354. } while (0)
  8355. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8356. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8357. /* DWORD 10-11:SPI (In case of IPSEC) */
  8358. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8359. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8360. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8361. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8362. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8363. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8364. do { \
  8365. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8366. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8367. } while (0)
  8368. /* DWORD 12:L4 PROTO */
  8369. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8370. #define HTT_RX_FSE_L4_PROTO_S 0
  8371. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8372. do { \
  8373. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8374. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8375. } while (0)
  8376. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8377. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8378. /**
  8379. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8380. *
  8381. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8382. *
  8383. * |31 24|23 |15 8|7 2|1|0|
  8384. * |----------------+----------------+----------------+----------------|
  8385. * | reserved | pdev_id | msg_type |
  8386. * |---------------------------------+----------------+----------------|
  8387. * | reserved |E|F|
  8388. * |---------------------------------+----------------+----------------|
  8389. * Where E = Configure the target to provide the 3-tuple hash value in
  8390. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8391. * F = Configure the target to provide the 3-tuple hash value in
  8392. * flow_id_toeplitz field of rx_msdu_start tlv
  8393. *
  8394. * The following field definitions describe the format of the 3 tuple hash value
  8395. * message sent from the host to target as part of initialization sequence.
  8396. *
  8397. * Header fields:
  8398. * dword0 - b'7:0 - msg_type: This will be set to
  8399. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8400. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8401. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8402. * specified pdev's LMAC ring.
  8403. * b'31:16 - reserved : Reserved for future use
  8404. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8405. * b'1 - toeplitz_hash_2_or_4_field_enable
  8406. * b'31:2 - reserved : Reserved for future use
  8407. * ---------+------+----------------------------------------------------------
  8408. * bit1 | bit0 | Functionality
  8409. * ---------+------+----------------------------------------------------------
  8410. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8411. * | | in flow_id_toeplitz field
  8412. * ---------+------+----------------------------------------------------------
  8413. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8414. * | | in toeplitz_hash_2_or_4 field
  8415. * ---------+------+----------------------------------------------------------
  8416. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8417. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8418. * ---------+------+----------------------------------------------------------
  8419. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8420. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8421. * | | toeplitz_hash_2_or_4 field
  8422. *----------------------------------------------------------------------------
  8423. */
  8424. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8425. A_UINT32 msg_type :8,
  8426. pdev_id :8,
  8427. reserved0 :16;
  8428. A_UINT32 flow_id_toeplitz_field_enable :1,
  8429. toeplitz_hash_2_or_4_field_enable :1,
  8430. reserved1 :30;
  8431. } POSTPACK;
  8432. /* DWORD0 : pdev_id configuration Macros */
  8433. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8434. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8435. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8436. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8437. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8438. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8439. do { \
  8440. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8441. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8442. } while (0)
  8443. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8444. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8445. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8446. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8447. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8448. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8449. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8450. do { \
  8451. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8452. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8453. } while (0)
  8454. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8455. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8456. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8457. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8458. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8459. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8460. do { \
  8461. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8462. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8463. } while (0)
  8464. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8465. /**
  8466. * @brief host --> target Host PA Address Size
  8467. *
  8468. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8469. *
  8470. * @details
  8471. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8472. * provide the physical start address and size of each of the memory
  8473. * areas within host DDR that the target FW may need to access.
  8474. *
  8475. * For example, the host can use this message to allow the target FW
  8476. * to set up access to the host's pools of TQM link descriptors.
  8477. * The message would appear as follows:
  8478. *
  8479. * |31 24|23 16|15 8|7 0|
  8480. * |----------------+----------------+----------------+----------------|
  8481. * | reserved | num_entries | msg_type |
  8482. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8483. * | mem area 0 size |
  8484. * |----------------+----------------+----------------+----------------|
  8485. * | mem area 0 physical_address_lo |
  8486. * |----------------+----------------+----------------+----------------|
  8487. * | mem area 0 physical_address_hi |
  8488. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8489. * | mem area 1 size |
  8490. * |----------------+----------------+----------------+----------------|
  8491. * | mem area 1 physical_address_lo |
  8492. * |----------------+----------------+----------------+----------------|
  8493. * | mem area 1 physical_address_hi |
  8494. * |----------------+----------------+----------------+----------------|
  8495. * ...
  8496. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8497. * | mem area N size |
  8498. * |----------------+----------------+----------------+----------------|
  8499. * | mem area N physical_address_lo |
  8500. * |----------------+----------------+----------------+----------------|
  8501. * | mem area N physical_address_hi |
  8502. * |----------------+----------------+----------------+----------------|
  8503. *
  8504. * The message is interpreted as follows:
  8505. * dword0 - b'0:7 - msg_type: This will be set to
  8506. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8507. * b'8:15 - number_entries: Indicated the number of host memory
  8508. * areas specified within the remainder of the message
  8509. * b'16:31 - reserved.
  8510. * dword1 - b'0:31 - memory area 0 size in bytes
  8511. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8512. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8513. * and similar for memory area 1 through memory area N.
  8514. */
  8515. PREPACK struct htt_h2t_host_paddr_size {
  8516. A_UINT32 msg_type: 8,
  8517. num_entries: 8,
  8518. reserved: 16;
  8519. } POSTPACK;
  8520. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8521. A_UINT32 size;
  8522. A_UINT32 physical_address_lo;
  8523. A_UINT32 physical_address_hi;
  8524. } POSTPACK;
  8525. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE \
  8526. (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8527. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_DWORDS \
  8528. (HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE >> 2)
  8529. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8530. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8531. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8532. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8533. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8534. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8535. do { \
  8536. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8537. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8538. } while (0)
  8539. /**
  8540. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8541. *
  8542. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8543. *
  8544. * @details
  8545. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8546. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8547. *
  8548. * The message would appear as follows:
  8549. *
  8550. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8551. * |---------------------------------+---+---+----------+-+-----------|
  8552. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8553. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8554. *
  8555. *
  8556. * The message is interpreted as follows:
  8557. * dword0 - b'0:7 - msg_type: This will be set to
  8558. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8559. * b'8 - override bit to drive MSDUs to PPE ring
  8560. * b'9:13 - REO destination ring indication
  8561. * b'14 - Multi buffer msdu override enable bit
  8562. * b'15 - Intra BSS override
  8563. * b'16 - Decap raw override
  8564. * b'17 - Decap Native wifi override
  8565. * b'18 - IP frag override
  8566. * b'19:31 - reserved
  8567. */
  8568. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8569. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8570. override: 1,
  8571. reo_destination_indication: 5,
  8572. multi_buffer_msdu_override_en: 1,
  8573. intra_bss_override: 1,
  8574. decap_raw_override: 1,
  8575. decap_nwifi_override: 1,
  8576. ip_frag_override: 1,
  8577. reserved: 13;
  8578. } POSTPACK;
  8579. /* DWORD 0: Override */
  8580. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8581. #define HTT_PPE_CFG_OVERRIDE_S 8
  8582. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8583. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8584. HTT_PPE_CFG_OVERRIDE_S)
  8585. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8586. do { \
  8587. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8588. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8589. } while (0)
  8590. /* DWORD 0: REO Destination Indication*/
  8591. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8592. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8593. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8594. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8595. HTT_PPE_CFG_REO_DEST_IND_S)
  8596. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8597. do { \
  8598. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8599. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8600. } while (0)
  8601. /* DWORD 0: Multi buffer MSDU override */
  8602. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8603. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8604. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8605. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8606. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8607. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8608. do { \
  8609. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8610. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8611. } while (0)
  8612. /* DWORD 0: Intra BSS override */
  8613. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8614. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8615. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8616. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8617. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8618. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8619. do { \
  8620. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8621. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8622. } while (0)
  8623. /* DWORD 0: Decap RAW override */
  8624. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8625. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8626. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8627. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8628. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8629. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8630. do { \
  8631. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8632. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8633. } while (0)
  8634. /* DWORD 0: Decap NWIFI override */
  8635. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8636. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8637. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8638. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8639. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8640. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8641. do { \
  8642. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8643. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8644. } while (0)
  8645. /* DWORD 0: IP frag override */
  8646. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8647. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8648. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8649. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8650. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8651. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8652. do { \
  8653. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8654. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8655. } while (0)
  8656. /*
  8657. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8658. *
  8659. * @details
  8660. * The following field definitions describe the format of the HTT host
  8661. * to target FW VDEV TX RX stats retrieve message.
  8662. * The message specifies the type of stats the host wants to retrieve.
  8663. *
  8664. * |31 27|26 25|24 17|16|15 8|7 0|
  8665. * |-----------------------------------------------------------|
  8666. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8667. * |-----------------------------------------------------------|
  8668. * | vdev_id lower bitmask |
  8669. * |-----------------------------------------------------------|
  8670. * | vdev_id upper bitmask |
  8671. * |-----------------------------------------------------------|
  8672. * Header fields:
  8673. * Where:
  8674. * dword0 - b'7:0 - msg_type: This will be set to
  8675. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8676. * b'15:8 - pdev id
  8677. * b'16(E) - Enable/Disable the vdev HW stats
  8678. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8679. * b'25:26(R) - Reset stats bits
  8680. * 0: don't reset stats
  8681. * 1: reset stats once
  8682. * 2: reset stats at the start of each periodic interval
  8683. * b'27:31 - reserved for future use
  8684. * dword1 - b'0:31 - vdev_id lower bitmask
  8685. * dword2 - b'0:31 - vdev_id upper bitmask
  8686. */
  8687. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8688. A_UINT32 msg_type :8,
  8689. pdev_id :8,
  8690. enable :1,
  8691. periodic_interval :8,
  8692. reset_stats_bits :2,
  8693. reserved0 :5;
  8694. A_UINT32 vdev_id_lower_bitmask;
  8695. A_UINT32 vdev_id_upper_bitmask;
  8696. } POSTPACK;
  8697. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8698. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8699. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8700. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8701. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8702. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8703. do { \
  8704. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8705. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8706. } while (0)
  8707. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8708. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8709. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8710. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8711. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8712. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8713. do { \
  8714. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8715. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8716. } while (0)
  8717. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8718. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8719. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8720. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8721. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8722. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8723. do { \
  8724. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8725. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8726. } while (0)
  8727. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8728. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8729. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8730. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8731. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8732. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8733. do { \
  8734. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8735. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8736. } while (0)
  8737. /*
  8738. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8739. *
  8740. * @details
  8741. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8742. * the default MSDU queues for one of the TIDs within the specified peer
  8743. * to the specified service class.
  8744. * The TID is indirectly specified - each service class is associated
  8745. * with a TID. All default MSDU queues for this peer-TID will be
  8746. * linked to the service class in question.
  8747. *
  8748. * |31 16|15 8|7 0|
  8749. * |------------------------------+--------------+--------------|
  8750. * | peer ID | svc class ID | msg type |
  8751. * |------------------------------------------------------------|
  8752. * Header fields:
  8753. * dword0 - b'7:0 - msg_type: This will be set to
  8754. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8755. * b'15:8 - service class ID
  8756. * b'31:16 - peer ID
  8757. */
  8758. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8759. A_UINT32 msg_type :8,
  8760. svc_class_id :8,
  8761. peer_id :16;
  8762. } POSTPACK;
  8763. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8764. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8765. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8766. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8767. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8768. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8769. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8770. do { \
  8771. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8772. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8773. } while (0)
  8774. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8775. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8776. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8777. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8778. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8779. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8780. do { \
  8781. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8782. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8783. } while (0)
  8784. /*
  8785. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8786. *
  8787. * @details
  8788. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8789. * remove the linkage of the specified peer-TID's MSDU queues to
  8790. * service classes.
  8791. *
  8792. * |31 16|15 8|7 0|
  8793. * |------------------------------+--------------+--------------|
  8794. * | peer ID | svc class ID | msg type |
  8795. * |------------------------------------------------------------|
  8796. * Header fields:
  8797. * dword0 - b'7:0 - msg_type: This will be set to
  8798. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8799. * b'15:8 - service class ID
  8800. * b'31:16 - peer ID
  8801. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8802. * value for peer ID indicates that the target should
  8803. * apply the UNMAP_REQ to all peers.
  8804. */
  8805. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8806. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8807. A_UINT32 msg_type :8,
  8808. svc_class_id :8,
  8809. peer_id :16;
  8810. } POSTPACK;
  8811. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8812. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8813. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8814. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8815. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8816. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8817. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8818. do { \
  8819. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8820. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8821. } while (0)
  8822. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8823. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8824. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8825. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8826. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8827. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8828. do { \
  8829. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8830. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8831. } while (0)
  8832. /*
  8833. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8834. *
  8835. * @details
  8836. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8837. * request the target to report what service class the default MSDU queues
  8838. * of the specified TIDs within the peer are linked to.
  8839. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8840. * to report what service class (if any) the default MSDU queues for
  8841. * each of the specified TIDs are linked to.
  8842. *
  8843. * |31 16|15 8|7 1| 0|
  8844. * |------------------------------+--------------+--------------|
  8845. * | peer ID | TID mask | msg type |
  8846. * |------------------------------------------------------------|
  8847. * | reserved |ETO|
  8848. * |------------------------------------------------------------|
  8849. * Header fields:
  8850. * dword0 - b'7:0 - msg_type: This will be set to
  8851. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8852. * b'15:8 - TID mask
  8853. * b'31:16 - peer ID
  8854. * dword1 - b'0 - "Existing Tids Only" flag
  8855. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8856. * message generated by this REQ will only show the
  8857. * mapping for TIDs that actually exist in the target's
  8858. * peer object.
  8859. * Any TIDs that are covered by a MAP_REQ but which
  8860. * do not actually exist will be shown as being
  8861. * unmapped (i.e. svc class ID 0xff).
  8862. * If this flag is cleared, the MAP_REPORT_CONF message
  8863. * will consider not only the mapping of TIDs currently
  8864. * existing in the peer, but also the mapping that will
  8865. * be applied for any TID objects created within this
  8866. * peer in the future.
  8867. * b'31:1 - reserved for future use
  8868. */
  8869. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8870. A_UINT32 msg_type :8,
  8871. tid_mask :8,
  8872. peer_id :16;
  8873. A_UINT32 existing_tids_only:1,
  8874. reserved :31;
  8875. } POSTPACK;
  8876. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8877. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8878. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8879. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8880. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8881. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8882. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8883. do { \
  8884. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8885. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8886. } while (0)
  8887. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8888. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8889. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8890. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8891. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8892. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8893. do { \
  8894. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8895. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8896. } while (0)
  8897. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8898. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8899. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8900. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8901. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8902. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8903. do { \
  8904. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8905. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8906. } while (0)
  8907. /**
  8908. * @brief Format of shared memory between Host and Target
  8909. * for UMAC hang recovery feature messaging.
  8910. * @details
  8911. * This is shared memory between Host and Target allocated
  8912. * and used in chips where UMAC hang recovery feature is supported.
  8913. * This shared memory is allocated per SOC level by Host since each
  8914. * SOC's target Q6FW needs to communicate independently to the Host
  8915. * through its own shared memory.
  8916. * If target sets a bit in t2h_msg (provided it's valid bit offset)
  8917. * then host interprets it as a new message from target.
  8918. * Host clears that particular read bit in t2h_msg after each read
  8919. * operation. It is vice versa for h2t_msg. At any given point
  8920. * of time there is expected to be only one bit set
  8921. * either in t2h_msg or h2t_msg (referring to valid bit offset).
  8922. *
  8923. * The message is interpreted as follows:
  8924. * dword0 - b'0:31 - magic_num: Magic number for the shared memory region
  8925. * added for debuggability purpose.
  8926. * dword1 - b'0 - do_pre_reset
  8927. * b'1 - do_post_reset_start
  8928. * b'2 - do_post_reset_complete
  8929. * b'3 - initiate_umac_recovery
  8930. * b'4:31 - rsvd_t2h
  8931. * dword2 - b'0 - pre_reset_done
  8932. * b'1 - post_reset_start_done
  8933. * b'2 - post_reset_complete_done
  8934. * b'3 - start_pre_reset
  8935. * b'4:31 - rsvd_h2t
  8936. */
  8937. PREPACK typedef struct {
  8938. /** Magic number added for debuggability. */
  8939. A_UINT32 magic_num;
  8940. union {
  8941. /*
  8942. * BIT [0] :- T2H msg to do pre-reset
  8943. * BIT [1] :- T2H msg to do post-reset start
  8944. * BIT [2] :- T2H msg to do post-reset complete
  8945. * BIT [3] :- T2H msg to initiate UMAC recovery sequence.
  8946. * This is needed to synchronize UMAC recovery
  8947. * across all SOCs.
  8948. * BIT [31 : 4] :- reserved
  8949. */
  8950. A_UINT32 t2h_msg;
  8951. struct {
  8952. A_UINT32 do_pre_reset : 1, /* BIT [0] */
  8953. do_post_reset_start : 1, /* BIT [1] */
  8954. do_post_reset_complete : 1, /* BIT [2] */
  8955. initiate_umac_recovery : 1, /* BIT [3] */
  8956. rsvd_t2h : 28; /* BIT [31 : 4] */
  8957. };
  8958. };
  8959. union {
  8960. /*
  8961. * BIT [0] :- H2T msg to send pre-reset done
  8962. * BIT [1] :- H2T msg to send post-reset start done
  8963. * BIT [2] :- H2T msg to send post-reset complete done
  8964. * BIT [3] :- H2T msg to start pre-reset.
  8965. * This is expected only after T2H
  8966. * initiate_umac_recovery was received by Host
  8967. * from one of the SOCs.
  8968. * BIT [31 : 4] :- reserved
  8969. */
  8970. A_UINT32 h2t_msg;
  8971. struct {
  8972. A_UINT32 pre_reset_done : 1, /* BIT [0] */
  8973. post_reset_start_done : 1, /* BIT [1] */
  8974. post_reset_complete_done : 1, /* BIT [2] */
  8975. start_pre_reset : 1, /* BIT [3] */
  8976. rsvd_h2t : 28; /* BIT [31 : 4] */
  8977. };
  8978. };
  8979. } POSTPACK htt_umac_hang_recovery_msg_shmem_t;
  8980. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES \
  8981. (sizeof(htt_umac_hang_recovery_msg_shmem_t))
  8982. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DWORDS \
  8983. (HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES >> 2)
  8984. /* dword1 - b'0 - do_pre_reset */
  8985. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M 0x00000001
  8986. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S 0
  8987. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_GET(word1) \
  8988. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M) >> \
  8989. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S)
  8990. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_SET(word1, _val) \
  8991. do { \
  8992. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET, _val); \
  8993. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S));\
  8994. } while (0)
  8995. /* dword1 - b'1 - do_post_reset_start */
  8996. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M 0x00000002
  8997. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S 1
  8998. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_GET(word1) \
  8999. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M) >> \
  9000. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S)
  9001. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_SET(word1, _val) \
  9002. do { \
  9003. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START, _val); \
  9004. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S));\
  9005. } while (0)
  9006. /* dword1 - b'2 - do_post_reset_complete */
  9007. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M 0x00000004
  9008. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S 2
  9009. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_GET(word1) \
  9010. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M) >> \
  9011. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S)
  9012. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_SET(word1, _val) \
  9013. do { \
  9014. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE, _val); \
  9015. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S));\
  9016. } while (0)
  9017. /* dword1 - b'3 - initiate_umac_recovery */
  9018. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M 0x00000008
  9019. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S 3
  9020. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_GET(word1) \
  9021. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M) >> \
  9022. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S)
  9023. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_SET(word1, _val) \
  9024. do { \
  9025. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY, _val); \
  9026. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S));\
  9027. } while (0)
  9028. /* dword2 - b'0 - pre_reset_done */
  9029. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M 0x00000001
  9030. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S 0
  9031. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_GET(word2) \
  9032. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M) >> \
  9033. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S)
  9034. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_SET(word2, _val) \
  9035. do { \
  9036. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE, _val); \
  9037. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S));\
  9038. } while (0)
  9039. /* dword2 - b'1 - post_reset_start_done */
  9040. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M 0x00000002
  9041. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S 1
  9042. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_GET(word2) \
  9043. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M) >> \
  9044. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S)
  9045. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_SET(word2, _val) \
  9046. do { \
  9047. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE, _val); \
  9048. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S));\
  9049. } while (0)
  9050. /* dword2 - b'2 - post_reset_complete_done */
  9051. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M 0x00000004
  9052. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S 2
  9053. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_GET(word2) \
  9054. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M) >> \
  9055. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S)
  9056. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_SET(word2, _val) \
  9057. do { \
  9058. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE, _val); \
  9059. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S));\
  9060. } while (0)
  9061. /* dword2 - b'3 - start_pre_reset */
  9062. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M 0x00000008
  9063. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S 3
  9064. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_GET(word2) \
  9065. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M) >> \
  9066. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S)
  9067. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_SET(word2, _val) \
  9068. do { \
  9069. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET, _val); \
  9070. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S));\
  9071. } while (0)
  9072. /**
  9073. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message
  9074. *
  9075. * @details
  9076. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message is sent
  9077. * by the host to provide prerequisite info to target for the UMAC hang
  9078. * recovery feature.
  9079. * The info sent in this H2T message are T2H message method, H2T message
  9080. * method, T2H MSI interrupt number and physical start address, size of
  9081. * the shared memory (refers to the shared memory dedicated for messaging
  9082. * between host and target when the DUT is in UMAC hang recovery mode).
  9083. * This H2T message is expected to be only sent if the WMI service bit
  9084. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target.
  9085. *
  9086. * |31 16|15 12|11 8|7 0|
  9087. * |-------------------------------+--------------+--------------+------------|
  9088. * | reserved |h2t msg method|t2h msg method| msg_type |
  9089. * |--------------------------------------------------------------------------|
  9090. * | t2h msi interrupt number |
  9091. * |--------------------------------------------------------------------------|
  9092. * | shared memory area size |
  9093. * |--------------------------------------------------------------------------|
  9094. * | shared memory area physical address low |
  9095. * |--------------------------------------------------------------------------|
  9096. * | shared memory area physical address high |
  9097. * |--------------------------------------------------------------------------|
  9098. *
  9099. * The message is interpreted as follows:
  9100. * dword0 - b'0:7 - msg_type
  9101. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP)
  9102. * b'8:11 - t2h_msg_method: indicates method to be used for
  9103. * T2H communication in UMAC hang recovery mode.
  9104. * Value zero indicates MSI interrupt (default method).
  9105. * Refer to htt_umac_hang_recovery_msg_method enum.
  9106. * b'12:15 - h2t_msg_method: indicates method to be used for
  9107. * H2T communication in UMAC hang recovery mode.
  9108. * Value zero indicates polling by target for this h2t msg
  9109. * during UMAC hang recovery mode.
  9110. * Refer to htt_umac_hang_recovery_msg_method enum.
  9111. * b'16:31 - reserved.
  9112. * dword1 - b'0:31 - t2h_msi_data: MSI data to be used for
  9113. * T2H communication in UMAC hang recovery mode.
  9114. * dword2 - b'0:31 - size: size of shared memory dedicated for messaging
  9115. * only when in UMAC hang recovery mode.
  9116. * This refers to size in bytes.
  9117. * dword3 - b'0:31 - physical_address_lo: lower 32 bit physical address
  9118. * of the shared memory dedicated for messaging only when
  9119. * in UMAC hang recovery mode.
  9120. * dword4 - b'0:31 - physical_address_hi: higher 32 bit physical address
  9121. * of the shared memory dedicated for messaging only when
  9122. * in UMAC hang recovery mode.
  9123. */
  9124. /* t2h_msg_method and h2t_msg_method */
  9125. enum htt_umac_hang_recovery_msg_method {
  9126. htt_umac_hang_recovery_msg_t2h_msi_and_h2t_polling = 0,
  9127. };
  9128. PREPACK typedef struct {
  9129. A_UINT32 msg_type : 8,
  9130. t2h_msg_method : 4,
  9131. h2t_msg_method : 4,
  9132. reserved : 16;
  9133. A_UINT32 t2h_msi_data;
  9134. /* size bytes and physical address of shared memory. */
  9135. struct htt_h2t_host_paddr_size_entry_t msg_shared_mem;
  9136. } POSTPACK htt_h2t_umac_hang_recovery_prerequisite_setup_t;
  9137. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES \
  9138. (sizeof(htt_h2t_umac_hang_recovery_prerequisite_setup_t))
  9139. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_DWORDS \
  9140. (HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES >> 2)
  9141. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M 0x00000F00
  9142. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S 8
  9143. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_GET(word0) \
  9144. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M) >> \
  9145. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S)
  9146. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_SET(word0, _val) \
  9147. do { \
  9148. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD, _val); \
  9149. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S));\
  9150. } while (0)
  9151. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M 0x0000F000
  9152. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S 12
  9153. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_GET(word0) \
  9154. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M) >> \
  9155. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S)
  9156. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_SET(word0, _val) \
  9157. do { \
  9158. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD, _val); \
  9159. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S));\
  9160. } while (0)
  9161. /**
  9162. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET message
  9163. *
  9164. * @details
  9165. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET is a SOC level
  9166. * HTT message sent by the host to indicate that the target needs to start the
  9167. * UMAC hang recovery feature from the point of pre-reset routine.
  9168. * The purpose of this H2T message is to have host synchronize and trigger
  9169. * UMAC recovery across all targets.
  9170. * The info sent in this H2T message is the flag to indicate whether the
  9171. * target needs to execute UMAC-recovery in context of the Initiator or
  9172. * Non-Initiator.
  9173. * This H2T message is expected to be sent as response to the
  9174. * initiate_umac_recovery indication from the Initiator target attached to
  9175. * this same host.
  9176. * This H2T message is expected to be only sent if the WMI service bit
  9177. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target
  9178. * and HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP was sent
  9179. * beforehand.
  9180. *
  9181. * |31 9|8|7 0|
  9182. * |-----------------------------------------------------------|
  9183. * | reserved |I| msg_type |
  9184. * |-----------------------------------------------------------|
  9185. * Where:
  9186. * I = is_initiator
  9187. *
  9188. * The message is interpreted as follows:
  9189. * dword0 - b'0:7 - msg_type
  9190. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET)
  9191. * b'8 - is_initiator: indicates whether the target needs to
  9192. * execute the UMAC-recovery in context of the Initiator or
  9193. * Non-Initiator.
  9194. * The value zero indicates this target is Non-Initiator.
  9195. * b'9:31 - reserved.
  9196. */
  9197. PREPACK typedef struct {
  9198. A_UINT32 msg_type : 8,
  9199. is_initiator : 1,
  9200. reserved : 23;
  9201. } POSTPACK htt_h2t_umac_hang_recovery_start_pre_reset_t;
  9202. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES \
  9203. (sizeof(htt_h2t_umac_hang_recovery_start_pre_reset_t))
  9204. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_DWORDS \
  9205. (HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES >> 2)
  9206. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M 0x00000100
  9207. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S 8
  9208. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_GET(word0) \
  9209. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M) >> \
  9210. HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S)
  9211. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_SET(word0, _val) \
  9212. do { \
  9213. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR, _val); \
  9214. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S));\
  9215. } while (0)
  9216. /*
  9217. * @brief host -> target HTT RX_CCE_SUPER_RULE_SETUP message
  9218. *
  9219. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP
  9220. *
  9221. * @details
  9222. * Host sends RX_CCE_SUPER_RULE setup message to target, in order to request,
  9223. * install or uninstall rx cce super rules to match certain kind of packets
  9224. * with specific parameters. Target sets up HW registers based on setup message
  9225. * and always confirms back to Host.
  9226. *
  9227. * The message would appear as follows:
  9228. * |31 24|23 16|15 8|7 0|
  9229. * |-----------------+-----------------+-----------------+-----------------|
  9230. * | reserved | operation | vdev_id | msg_type |
  9231. * |-----------------------------------------------------------------------|
  9232. * | cce_super_rule_param[0] |
  9233. * |-----------------------------------------------------------------------|
  9234. * | cce_super_rule_param[1] |
  9235. * |-----------------------------------------------------------------------|
  9236. *
  9237. * The message is interpreted as follows:
  9238. * dword0 - b'0:7 - msg_type: This will be set to
  9239. * 0x23 (HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP)
  9240. * b'8:15 - vdev_id: Identify which vdev RX_CCE_SUPER_RULE is for
  9241. * b'16:23 - operation: Identify operation to be taken,
  9242. * 0: HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST
  9243. * 1: HTT_RX_CCE_SUPER_RULE_INSTALL
  9244. * 2: HTT_RX_CCE_SUPER_RULE_RELEASE
  9245. * b'24:31 - reserved
  9246. * dword1~10 - cce_super_rule_param[0]:
  9247. * contains parameters used to setup RX_CCE_SUPER_RULE_0
  9248. * dword11~20 - cce_super_rule_param[1]:
  9249. * contains parameters used to setup RX_CCE_SUPER_RULE_1
  9250. *
  9251. * Each cce_super_rule_param structure would appear as follows:
  9252. * |31 24|23 16|15 8|7 0|
  9253. * |-----------------+-----------------+-----------------+-----------------|
  9254. * |src_ipv6_addr[3] |src_ipv6_addr[2] |src_ipv6_addr[1] |src_ipv6_addr[0] |
  9255. * |/src_ipv4_addr[3]|/src_ipv4_addr[2]|/src_ipv4_addr[1]|/src_ipv4_addr[0]|
  9256. * |-----------------------------------------------------------------------|
  9257. * |src_ipv6_addr[7] |src_ipv6_addr[6] |src_ipv6_addr[5] |src_ipv6_addr[4] |
  9258. * |-----------------------------------------------------------------------|
  9259. * |src_ipv6_addr[11]|src_ipv6_addr[10]|src_ipv6_addr[9] |src_ipv6_addr[8] |
  9260. * |-----------------------------------------------------------------------|
  9261. * |src_ipv6_addr[15]|src_ipv6_addr[14]|src_ipv6_addr[13]|src_ipv6_addr[12]|
  9262. * |-----------------------------------------------------------------------|
  9263. * |dst_ipv6_addr[3] |dst_ipv6_addr[2] |dst_ipv6_addr[1] |dst_ipv6_addr[0] |
  9264. * |/dst_ipv4_addr[3]|/dst_ipv4_addr[2]|/dst_ipv4_addr[1]|/dst_ipv4_addr[0]|
  9265. * |-----------------------------------------------------------------------|
  9266. * |dst_ipv6_addr[7] |dst_ipv6_addr[6] |dst_ipv6_addr[5] |dst_ipv6_addr[4] |
  9267. * |-----------------------------------------------------------------------|
  9268. * |dst_ipv6_addr[11]|dst_ipv6_addr[10]|dst_ipv6_addr[9] |dst_ipv6_addr[8] |
  9269. * |-----------------------------------------------------------------------|
  9270. * |dst_ipv6_addr[15]|dst_ipv6_addr[14]|dst_ipv6_addr[13]|dst_ipv6_addr[12]|
  9271. * |-----------------------------------------------------------------------|
  9272. * | is_valid | l4_type | l3_type |
  9273. * |-----------------------------------------------------------------------|
  9274. * | l4_dst_port | l4_src_port |
  9275. * |-----------------------------------------------------------------------|
  9276. *
  9277. * The cce_super_rule_param[0] structure is interpreted as follows:
  9278. * dword1 - b'0:7 - src_ipv6_addr[0]: b'120:127 of source ipv6 address
  9279. * (or src_ipv4_addr[0]: b'24:31 of source ipv4 address,
  9280. * in case of ipv4)
  9281. * b'8:15 - src_ipv6_addr[1]: b'112:119 of source ipv6 address
  9282. * (or src_ipv4_addr[1]: b'16:23 of source ipv4 address,
  9283. * in case of ipv4)
  9284. * b'16:23 - src_ipv6_addr[2]: b'104:111 of source ipv6 address
  9285. * (or src_ipv4_addr[2]: b'8:15 of source ipv4 address,
  9286. * in case of ipv4)
  9287. * b'24:31 - src_ipv6_addr[3]: b'96:103 of source ipv6 address
  9288. * (or src_ipv4_addr[3]: b'0:7 of source ipv4 address,
  9289. * in case of ipv4)
  9290. * dword2 - b'0:7 - src_ipv6_addr[4]: b'88:95 of source ipv6 address
  9291. * b'8:15 - src_ipv6_addr[5]: b'80:87 of source ipv6 address
  9292. * b'16:23 - src_ipv6_addr[6]: b'72:79 of source ipv6 address
  9293. * b'24:31 - src_ipv6_addr[7]: b'64:71 of source ipv6 address
  9294. * dword3 - b'0:7 - src_ipv6_addr[8]: b'56:63 of source ipv6 address
  9295. * b'8:15 - src_ipv6_addr[9]: b'48:55 of source ipv6 address
  9296. * b'16:23 - src_ipv6_addr[10]: b'40:47 of source ipv6 address
  9297. * b'24:31 - src_ipv6_addr[11]: b'32:39 of source ipv6 address
  9298. * dword4 - b'0:7 - src_ipv6_addr[12]: b'24:31 of source ipv6 address
  9299. * b'8:15 - src_ipv6_addr[13]: b'16:23 of source ipv6 address
  9300. * b'16:23 - src_ipv6_addr[14]: b'8:15 of source ipv6 address
  9301. * b'24:31 - src_ipv6_addr[15]: b'0:7 of source ipv6 address
  9302. * dword5 - b'0:7 - dst_ipv6_addr[0]: b'120:127 of destination ipv6 address
  9303. * (or dst_ipv4_addr[0]: b'24:31 of destination
  9304. * ipv4 address, in case of ipv4)
  9305. * b'8:15 - dst_ipv6_addr[1]: b'112:119 of destination ipv6 address
  9306. * (or dst_ipv4_addr[1]: b'16:23 of destination
  9307. * ipv4 address, in case of ipv4)
  9308. * b'16:23 - dst_ipv6_addr[2]: b'104:111 of destination ipv6 address
  9309. * (or dst_ipv4_addr[2]: b'8:15 of destination
  9310. * ipv4 address, in case of ipv4)
  9311. * b'24:31 - dst_ipv6_addr[3]: b'96:103 of destination ipv6 address
  9312. * (or dst_ipv4_addr[3]: b'0:7 of destination
  9313. * ipv4 address, in case of ipv4)
  9314. * dword6 - b'0:7 - dst_ipv6_addr[4]: b'88:95 of destination ipv6 address
  9315. * b'8:15 - dst_ipv6_addr[5]: b'80:87 of destination ipv6 address
  9316. * b'16:23 - dst_ipv6_addr[6]: b'72:79 of destination ipv6 address
  9317. * b'24:31 - dst_ipv6_addr[7]: b'64:71 of destination ipv6 address
  9318. * dword7 - b'0:7 - dst_ipv6_addr[8]: b'56:63 of destination ipv6 address
  9319. * b'8:15 - dst_ipv6_addr[9]: b'48:55 of destination ipv6 address
  9320. * b'16:23 - dst_ipv6_addr[10]: b'40:47 of destination ipv6 address
  9321. * b'24:31 - dst_ipv6_addr[11]: b'32:39 of destination ipv6 address
  9322. * dword8 - b'0:7 - dst_ipv6_addr[12]: b'24:31 of destination ipv6 address
  9323. * b'8:15 - dst_ipv6_addr[13]: b'16:23 of destination ipv6 address
  9324. * b'16:23 - dst_ipv6_addr[14]: b'8:15 of destination ipv6 address
  9325. * b'24:31 - dst_ipv6_addr[15]: b'0:7 of destination ipv6 address
  9326. * dword9 - b'0:15 - l3_type: type of L3 protocol, indicating L3 protocol used
  9327. * 0x0008: ipv4
  9328. * 0xdd86: ipv6
  9329. * b'16:23 - l4_type: type of L4 protocol, indicating L4 protocol used
  9330. * 6: TCP
  9331. * 17: UDP
  9332. * b'24:31 - is_valid: indicate whether this parameter is valid
  9333. * 0: invalid
  9334. * 1: valid
  9335. * dword10 - b'0:15 - l4_src_port: TCP/UDP source port field
  9336. * b'16:31 - l4_dst_port: TCP/UDP destination port field
  9337. *
  9338. * The cce_super_rule_param[1] structure is similar.
  9339. */
  9340. #define HTT_RX_CCE_SUPER_RULE_SETUP_NUM 2
  9341. enum htt_rx_cce_super_rule_setup_operation {
  9342. HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST = 0,
  9343. HTT_RX_CCE_SUPER_RULE_INSTALL,
  9344. HTT_RX_CCE_SUPER_RULE_RELEASE,
  9345. /* All operation should be before this */
  9346. HTT_RX_CCE_SUPER_RULE_SETUP_INVALID_OPERATION,
  9347. };
  9348. typedef struct {
  9349. union {
  9350. A_UINT8 src_ipv4_addr[4];
  9351. A_UINT8 src_ipv6_addr[16];
  9352. };
  9353. union {
  9354. A_UINT8 dst_ipv4_addr[4];
  9355. A_UINT8 dst_ipv6_addr[16];
  9356. };
  9357. A_UINT32 l3_type: 16,
  9358. l4_type: 8,
  9359. is_valid: 8;
  9360. A_UINT32 l4_src_port: 16,
  9361. l4_dst_port: 16;
  9362. } htt_rx_cce_super_rule_param_t;
  9363. PREPACK struct htt_rx_cce_super_rule_setup_t {
  9364. A_UINT32 msg_type: 8,
  9365. vdev_id: 8,
  9366. operation: 8,
  9367. reserved: 8;
  9368. htt_rx_cce_super_rule_param_t
  9369. cce_super_rule_param[HTT_RX_CCE_SUPER_RULE_SETUP_NUM];
  9370. } POSTPACK;
  9371. #define HTT_RX_CCE_SUPER_RULE_SETUP_SZ \
  9372. (sizeof(struct htt_rx_cce_super_rule_setup_t))
  9373. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_M 0x0000ff00
  9374. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_S 8
  9375. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_GET(_var) \
  9376. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_M) >> \
  9377. HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_S)
  9378. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_SET(_var, _val) \
  9379. do { \
  9380. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID, _val); \
  9381. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_S)); \
  9382. } while (0)
  9383. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_M 0x00ff0000
  9384. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S 16
  9385. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_GET(_var) \
  9386. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_M) >> \
  9387. HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S)
  9388. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_SET(_var, _val) \
  9389. do { \
  9390. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION, _val); \
  9391. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S)); \
  9392. } while (0)
  9393. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_M 0x0000ffff
  9394. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S 0
  9395. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_GET(_var) \
  9396. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_M) >> \
  9397. HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S)
  9398. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_SET(_var, _val) \
  9399. do { \
  9400. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE, _val); \
  9401. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S)); \
  9402. } while (0)
  9403. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_M 0x00ff0000
  9404. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S 16
  9405. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_GET(_var) \
  9406. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_M) >> \
  9407. HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S)
  9408. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_SET(_var, _val) \
  9409. do { \
  9410. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE, _val); \
  9411. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S)); \
  9412. } while (0)
  9413. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_M 0xff000000
  9414. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S 24
  9415. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_GET(_var) \
  9416. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_M) >> \
  9417. HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S)
  9418. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_SET(_var, _val) \
  9419. do { \
  9420. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID, _val); \
  9421. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S)); \
  9422. } while (0)
  9423. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_M 0x0000ffff
  9424. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S 0
  9425. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_GET(_var) \
  9426. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_M) >> \
  9427. HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S)
  9428. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_SET(_var, _val) \
  9429. do { \
  9430. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT, _val); \
  9431. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S)); \
  9432. } while (0)
  9433. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_M 0xffff0000
  9434. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S 16
  9435. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_GET(_var) \
  9436. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_M) >> \
  9437. HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S)
  9438. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_SET(_var, _val) \
  9439. do { \
  9440. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT, _val); \
  9441. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S)); \
  9442. } while (0)
  9443. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV4_ADDR_ARRAY_GET(_ptr, _array) \
  9444. do { \
  9445. A_MEMCPY(_array, _ptr, 4); \
  9446. } while (0)
  9447. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV4_ADDR_ARRAY_SET(_ptr, _array) \
  9448. do { \
  9449. A_MEMCPY(_ptr, _array, 4); \
  9450. } while (0)
  9451. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV6_ADDR_ARRAY_GET(_ptr, _array) \
  9452. do { \
  9453. A_MEMCPY(_array, _ptr, 16); \
  9454. } while (0)
  9455. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV6_ADDR_ARRAY_SET(_ptr, _array) \
  9456. do { \
  9457. A_MEMCPY(_ptr, _array, 16); \
  9458. } while (0)
  9459. /*=== target -> host messages ===============================================*/
  9460. enum htt_t2h_msg_type {
  9461. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  9462. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  9463. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  9464. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  9465. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  9466. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  9467. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  9468. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  9469. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  9470. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  9471. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  9472. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  9473. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  9474. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  9475. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  9476. /* only used for HL, add HTT MSG for HTT CREDIT update */
  9477. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  9478. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  9479. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  9480. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  9481. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  9482. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  9483. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  9484. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  9485. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  9486. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  9487. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  9488. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  9489. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  9490. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  9491. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  9492. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  9493. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  9494. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  9495. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  9496. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  9497. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  9498. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  9499. /* TX_OFFLOAD_DELIVER_IND:
  9500. * Forward the target's locally-generated packets to the host,
  9501. * to provide to the monitor mode interface.
  9502. */
  9503. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  9504. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  9505. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  9506. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  9507. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  9508. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  9509. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  9510. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  9511. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  9512. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  9513. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  9514. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  9515. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  9516. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  9517. HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN = 0x31,
  9518. HTT_T2H_MSG_TYPE_RX_DELBA_EXTN = 0x32,
  9519. HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE = 0x33,
  9520. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND = 0x34,
  9521. HTT_T2H_MSG_TYPE_TEST,
  9522. /* keep this last */
  9523. HTT_T2H_NUM_MSGS
  9524. };
  9525. /*
  9526. * HTT target to host message type -
  9527. * stored in bits 7:0 of the first word of the message
  9528. */
  9529. #define HTT_T2H_MSG_TYPE_M 0xff
  9530. #define HTT_T2H_MSG_TYPE_S 0
  9531. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  9532. do { \
  9533. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  9534. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  9535. } while (0)
  9536. #define HTT_T2H_MSG_TYPE_GET(word) \
  9537. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  9538. /**
  9539. * @brief target -> host version number confirmation message definition
  9540. *
  9541. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  9542. *
  9543. * |31 24|23 16|15 8|7 0|
  9544. * |----------------+----------------+----------------+----------------|
  9545. * | reserved | major number | minor number | msg type |
  9546. * |-------------------------------------------------------------------|
  9547. * : option request TLV (optional) |
  9548. * :...................................................................:
  9549. *
  9550. * The VER_CONF message may consist of a single 4-byte word, or may be
  9551. * extended with TLVs that specify HTT options selected by the target.
  9552. * The following option TLVs may be appended to the VER_CONF message:
  9553. * - LL_BUS_ADDR_SIZE
  9554. * - HL_SUPPRESS_TX_COMPL_IND
  9555. * - MAX_TX_QUEUE_GROUPS
  9556. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  9557. * may be appended to the VER_CONF message (but only one TLV of each type).
  9558. *
  9559. * Header fields:
  9560. * - MSG_TYPE
  9561. * Bits 7:0
  9562. * Purpose: identifies this as a version number confirmation message
  9563. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  9564. * - VER_MINOR
  9565. * Bits 15:8
  9566. * Purpose: Specify the minor number of the HTT message library version
  9567. * in use by the target firmware.
  9568. * The minor number specifies the specific revision within a range
  9569. * of fundamentally compatible HTT message definition revisions.
  9570. * Compatible revisions involve adding new messages or perhaps
  9571. * adding new fields to existing messages, in a backwards-compatible
  9572. * manner.
  9573. * Incompatible revisions involve changing the message type values,
  9574. * or redefining existing messages.
  9575. * Value: minor number
  9576. * - VER_MAJOR
  9577. * Bits 15:8
  9578. * Purpose: Specify the major number of the HTT message library version
  9579. * in use by the target firmware.
  9580. * The major number specifies the family of minor revisions that are
  9581. * fundamentally compatible with each other, but not with prior or
  9582. * later families.
  9583. * Value: major number
  9584. */
  9585. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  9586. #define HTT_VER_CONF_MINOR_S 8
  9587. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  9588. #define HTT_VER_CONF_MAJOR_S 16
  9589. #define HTT_VER_CONF_MINOR_SET(word, value) \
  9590. do { \
  9591. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  9592. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  9593. } while (0)
  9594. #define HTT_VER_CONF_MINOR_GET(word) \
  9595. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  9596. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  9597. do { \
  9598. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  9599. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  9600. } while (0)
  9601. #define HTT_VER_CONF_MAJOR_GET(word) \
  9602. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  9603. #define HTT_VER_CONF_BYTES 4
  9604. /**
  9605. * @brief - target -> host HTT Rx In order indication message
  9606. *
  9607. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  9608. *
  9609. * @details
  9610. *
  9611. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  9612. * |----------------+-------------------+---------------------+---------------|
  9613. * | peer ID | P| F| O| ext TID | msg type |
  9614. * |--------------------------------------------------------------------------|
  9615. * | MSDU count | Reserved | vdev id |
  9616. * |--------------------------------------------------------------------------|
  9617. * | MSDU 0 bus address (bits 31:0) |
  9618. #if HTT_PADDR64
  9619. * | MSDU 0 bus address (bits 63:32) |
  9620. #endif
  9621. * |--------------------------------------------------------------------------|
  9622. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  9623. * |--------------------------------------------------------------------------|
  9624. * | MSDU 1 bus address (bits 31:0) |
  9625. #if HTT_PADDR64
  9626. * | MSDU 1 bus address (bits 63:32) |
  9627. #endif
  9628. * |--------------------------------------------------------------------------|
  9629. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  9630. * |--------------------------------------------------------------------------|
  9631. */
  9632. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  9633. *
  9634. * @details
  9635. * bits
  9636. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  9637. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9638. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  9639. * | | frag | | | | fail |chksum fail|
  9640. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9641. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  9642. */
  9643. struct htt_rx_in_ord_paddr_ind_hdr_t
  9644. {
  9645. A_UINT32 /* word 0 */
  9646. msg_type: 8,
  9647. ext_tid: 5,
  9648. offload: 1,
  9649. frag: 1,
  9650. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  9651. peer_id: 16;
  9652. A_UINT32 /* word 1 */
  9653. vap_id: 8,
  9654. /* NOTE:
  9655. * This reserved_1 field is not truly reserved - certain targets use
  9656. * this field internally to store debug information, and do not zero
  9657. * out the contents of the field before uploading the message to the
  9658. * host. Thus, any host-target communication supported by this field
  9659. * is limited to using values that are never used by the debug
  9660. * information stored by certain targets in the reserved_1 field.
  9661. * In particular, the targets in question don't use the value 0x3
  9662. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  9663. * so this previously-unused value within these bits is available to
  9664. * use as the host / target PKT_CAPTURE_MODE flag.
  9665. */
  9666. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  9667. /* if pkt_capture_mode == 0x3, host should
  9668. * send rx frames to monitor mode interface
  9669. */
  9670. msdu_cnt: 16;
  9671. };
  9672. struct htt_rx_in_ord_paddr_ind_msdu32_t
  9673. {
  9674. A_UINT32 dma_addr;
  9675. A_UINT32
  9676. length: 16,
  9677. fw_desc: 8,
  9678. msdu_info:8;
  9679. };
  9680. struct htt_rx_in_ord_paddr_ind_msdu64_t
  9681. {
  9682. A_UINT32 dma_addr_lo;
  9683. A_UINT32 dma_addr_hi;
  9684. A_UINT32
  9685. length: 16,
  9686. fw_desc: 8,
  9687. msdu_info:8;
  9688. };
  9689. #if HTT_PADDR64
  9690. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  9691. #else
  9692. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  9693. #endif
  9694. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  9695. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  9696. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  9697. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  9698. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  9699. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  9700. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  9701. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  9702. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  9703. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  9704. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  9705. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  9706. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  9707. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  9708. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  9709. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  9710. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  9711. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  9712. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  9713. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  9714. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  9715. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  9716. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  9717. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  9718. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  9719. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  9720. /* for systems using 64-bit format for bus addresses */
  9721. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  9722. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  9723. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  9724. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  9725. /* for systems using 32-bit format for bus addresses */
  9726. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  9727. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  9728. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  9729. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  9730. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  9731. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  9732. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  9733. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  9734. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  9735. do { \
  9736. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  9737. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  9738. } while (0)
  9739. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  9740. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  9741. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  9742. do { \
  9743. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  9744. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  9745. } while (0)
  9746. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  9747. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  9748. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  9749. do { \
  9750. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  9751. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  9752. } while (0)
  9753. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  9754. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  9755. /*
  9756. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  9757. * deliver the rx frames to the monitor mode interface.
  9758. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  9759. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  9760. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  9761. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  9762. */
  9763. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  9764. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  9765. do { \
  9766. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  9767. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  9768. } while (0)
  9769. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  9770. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  9771. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  9772. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  9773. do { \
  9774. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  9775. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  9776. } while (0)
  9777. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  9778. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  9779. /* for systems using 64-bit format for bus addresses */
  9780. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  9781. do { \
  9782. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  9783. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  9784. } while (0)
  9785. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  9786. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  9787. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  9788. do { \
  9789. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  9790. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  9791. } while (0)
  9792. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  9793. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  9794. /* for systems using 32-bit format for bus addresses */
  9795. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  9796. do { \
  9797. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  9798. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  9799. } while (0)
  9800. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  9801. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  9802. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  9803. do { \
  9804. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  9805. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  9806. } while (0)
  9807. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  9808. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  9809. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  9810. do { \
  9811. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  9812. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  9813. } while (0)
  9814. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  9815. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  9816. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  9817. do { \
  9818. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  9819. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  9820. } while (0)
  9821. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  9822. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  9823. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  9824. do { \
  9825. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  9826. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  9827. } while (0)
  9828. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  9829. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  9830. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  9831. do { \
  9832. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  9833. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  9834. } while (0)
  9835. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  9836. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  9837. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  9838. do { \
  9839. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  9840. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  9841. } while (0)
  9842. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  9843. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  9844. /* definitions used within target -> host rx indication message */
  9845. PREPACK struct htt_rx_ind_hdr_prefix_t
  9846. {
  9847. A_UINT32 /* word 0 */
  9848. msg_type: 8,
  9849. ext_tid: 5,
  9850. release_valid: 1,
  9851. flush_valid: 1,
  9852. reserved0: 1,
  9853. peer_id: 16;
  9854. A_UINT32 /* word 1 */
  9855. flush_start_seq_num: 6,
  9856. flush_end_seq_num: 6,
  9857. release_start_seq_num: 6,
  9858. release_end_seq_num: 6,
  9859. num_mpdu_ranges: 8;
  9860. } POSTPACK;
  9861. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  9862. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  9863. #define HTT_TGT_RSSI_INVALID 0x80
  9864. PREPACK struct htt_rx_ppdu_desc_t
  9865. {
  9866. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  9867. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  9868. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  9869. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  9870. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  9871. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  9872. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  9873. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  9874. A_UINT32 /* word 0 */
  9875. rssi_cmb: 8,
  9876. timestamp_submicrosec: 8,
  9877. phy_err_code: 8,
  9878. phy_err: 1,
  9879. legacy_rate: 4,
  9880. legacy_rate_sel: 1,
  9881. end_valid: 1,
  9882. start_valid: 1;
  9883. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  9884. union {
  9885. A_UINT32 /* word 1 */
  9886. rssi0_pri20: 8,
  9887. rssi0_ext20: 8,
  9888. rssi0_ext40: 8,
  9889. rssi0_ext80: 8;
  9890. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  9891. } u0;
  9892. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  9893. union {
  9894. A_UINT32 /* word 2 */
  9895. rssi1_pri20: 8,
  9896. rssi1_ext20: 8,
  9897. rssi1_ext40: 8,
  9898. rssi1_ext80: 8;
  9899. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  9900. } u1;
  9901. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  9902. union {
  9903. A_UINT32 /* word 3 */
  9904. rssi2_pri20: 8,
  9905. rssi2_ext20: 8,
  9906. rssi2_ext40: 8,
  9907. rssi2_ext80: 8;
  9908. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  9909. } u2;
  9910. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  9911. union {
  9912. A_UINT32 /* word 4 */
  9913. rssi3_pri20: 8,
  9914. rssi3_ext20: 8,
  9915. rssi3_ext40: 8,
  9916. rssi3_ext80: 8;
  9917. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  9918. } u3;
  9919. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  9920. A_UINT32 tsf32; /* word 5 */
  9921. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  9922. A_UINT32 timestamp_microsec; /* word 6 */
  9923. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  9924. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  9925. A_UINT32 /* word 7 */
  9926. vht_sig_a1: 24,
  9927. preamble_type: 8;
  9928. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  9929. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  9930. A_UINT32 /* word 8 */
  9931. vht_sig_a2: 24,
  9932. /* sa_ant_matrix
  9933. * For cases where a single rx chain has options to be connected to
  9934. * different rx antennas, show which rx antennas were in use during
  9935. * receipt of a given PPDU.
  9936. * This sa_ant_matrix provides a bitmask of the antennas used while
  9937. * receiving this frame.
  9938. */
  9939. sa_ant_matrix: 8;
  9940. } POSTPACK;
  9941. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  9942. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  9943. PREPACK struct htt_rx_ind_hdr_suffix_t
  9944. {
  9945. A_UINT32 /* word 0 */
  9946. fw_rx_desc_bytes: 16,
  9947. reserved0: 16;
  9948. } POSTPACK;
  9949. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  9950. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  9951. PREPACK struct htt_rx_ind_hdr_t
  9952. {
  9953. struct htt_rx_ind_hdr_prefix_t prefix;
  9954. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  9955. struct htt_rx_ind_hdr_suffix_t suffix;
  9956. } POSTPACK;
  9957. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  9958. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  9959. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  9960. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9961. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9962. /*
  9963. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9964. * the offset into the HTT rx indication message at which the
  9965. * FW rx PPDU descriptor resides
  9966. */
  9967. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9968. /*
  9969. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9970. * the offset into the HTT rx indication message at which the
  9971. * header suffix (FW rx MSDU byte count) resides
  9972. */
  9973. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9974. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9975. /*
  9976. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9977. * the offset into the HTT rx indication message at which the per-MSDU
  9978. * information starts
  9979. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9980. * per-MSDU information portion of the message. The per-MSDU info itself
  9981. * starts at byte 12.
  9982. */
  9983. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9984. /**
  9985. * @brief target -> host rx indication message definition
  9986. *
  9987. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9988. *
  9989. * @details
  9990. * The following field definitions describe the format of the rx indication
  9991. * message sent from the target to the host.
  9992. * The message consists of three major sections:
  9993. * 1. a fixed-length header
  9994. * 2. a variable-length list of firmware rx MSDU descriptors
  9995. * 3. one or more 4-octet MPDU range information elements
  9996. * The fixed length header itself has two sub-sections
  9997. * 1. the message meta-information, including identification of the
  9998. * sender and type of the received data, and a 4-octet flush/release IE
  9999. * 2. the firmware rx PPDU descriptor
  10000. *
  10001. * The format of the message is depicted below.
  10002. * in this depiction, the following abbreviations are used for information
  10003. * elements within the message:
  10004. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  10005. * elements associated with the PPDU start are valid.
  10006. * Specifically, the following fields are valid only if SV is set:
  10007. * RSSI (all variants), L, legacy rate, preamble type, service,
  10008. * VHT-SIG-A
  10009. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  10010. * elements associated with the PPDU end are valid.
  10011. * Specifically, the following fields are valid only if EV is set:
  10012. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  10013. * - L - Legacy rate selector - if legacy rates are used, this flag
  10014. * indicates whether the rate is from a CCK (L == 1) or OFDM
  10015. * (L == 0) PHY.
  10016. * - P - PHY error flag - boolean indication of whether the rx frame had
  10017. * a PHY error
  10018. *
  10019. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  10020. * |----------------+-------------------+---------------------+---------------|
  10021. * | peer ID | |RV|FV| ext TID | msg type |
  10022. * |--------------------------------------------------------------------------|
  10023. * | num | release | release | flush | flush |
  10024. * | MPDU | end | start | end | start |
  10025. * | ranges | seq num | seq num | seq num | seq num |
  10026. * |==========================================================================|
  10027. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  10028. * |V|V| | rate | | | timestamp | RSSI |
  10029. * |--------------------------------------------------------------------------|
  10030. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  10031. * |--------------------------------------------------------------------------|
  10032. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  10033. * |--------------------------------------------------------------------------|
  10034. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  10035. * |--------------------------------------------------------------------------|
  10036. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  10037. * |--------------------------------------------------------------------------|
  10038. * | TSF LSBs |
  10039. * |--------------------------------------------------------------------------|
  10040. * | microsec timestamp |
  10041. * |--------------------------------------------------------------------------|
  10042. * | preamble type | HT-SIG / VHT-SIG-A1 |
  10043. * |--------------------------------------------------------------------------|
  10044. * | service | HT-SIG / VHT-SIG-A2 |
  10045. * |==========================================================================|
  10046. * | reserved | FW rx desc bytes |
  10047. * |--------------------------------------------------------------------------|
  10048. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  10049. * | desc B3 | desc B2 | desc B1 | desc B0 |
  10050. * |--------------------------------------------------------------------------|
  10051. * : : :
  10052. * |--------------------------------------------------------------------------|
  10053. * | alignment | MSDU Rx |
  10054. * | padding | desc Bn |
  10055. * |--------------------------------------------------------------------------|
  10056. * | reserved | MPDU range status | MPDU count |
  10057. * |--------------------------------------------------------------------------|
  10058. * : reserved : MPDU range status : MPDU count :
  10059. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  10060. *
  10061. * Header fields:
  10062. * - MSG_TYPE
  10063. * Bits 7:0
  10064. * Purpose: identifies this as an rx indication message
  10065. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  10066. * - EXT_TID
  10067. * Bits 12:8
  10068. * Purpose: identify the traffic ID of the rx data, including
  10069. * special "extended" TID values for multicast, broadcast, and
  10070. * non-QoS data frames
  10071. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  10072. * - FLUSH_VALID (FV)
  10073. * Bit 13
  10074. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  10075. * is valid
  10076. * Value:
  10077. * 1 -> flush IE is valid and needs to be processed
  10078. * 0 -> flush IE is not valid and should be ignored
  10079. * - REL_VALID (RV)
  10080. * Bit 13
  10081. * Purpose: indicate whether the release IE (start/end sequence numbers)
  10082. * is valid
  10083. * Value:
  10084. * 1 -> release IE is valid and needs to be processed
  10085. * 0 -> release IE is not valid and should be ignored
  10086. * - PEER_ID
  10087. * Bits 31:16
  10088. * Purpose: Identify, by ID, which peer sent the rx data
  10089. * Value: ID of the peer who sent the rx data
  10090. * - FLUSH_SEQ_NUM_START
  10091. * Bits 5:0
  10092. * Purpose: Indicate the start of a series of MPDUs to flush
  10093. * Not all MPDUs within this series are necessarily valid - the host
  10094. * must check each sequence number within this range to see if the
  10095. * corresponding MPDU is actually present.
  10096. * This field is only valid if the FV bit is set.
  10097. * Value:
  10098. * The sequence number for the first MPDUs to check to flush.
  10099. * The sequence number is masked by 0x3f.
  10100. * - FLUSH_SEQ_NUM_END
  10101. * Bits 11:6
  10102. * Purpose: Indicate the end of a series of MPDUs to flush
  10103. * Value:
  10104. * The sequence number one larger than the sequence number of the
  10105. * last MPDU to check to flush.
  10106. * The sequence number is masked by 0x3f.
  10107. * Not all MPDUs within this series are necessarily valid - the host
  10108. * must check each sequence number within this range to see if the
  10109. * corresponding MPDU is actually present.
  10110. * This field is only valid if the FV bit is set.
  10111. * - REL_SEQ_NUM_START
  10112. * Bits 17:12
  10113. * Purpose: Indicate the start of a series of MPDUs to release.
  10114. * All MPDUs within this series are present and valid - the host
  10115. * need not check each sequence number within this range to see if
  10116. * the corresponding MPDU is actually present.
  10117. * This field is only valid if the RV bit is set.
  10118. * Value:
  10119. * The sequence number for the first MPDUs to check to release.
  10120. * The sequence number is masked by 0x3f.
  10121. * - REL_SEQ_NUM_END
  10122. * Bits 23:18
  10123. * Purpose: Indicate the end of a series of MPDUs to release.
  10124. * Value:
  10125. * The sequence number one larger than the sequence number of the
  10126. * last MPDU to check to release.
  10127. * The sequence number is masked by 0x3f.
  10128. * All MPDUs within this series are present and valid - the host
  10129. * need not check each sequence number within this range to see if
  10130. * the corresponding MPDU is actually present.
  10131. * This field is only valid if the RV bit is set.
  10132. * - NUM_MPDU_RANGES
  10133. * Bits 31:24
  10134. * Purpose: Indicate how many ranges of MPDUs are present.
  10135. * Each MPDU range consists of a series of contiguous MPDUs within the
  10136. * rx frame sequence which all have the same MPDU status.
  10137. * Value: 1-63 (typically a small number, like 1-3)
  10138. *
  10139. * Rx PPDU descriptor fields:
  10140. * - RSSI_CMB
  10141. * Bits 7:0
  10142. * Purpose: Combined RSSI from all active rx chains, across the active
  10143. * bandwidth.
  10144. * Value: RSSI dB units w.r.t. noise floor
  10145. * - TIMESTAMP_SUBMICROSEC
  10146. * Bits 15:8
  10147. * Purpose: high-resolution timestamp
  10148. * Value:
  10149. * Sub-microsecond time of PPDU reception.
  10150. * This timestamp ranges from [0,MAC clock MHz).
  10151. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  10152. * to form a high-resolution, large range rx timestamp.
  10153. * - PHY_ERR_CODE
  10154. * Bits 23:16
  10155. * Purpose:
  10156. * If the rx frame processing resulted in a PHY error, indicate what
  10157. * type of rx PHY error occurred.
  10158. * Value:
  10159. * This field is valid if the "P" (PHY_ERR) flag is set.
  10160. * TBD: document/specify the values for this field
  10161. * - PHY_ERR
  10162. * Bit 24
  10163. * Purpose: indicate whether the rx PPDU had a PHY error
  10164. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  10165. * - LEGACY_RATE
  10166. * Bits 28:25
  10167. * Purpose:
  10168. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  10169. * specify which rate was used.
  10170. * Value:
  10171. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  10172. * flag.
  10173. * If LEGACY_RATE_SEL is 0:
  10174. * 0x8: OFDM 48 Mbps
  10175. * 0x9: OFDM 24 Mbps
  10176. * 0xA: OFDM 12 Mbps
  10177. * 0xB: OFDM 6 Mbps
  10178. * 0xC: OFDM 54 Mbps
  10179. * 0xD: OFDM 36 Mbps
  10180. * 0xE: OFDM 18 Mbps
  10181. * 0xF: OFDM 9 Mbps
  10182. * If LEGACY_RATE_SEL is 1:
  10183. * 0x8: CCK 11 Mbps long preamble
  10184. * 0x9: CCK 5.5 Mbps long preamble
  10185. * 0xA: CCK 2 Mbps long preamble
  10186. * 0xB: CCK 1 Mbps long preamble
  10187. * 0xC: CCK 11 Mbps short preamble
  10188. * 0xD: CCK 5.5 Mbps short preamble
  10189. * 0xE: CCK 2 Mbps short preamble
  10190. * - LEGACY_RATE_SEL
  10191. * Bit 29
  10192. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  10193. * Value:
  10194. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  10195. * used a legacy rate.
  10196. * 0 -> OFDM, 1 -> CCK
  10197. * - END_VALID
  10198. * Bit 30
  10199. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  10200. * the start of the PPDU are valid. Specifically, the following
  10201. * fields are only valid if END_VALID is set:
  10202. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  10203. * TIMESTAMP_SUBMICROSEC
  10204. * Value:
  10205. * 0 -> rx PPDU desc end fields are not valid
  10206. * 1 -> rx PPDU desc end fields are valid
  10207. * - START_VALID
  10208. * Bit 31
  10209. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  10210. * the end of the PPDU are valid. Specifically, the following
  10211. * fields are only valid if START_VALID is set:
  10212. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  10213. * VHT-SIG-A
  10214. * Value:
  10215. * 0 -> rx PPDU desc start fields are not valid
  10216. * 1 -> rx PPDU desc start fields are valid
  10217. * - RSSI0_PRI20
  10218. * Bits 7:0
  10219. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  10220. * Value: RSSI dB units w.r.t. noise floor
  10221. *
  10222. * - RSSI0_EXT20
  10223. * Bits 7:0
  10224. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  10225. * (if the rx bandwidth was >= 40 MHz)
  10226. * Value: RSSI dB units w.r.t. noise floor
  10227. * - RSSI0_EXT40
  10228. * Bits 7:0
  10229. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  10230. * (if the rx bandwidth was >= 80 MHz)
  10231. * Value: RSSI dB units w.r.t. noise floor
  10232. * - RSSI0_EXT80
  10233. * Bits 7:0
  10234. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  10235. * (if the rx bandwidth was >= 160 MHz)
  10236. * Value: RSSI dB units w.r.t. noise floor
  10237. *
  10238. * - RSSI1_PRI20
  10239. * Bits 7:0
  10240. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  10241. * Value: RSSI dB units w.r.t. noise floor
  10242. * - RSSI1_EXT20
  10243. * Bits 7:0
  10244. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  10245. * (if the rx bandwidth was >= 40 MHz)
  10246. * Value: RSSI dB units w.r.t. noise floor
  10247. * - RSSI1_EXT40
  10248. * Bits 7:0
  10249. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  10250. * (if the rx bandwidth was >= 80 MHz)
  10251. * Value: RSSI dB units w.r.t. noise floor
  10252. * - RSSI1_EXT80
  10253. * Bits 7:0
  10254. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  10255. * (if the rx bandwidth was >= 160 MHz)
  10256. * Value: RSSI dB units w.r.t. noise floor
  10257. *
  10258. * - RSSI2_PRI20
  10259. * Bits 7:0
  10260. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  10261. * Value: RSSI dB units w.r.t. noise floor
  10262. * - RSSI2_EXT20
  10263. * Bits 7:0
  10264. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  10265. * (if the rx bandwidth was >= 40 MHz)
  10266. * Value: RSSI dB units w.r.t. noise floor
  10267. * - RSSI2_EXT40
  10268. * Bits 7:0
  10269. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  10270. * (if the rx bandwidth was >= 80 MHz)
  10271. * Value: RSSI dB units w.r.t. noise floor
  10272. * - RSSI2_EXT80
  10273. * Bits 7:0
  10274. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  10275. * (if the rx bandwidth was >= 160 MHz)
  10276. * Value: RSSI dB units w.r.t. noise floor
  10277. *
  10278. * - RSSI3_PRI20
  10279. * Bits 7:0
  10280. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  10281. * Value: RSSI dB units w.r.t. noise floor
  10282. * - RSSI3_EXT20
  10283. * Bits 7:0
  10284. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  10285. * (if the rx bandwidth was >= 40 MHz)
  10286. * Value: RSSI dB units w.r.t. noise floor
  10287. * - RSSI3_EXT40
  10288. * Bits 7:0
  10289. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  10290. * (if the rx bandwidth was >= 80 MHz)
  10291. * Value: RSSI dB units w.r.t. noise floor
  10292. * - RSSI3_EXT80
  10293. * Bits 7:0
  10294. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  10295. * (if the rx bandwidth was >= 160 MHz)
  10296. * Value: RSSI dB units w.r.t. noise floor
  10297. *
  10298. * - TSF32
  10299. * Bits 31:0
  10300. * Purpose: specify the time the rx PPDU was received, in TSF units
  10301. * Value: 32 LSBs of the TSF
  10302. * - TIMESTAMP_MICROSEC
  10303. * Bits 31:0
  10304. * Purpose: specify the time the rx PPDU was received, in microsecond units
  10305. * Value: PPDU rx time, in microseconds
  10306. * - VHT_SIG_A1
  10307. * Bits 23:0
  10308. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  10309. * from the rx PPDU
  10310. * Value:
  10311. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10312. * VHT-SIG-A1 data.
  10313. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10314. * first 24 bits of the HT-SIG data.
  10315. * Otherwise, this field is invalid.
  10316. * Refer to the the 802.11 protocol for the definition of the
  10317. * HT-SIG and VHT-SIG-A1 fields
  10318. * - VHT_SIG_A2
  10319. * Bits 23:0
  10320. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  10321. * from the rx PPDU
  10322. * Value:
  10323. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10324. * VHT-SIG-A2 data.
  10325. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10326. * last 24 bits of the HT-SIG data.
  10327. * Otherwise, this field is invalid.
  10328. * Refer to the the 802.11 protocol for the definition of the
  10329. * HT-SIG and VHT-SIG-A2 fields
  10330. * - PREAMBLE_TYPE
  10331. * Bits 31:24
  10332. * Purpose: indicate the PHY format of the received burst
  10333. * Value:
  10334. * 0x4: Legacy (OFDM/CCK)
  10335. * 0x8: HT
  10336. * 0x9: HT with TxBF
  10337. * 0xC: VHT
  10338. * 0xD: VHT with TxBF
  10339. * - SERVICE
  10340. * Bits 31:24
  10341. * Purpose: TBD
  10342. * Value: TBD
  10343. *
  10344. * Rx MSDU descriptor fields:
  10345. * - FW_RX_DESC_BYTES
  10346. * Bits 15:0
  10347. * Purpose: Indicate how many bytes in the Rx indication are used for
  10348. * FW Rx descriptors
  10349. *
  10350. * Payload fields:
  10351. * - MPDU_COUNT
  10352. * Bits 7:0
  10353. * Purpose: Indicate how many sequential MPDUs share the same status.
  10354. * All MPDUs within the indicated list are from the same RA-TA-TID.
  10355. * - MPDU_STATUS
  10356. * Bits 15:8
  10357. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  10358. * received successfully.
  10359. * Value:
  10360. * 0x1: success
  10361. * 0x2: FCS error
  10362. * 0x3: duplicate error
  10363. * 0x4: replay error
  10364. * 0x5: invalid peer
  10365. */
  10366. /* header fields */
  10367. #define HTT_RX_IND_EXT_TID_M 0x1f00
  10368. #define HTT_RX_IND_EXT_TID_S 8
  10369. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  10370. #define HTT_RX_IND_FLUSH_VALID_S 13
  10371. #define HTT_RX_IND_REL_VALID_M 0x4000
  10372. #define HTT_RX_IND_REL_VALID_S 14
  10373. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  10374. #define HTT_RX_IND_PEER_ID_S 16
  10375. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  10376. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  10377. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  10378. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  10379. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  10380. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  10381. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  10382. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  10383. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  10384. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  10385. /* rx PPDU descriptor fields */
  10386. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  10387. #define HTT_RX_IND_RSSI_CMB_S 0
  10388. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  10389. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  10390. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  10391. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  10392. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  10393. #define HTT_RX_IND_PHY_ERR_S 24
  10394. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  10395. #define HTT_RX_IND_LEGACY_RATE_S 25
  10396. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  10397. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  10398. #define HTT_RX_IND_END_VALID_M 0x40000000
  10399. #define HTT_RX_IND_END_VALID_S 30
  10400. #define HTT_RX_IND_START_VALID_M 0x80000000
  10401. #define HTT_RX_IND_START_VALID_S 31
  10402. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  10403. #define HTT_RX_IND_RSSI_PRI20_S 0
  10404. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  10405. #define HTT_RX_IND_RSSI_EXT20_S 8
  10406. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  10407. #define HTT_RX_IND_RSSI_EXT40_S 16
  10408. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  10409. #define HTT_RX_IND_RSSI_EXT80_S 24
  10410. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  10411. #define HTT_RX_IND_VHT_SIG_A1_S 0
  10412. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  10413. #define HTT_RX_IND_VHT_SIG_A2_S 0
  10414. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  10415. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  10416. #define HTT_RX_IND_SERVICE_M 0xff000000
  10417. #define HTT_RX_IND_SERVICE_S 24
  10418. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  10419. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  10420. /* rx MSDU descriptor fields */
  10421. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  10422. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  10423. /* payload fields */
  10424. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  10425. #define HTT_RX_IND_MPDU_COUNT_S 0
  10426. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  10427. #define HTT_RX_IND_MPDU_STATUS_S 8
  10428. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  10429. do { \
  10430. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  10431. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  10432. } while (0)
  10433. #define HTT_RX_IND_EXT_TID_GET(word) \
  10434. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  10435. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  10436. do { \
  10437. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  10438. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  10439. } while (0)
  10440. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  10441. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  10442. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  10443. do { \
  10444. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  10445. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  10446. } while (0)
  10447. #define HTT_RX_IND_REL_VALID_GET(word) \
  10448. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  10449. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  10450. do { \
  10451. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  10452. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  10453. } while (0)
  10454. #define HTT_RX_IND_PEER_ID_GET(word) \
  10455. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  10456. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  10457. do { \
  10458. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  10459. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  10460. } while (0)
  10461. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  10462. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  10463. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  10464. do { \
  10465. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  10466. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  10467. } while (0)
  10468. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  10469. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  10470. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  10471. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  10472. do { \
  10473. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  10474. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  10475. } while (0)
  10476. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  10477. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  10478. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  10479. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  10480. do { \
  10481. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  10482. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  10483. } while (0)
  10484. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  10485. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  10486. HTT_RX_IND_REL_SEQ_NUM_START_S)
  10487. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  10488. do { \
  10489. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  10490. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  10491. } while (0)
  10492. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  10493. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  10494. HTT_RX_IND_REL_SEQ_NUM_END_S)
  10495. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  10496. do { \
  10497. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  10498. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  10499. } while (0)
  10500. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  10501. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  10502. HTT_RX_IND_NUM_MPDU_RANGES_S)
  10503. /* FW rx PPDU descriptor fields */
  10504. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  10505. do { \
  10506. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  10507. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  10508. } while (0)
  10509. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  10510. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  10511. HTT_RX_IND_RSSI_CMB_S)
  10512. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  10513. do { \
  10514. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  10515. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  10516. } while (0)
  10517. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  10518. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  10519. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  10520. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  10521. do { \
  10522. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  10523. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  10524. } while (0)
  10525. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  10526. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  10527. HTT_RX_IND_PHY_ERR_CODE_S)
  10528. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  10529. do { \
  10530. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  10531. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  10532. } while (0)
  10533. #define HTT_RX_IND_PHY_ERR_GET(word) \
  10534. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  10535. HTT_RX_IND_PHY_ERR_S)
  10536. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  10537. do { \
  10538. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  10539. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  10540. } while (0)
  10541. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  10542. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  10543. HTT_RX_IND_LEGACY_RATE_S)
  10544. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  10545. do { \
  10546. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  10547. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  10548. } while (0)
  10549. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  10550. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  10551. HTT_RX_IND_LEGACY_RATE_SEL_S)
  10552. #define HTT_RX_IND_END_VALID_SET(word, value) \
  10553. do { \
  10554. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  10555. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  10556. } while (0)
  10557. #define HTT_RX_IND_END_VALID_GET(word) \
  10558. (((word) & HTT_RX_IND_END_VALID_M) >> \
  10559. HTT_RX_IND_END_VALID_S)
  10560. #define HTT_RX_IND_START_VALID_SET(word, value) \
  10561. do { \
  10562. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  10563. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  10564. } while (0)
  10565. #define HTT_RX_IND_START_VALID_GET(word) \
  10566. (((word) & HTT_RX_IND_START_VALID_M) >> \
  10567. HTT_RX_IND_START_VALID_S)
  10568. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  10569. do { \
  10570. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  10571. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  10572. } while (0)
  10573. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  10574. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  10575. HTT_RX_IND_RSSI_PRI20_S)
  10576. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  10577. do { \
  10578. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  10579. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  10580. } while (0)
  10581. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  10582. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  10583. HTT_RX_IND_RSSI_EXT20_S)
  10584. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  10585. do { \
  10586. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  10587. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  10588. } while (0)
  10589. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  10590. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  10591. HTT_RX_IND_RSSI_EXT40_S)
  10592. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  10593. do { \
  10594. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  10595. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  10596. } while (0)
  10597. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  10598. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  10599. HTT_RX_IND_RSSI_EXT80_S)
  10600. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  10601. do { \
  10602. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  10603. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  10604. } while (0)
  10605. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  10606. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  10607. HTT_RX_IND_VHT_SIG_A1_S)
  10608. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  10609. do { \
  10610. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  10611. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  10612. } while (0)
  10613. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  10614. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  10615. HTT_RX_IND_VHT_SIG_A2_S)
  10616. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  10617. do { \
  10618. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  10619. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  10620. } while (0)
  10621. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  10622. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  10623. HTT_RX_IND_PREAMBLE_TYPE_S)
  10624. #define HTT_RX_IND_SERVICE_SET(word, value) \
  10625. do { \
  10626. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  10627. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  10628. } while (0)
  10629. #define HTT_RX_IND_SERVICE_GET(word) \
  10630. (((word) & HTT_RX_IND_SERVICE_M) >> \
  10631. HTT_RX_IND_SERVICE_S)
  10632. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  10633. do { \
  10634. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  10635. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  10636. } while (0)
  10637. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  10638. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  10639. HTT_RX_IND_SA_ANT_MATRIX_S)
  10640. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  10641. do { \
  10642. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  10643. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  10644. } while (0)
  10645. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  10646. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  10647. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  10648. do { \
  10649. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  10650. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  10651. } while (0)
  10652. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  10653. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  10654. #define HTT_RX_IND_HL_BYTES \
  10655. (HTT_RX_IND_HDR_BYTES + \
  10656. 4 /* single FW rx MSDU descriptor */ + \
  10657. 4 /* single MPDU range information element */)
  10658. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  10659. /* Could we use one macro entry? */
  10660. #define HTT_WORD_SET(word, field, value) \
  10661. do { \
  10662. HTT_CHECK_SET_VAL(field, value); \
  10663. (word) |= ((value) << field ## _S); \
  10664. } while (0)
  10665. #define HTT_WORD_GET(word, field) \
  10666. (((word) & field ## _M) >> field ## _S)
  10667. PREPACK struct hl_htt_rx_ind_base {
  10668. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  10669. } POSTPACK;
  10670. /*
  10671. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  10672. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  10673. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  10674. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  10675. * htt_rx_ind_hl_rx_desc_t.
  10676. */
  10677. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  10678. struct htt_rx_ind_hl_rx_desc_t {
  10679. A_UINT8 ver;
  10680. A_UINT8 len;
  10681. struct {
  10682. A_UINT8
  10683. first_msdu: 1,
  10684. last_msdu: 1,
  10685. c3_failed: 1,
  10686. c4_failed: 1,
  10687. ipv6: 1,
  10688. tcp: 1,
  10689. udp: 1,
  10690. reserved: 1;
  10691. } flags;
  10692. /* NOTE: no reserved space - don't append any new fields here */
  10693. };
  10694. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  10695. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10696. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  10697. #define HTT_RX_IND_HL_RX_DESC_VER 0
  10698. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  10699. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10700. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  10701. #define HTT_RX_IND_HL_FLAG_OFFSET \
  10702. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10703. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  10704. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  10705. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  10706. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  10707. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  10708. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  10709. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  10710. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  10711. /* This structure is used in HL, the basic descriptor information
  10712. * used by host. the structure is translated by FW from HW desc
  10713. * or generated by FW. But in HL monitor mode, the host would use
  10714. * the same structure with LL.
  10715. */
  10716. PREPACK struct hl_htt_rx_desc_base {
  10717. A_UINT32
  10718. seq_num:12,
  10719. encrypted:1,
  10720. chan_info_present:1,
  10721. resv0:2,
  10722. mcast_bcast:1,
  10723. fragment:1,
  10724. key_id_oct:8,
  10725. resv1:6;
  10726. A_UINT32
  10727. pn_31_0;
  10728. union {
  10729. struct {
  10730. A_UINT16 pn_47_32;
  10731. A_UINT16 pn_63_48;
  10732. } pn16;
  10733. A_UINT32 pn_63_32;
  10734. } u0;
  10735. A_UINT32
  10736. pn_95_64;
  10737. A_UINT32
  10738. pn_127_96;
  10739. } POSTPACK;
  10740. /*
  10741. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  10742. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  10743. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  10744. * Please see htt_chan_change_t for description of the fields.
  10745. */
  10746. PREPACK struct htt_chan_info_t
  10747. {
  10748. A_UINT32 primary_chan_center_freq_mhz: 16,
  10749. contig_chan1_center_freq_mhz: 16;
  10750. A_UINT32 contig_chan2_center_freq_mhz: 16,
  10751. phy_mode: 8,
  10752. reserved: 8;
  10753. } POSTPACK;
  10754. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  10755. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  10756. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  10757. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  10758. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  10759. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  10760. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  10761. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  10762. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  10763. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  10764. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  10765. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  10766. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  10767. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  10768. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  10769. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  10770. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  10771. /* Channel information */
  10772. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  10773. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  10774. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  10775. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  10776. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  10777. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  10778. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  10779. #define HTT_CHAN_INFO_PHY_MODE_S 16
  10780. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  10781. do { \
  10782. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  10783. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  10784. } while (0)
  10785. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  10786. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  10787. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  10788. do { \
  10789. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  10790. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  10791. } while (0)
  10792. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  10793. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  10794. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  10795. do { \
  10796. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  10797. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  10798. } while (0)
  10799. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  10800. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  10801. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  10802. do { \
  10803. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  10804. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  10805. } while (0)
  10806. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  10807. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  10808. /*
  10809. * @brief target -> host message definition for FW offloaded pkts
  10810. *
  10811. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  10812. *
  10813. * @details
  10814. * The following field definitions describe the format of the firmware
  10815. * offload deliver message sent from the target to the host.
  10816. *
  10817. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  10818. *
  10819. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  10820. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  10821. * | reserved_1 | msg type |
  10822. * |--------------------------------------------------------------------------|
  10823. * | phy_timestamp_l32 |
  10824. * |--------------------------------------------------------------------------|
  10825. * | WORD2 (see below) |
  10826. * |--------------------------------------------------------------------------|
  10827. * | seqno | framectrl |
  10828. * |--------------------------------------------------------------------------|
  10829. * | reserved_3 | vdev_id | tid_num|
  10830. * |--------------------------------------------------------------------------|
  10831. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  10832. * |--------------------------------------------------------------------------|
  10833. *
  10834. * where:
  10835. * STAT = status
  10836. * F = format (802.3 vs. 802.11)
  10837. *
  10838. * definition for word 2
  10839. *
  10840. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  10841. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  10842. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  10843. * |--------------------------------------------------------------------------|
  10844. *
  10845. * where:
  10846. * PR = preamble
  10847. * BF = beamformed
  10848. */
  10849. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  10850. {
  10851. A_UINT32 /* word 0 */
  10852. msg_type:8, /* [ 7: 0] */
  10853. reserved_1:24; /* [31: 8] */
  10854. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  10855. A_UINT32 /* word 2 */
  10856. /* preamble:
  10857. * 0-OFDM,
  10858. * 1-CCk,
  10859. * 2-HT,
  10860. * 3-VHT
  10861. */
  10862. preamble: 2, /* [1:0] */
  10863. /* mcs:
  10864. * In case of HT preamble interpret
  10865. * MCS along with NSS.
  10866. * Valid values for HT are 0 to 7.
  10867. * HT mcs 0 with NSS 2 is mcs 8.
  10868. * Valid values for VHT are 0 to 9.
  10869. */
  10870. mcs: 4, /* [5:2] */
  10871. /* rate:
  10872. * This is applicable only for
  10873. * CCK and OFDM preamble type
  10874. * rate 0: OFDM 48 Mbps,
  10875. * 1: OFDM 24 Mbps,
  10876. * 2: OFDM 12 Mbps
  10877. * 3: OFDM 6 Mbps
  10878. * 4: OFDM 54 Mbps
  10879. * 5: OFDM 36 Mbps
  10880. * 6: OFDM 18 Mbps
  10881. * 7: OFDM 9 Mbps
  10882. * rate 0: CCK 11 Mbps Long
  10883. * 1: CCK 5.5 Mbps Long
  10884. * 2: CCK 2 Mbps Long
  10885. * 3: CCK 1 Mbps Long
  10886. * 4: CCK 11 Mbps Short
  10887. * 5: CCK 5.5 Mbps Short
  10888. * 6: CCK 2 Mbps Short
  10889. */
  10890. rate : 3, /* [ 8: 6] */
  10891. rssi : 8, /* [16: 9] units=dBm */
  10892. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10893. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10894. stbc : 1, /* [22] */
  10895. sgi : 1, /* [23] */
  10896. ldpc : 1, /* [24] */
  10897. beamformed: 1, /* [25] */
  10898. reserved_2: 6; /* [31:26] */
  10899. A_UINT32 /* word 3 */
  10900. framectrl:16, /* [15: 0] */
  10901. seqno:16; /* [31:16] */
  10902. A_UINT32 /* word 4 */
  10903. tid_num:5, /* [ 4: 0] actual TID number */
  10904. vdev_id:8, /* [12: 5] */
  10905. reserved_3:19; /* [31:13] */
  10906. A_UINT32 /* word 5 */
  10907. /* status:
  10908. * 0: tx_ok
  10909. * 1: retry
  10910. * 2: drop
  10911. * 3: filtered
  10912. * 4: abort
  10913. * 5: tid delete
  10914. * 6: sw abort
  10915. * 7: dropped by peer migration
  10916. */
  10917. status:3, /* [2:0] */
  10918. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  10919. tx_mpdu_bytes:16, /* [19:4] */
  10920. /* Indicates retry count of offloaded/local generated Data tx frames */
  10921. tx_retry_cnt:6, /* [25:20] */
  10922. reserved_4:6; /* [31:26] */
  10923. } POSTPACK;
  10924. /* FW offload deliver ind message header fields */
  10925. /* DWORD one */
  10926. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  10927. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  10928. /* DWORD two */
  10929. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  10930. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  10931. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  10932. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  10933. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  10934. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  10935. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  10936. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  10937. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  10938. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  10939. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  10940. #define HTT_FW_OFFLOAD_IND_BW_S 19
  10941. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  10942. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  10943. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  10944. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  10945. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  10946. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  10947. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  10948. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  10949. /* DWORD three*/
  10950. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  10951. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  10952. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  10953. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  10954. /* DWORD four */
  10955. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  10956. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  10957. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  10958. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  10959. /* DWORD five */
  10960. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10961. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10962. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10963. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10964. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10965. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10966. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10967. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10968. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10969. do { \
  10970. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10971. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10972. } while (0)
  10973. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10974. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10975. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10976. do { \
  10977. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10978. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10979. } while (0)
  10980. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10981. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10982. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10983. do { \
  10984. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10985. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10986. } while (0)
  10987. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10988. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10989. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10990. do { \
  10991. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10992. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10993. } while (0)
  10994. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10995. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  10996. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  10997. do { \
  10998. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  10999. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  11000. } while (0)
  11001. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  11002. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  11003. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  11004. do { \
  11005. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  11006. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  11007. } while (0)
  11008. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  11009. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  11010. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  11011. do { \
  11012. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  11013. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  11014. } while (0)
  11015. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  11016. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  11017. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  11018. do { \
  11019. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  11020. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  11021. } while (0)
  11022. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  11023. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  11024. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  11025. do { \
  11026. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  11027. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  11028. } while (0)
  11029. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  11030. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  11031. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  11032. do { \
  11033. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  11034. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  11035. } while (0)
  11036. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  11037. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  11038. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  11039. do { \
  11040. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  11041. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  11042. } while (0)
  11043. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  11044. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  11045. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  11046. do { \
  11047. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  11048. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  11049. } while (0)
  11050. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  11051. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  11052. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  11053. do { \
  11054. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  11055. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  11056. } while (0)
  11057. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  11058. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  11059. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  11060. do { \
  11061. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  11062. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  11063. } while (0)
  11064. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  11065. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  11066. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  11067. do { \
  11068. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  11069. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  11070. } while (0)
  11071. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  11072. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  11073. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  11074. do { \
  11075. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  11076. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  11077. } while (0)
  11078. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  11079. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  11080. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  11081. do { \
  11082. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  11083. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  11084. } while (0)
  11085. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  11086. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  11087. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  11088. do { \
  11089. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  11090. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  11091. } while (0)
  11092. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  11093. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  11094. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  11095. do { \
  11096. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  11097. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  11098. } while (0)
  11099. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  11100. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  11101. /*
  11102. * @brief target -> host rx reorder flush message definition
  11103. *
  11104. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  11105. *
  11106. * @details
  11107. * The following field definitions describe the format of the rx flush
  11108. * message sent from the target to the host.
  11109. * The message consists of a 4-octet header, followed by one or more
  11110. * 4-octet payload information elements.
  11111. *
  11112. * |31 24|23 8|7 0|
  11113. * |--------------------------------------------------------------|
  11114. * | TID | peer ID | msg type |
  11115. * |--------------------------------------------------------------|
  11116. * | seq num end | seq num start | MPDU status | reserved |
  11117. * |--------------------------------------------------------------|
  11118. * First DWORD:
  11119. * - MSG_TYPE
  11120. * Bits 7:0
  11121. * Purpose: identifies this as an rx flush message
  11122. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  11123. * - PEER_ID
  11124. * Bits 23:8 (only bits 18:8 actually used)
  11125. * Purpose: identify which peer's rx data is being flushed
  11126. * Value: (rx) peer ID
  11127. * - TID
  11128. * Bits 31:24 (only bits 27:24 actually used)
  11129. * Purpose: Specifies which traffic identifier's rx data is being flushed
  11130. * Value: traffic identifier
  11131. * Second DWORD:
  11132. * - MPDU_STATUS
  11133. * Bits 15:8
  11134. * Purpose:
  11135. * Indicate whether the flushed MPDUs should be discarded or processed.
  11136. * Value:
  11137. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  11138. * stages of rx processing
  11139. * other: discard the MPDUs
  11140. * It is anticipated that flush messages will always have
  11141. * MPDU status == 1, but the status flag is included for
  11142. * flexibility.
  11143. * - SEQ_NUM_START
  11144. * Bits 23:16
  11145. * Purpose:
  11146. * Indicate the start of a series of consecutive MPDUs being flushed.
  11147. * Not all MPDUs within this range are necessarily valid - the host
  11148. * must check each sequence number within this range to see if the
  11149. * corresponding MPDU is actually present.
  11150. * Value:
  11151. * The sequence number for the first MPDU in the sequence.
  11152. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11153. * - SEQ_NUM_END
  11154. * Bits 30:24
  11155. * Purpose:
  11156. * Indicate the end of a series of consecutive MPDUs being flushed.
  11157. * Value:
  11158. * The sequence number one larger than the sequence number of the
  11159. * last MPDU being flushed.
  11160. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11161. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  11162. * are to be released for further rx processing.
  11163. * Not all MPDUs within this range are necessarily valid - the host
  11164. * must check each sequence number within this range to see if the
  11165. * corresponding MPDU is actually present.
  11166. */
  11167. /* first DWORD */
  11168. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  11169. #define HTT_RX_FLUSH_PEER_ID_S 8
  11170. #define HTT_RX_FLUSH_TID_M 0xff000000
  11171. #define HTT_RX_FLUSH_TID_S 24
  11172. /* second DWORD */
  11173. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  11174. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  11175. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  11176. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  11177. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  11178. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  11179. #define HTT_RX_FLUSH_BYTES 8
  11180. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  11181. do { \
  11182. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  11183. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  11184. } while (0)
  11185. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  11186. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  11187. #define HTT_RX_FLUSH_TID_SET(word, value) \
  11188. do { \
  11189. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  11190. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  11191. } while (0)
  11192. #define HTT_RX_FLUSH_TID_GET(word) \
  11193. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  11194. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  11195. do { \
  11196. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  11197. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  11198. } while (0)
  11199. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  11200. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  11201. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  11202. do { \
  11203. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  11204. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  11205. } while (0)
  11206. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  11207. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  11208. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  11209. do { \
  11210. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  11211. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  11212. } while (0)
  11213. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  11214. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  11215. /*
  11216. * @brief target -> host rx pn check indication message
  11217. *
  11218. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  11219. *
  11220. * @details
  11221. * The following field definitions describe the format of the Rx PN check
  11222. * indication message sent from the target to the host.
  11223. * The message consists of a 4-octet header, followed by the start and
  11224. * end sequence numbers to be released, followed by the PN IEs. Each PN
  11225. * IE is one octet containing the sequence number that failed the PN
  11226. * check.
  11227. *
  11228. * |31 24|23 8|7 0|
  11229. * |--------------------------------------------------------------|
  11230. * | TID | peer ID | msg type |
  11231. * |--------------------------------------------------------------|
  11232. * | Reserved | PN IE count | seq num end | seq num start|
  11233. * |--------------------------------------------------------------|
  11234. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  11235. * |--------------------------------------------------------------|
  11236. * First DWORD:
  11237. * - MSG_TYPE
  11238. * Bits 7:0
  11239. * Purpose: Identifies this as an rx pn check indication message
  11240. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  11241. * - PEER_ID
  11242. * Bits 23:8 (only bits 18:8 actually used)
  11243. * Purpose: identify which peer
  11244. * Value: (rx) peer ID
  11245. * - TID
  11246. * Bits 31:24 (only bits 27:24 actually used)
  11247. * Purpose: identify traffic identifier
  11248. * Value: traffic identifier
  11249. * Second DWORD:
  11250. * - SEQ_NUM_START
  11251. * Bits 7:0
  11252. * Purpose:
  11253. * Indicates the starting sequence number of the MPDU in this
  11254. * series of MPDUs that went though PN check.
  11255. * Value:
  11256. * The sequence number for the first MPDU in the sequence.
  11257. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11258. * - SEQ_NUM_END
  11259. * Bits 15:8
  11260. * Purpose:
  11261. * Indicates the ending sequence number of the MPDU in this
  11262. * series of MPDUs that went though PN check.
  11263. * Value:
  11264. * The sequence number one larger then the sequence number of the last
  11265. * MPDU being flushed.
  11266. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11267. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  11268. * for invalid PN numbers and are ready to be released for further processing.
  11269. * Not all MPDUs within this range are necessarily valid - the host
  11270. * must check each sequence number within this range to see if the
  11271. * corresponding MPDU is actually present.
  11272. * - PN_IE_COUNT
  11273. * Bits 23:16
  11274. * Purpose:
  11275. * Used to determine the variable number of PN information elements in this
  11276. * message
  11277. *
  11278. * PN information elements:
  11279. * - PN_IE_x-
  11280. * Purpose:
  11281. * Each PN information element contains the sequence number of the MPDU that
  11282. * has failed the target PN check.
  11283. * Value:
  11284. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  11285. * that failed the PN check.
  11286. */
  11287. /* first DWORD */
  11288. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  11289. #define HTT_RX_PN_IND_PEER_ID_S 8
  11290. #define HTT_RX_PN_IND_TID_M 0xff000000
  11291. #define HTT_RX_PN_IND_TID_S 24
  11292. /* second DWORD */
  11293. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  11294. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  11295. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  11296. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  11297. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  11298. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  11299. #define HTT_RX_PN_IND_BYTES 8
  11300. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  11301. do { \
  11302. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  11303. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  11304. } while (0)
  11305. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  11306. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  11307. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  11308. do { \
  11309. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  11310. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  11311. } while (0)
  11312. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  11313. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  11314. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  11315. do { \
  11316. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  11317. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  11318. } while (0)
  11319. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  11320. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  11321. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  11322. do { \
  11323. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  11324. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  11325. } while (0)
  11326. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  11327. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  11328. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  11329. do { \
  11330. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  11331. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  11332. } while (0)
  11333. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  11334. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  11335. /*
  11336. * @brief target -> host rx offload deliver message for LL system
  11337. *
  11338. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  11339. *
  11340. * @details
  11341. * In a low latency system this message is sent whenever the offload
  11342. * manager flushes out the packets it has coalesced in its coalescing buffer.
  11343. * The DMA of the actual packets into host memory is done before sending out
  11344. * this message. This message indicates only how many MSDUs to reap. The
  11345. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  11346. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  11347. * DMA'd by the MAC directly into host memory these packets do not contain
  11348. * the MAC descriptors in the header portion of the packet. Instead they contain
  11349. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  11350. * message, the packets are delivered directly to the NW stack without going
  11351. * through the regular reorder buffering and PN checking path since it has
  11352. * already been done in target.
  11353. *
  11354. * |31 24|23 16|15 8|7 0|
  11355. * |-----------------------------------------------------------------------|
  11356. * | Total MSDU count | reserved | msg type |
  11357. * |-----------------------------------------------------------------------|
  11358. *
  11359. * @brief target -> host rx offload deliver message for HL system
  11360. *
  11361. * @details
  11362. * In a high latency system this message is sent whenever the offload manager
  11363. * flushes out the packets it has coalesced in its coalescing buffer. The
  11364. * actual packets are also carried along with this message. When the host
  11365. * receives this message, it is expected to deliver these packets to the NW
  11366. * stack directly instead of routing them through the reorder buffering and
  11367. * PN checking path since it has already been done in target.
  11368. *
  11369. * |31 24|23 16|15 8|7 0|
  11370. * |-----------------------------------------------------------------------|
  11371. * | Total MSDU count | reserved | msg type |
  11372. * |-----------------------------------------------------------------------|
  11373. * | peer ID | MSDU length |
  11374. * |-----------------------------------------------------------------------|
  11375. * | MSDU payload | FW Desc | tid | vdev ID |
  11376. * |-----------------------------------------------------------------------|
  11377. * | MSDU payload contd. |
  11378. * |-----------------------------------------------------------------------|
  11379. * | peer ID | MSDU length |
  11380. * |-----------------------------------------------------------------------|
  11381. * | MSDU payload | FW Desc | tid | vdev ID |
  11382. * |-----------------------------------------------------------------------|
  11383. * | MSDU payload contd. |
  11384. * |-----------------------------------------------------------------------|
  11385. *
  11386. */
  11387. /* first DWORD */
  11388. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  11389. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  11390. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  11391. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  11392. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  11393. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  11394. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  11395. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  11396. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  11397. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  11398. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  11399. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  11400. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  11401. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  11402. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  11403. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  11404. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  11405. do { \
  11406. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  11407. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  11408. } while (0)
  11409. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  11410. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  11411. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  11412. do { \
  11413. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  11414. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  11415. } while (0)
  11416. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  11417. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  11418. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  11419. do { \
  11420. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  11421. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  11422. } while (0)
  11423. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  11424. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  11425. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  11426. do { \
  11427. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  11428. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  11429. } while (0)
  11430. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  11431. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  11432. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  11433. do { \
  11434. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  11435. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  11436. } while (0)
  11437. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  11438. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  11439. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  11440. do { \
  11441. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  11442. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  11443. } while (0)
  11444. /**
  11445. * @brief target -> host rx peer map/unmap message definition
  11446. *
  11447. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  11448. *
  11449. * @details
  11450. * The following diagram shows the format of the rx peer map message sent
  11451. * from the target to the host. This layout assumes the target operates
  11452. * as little-endian.
  11453. *
  11454. * This message always contains a SW peer ID. The main purpose of the
  11455. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11456. * with, so that the host can use that peer ID to determine which peer
  11457. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11458. * other purposes, such as identifying during tx completions which peer
  11459. * the tx frames in question were transmitted to.
  11460. *
  11461. * In certain generations of chips, the peer map message also contains
  11462. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  11463. * to identify which peer the frame needs to be forwarded to (i.e. the
  11464. * peer associated with the Destination MAC Address within the packet),
  11465. * and particularly which vdev needs to transmit the frame (for cases
  11466. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  11467. * meaning as AST_INDEX_0.
  11468. * This DA-based peer ID that is provided for certain rx frames
  11469. * (the rx frames that need to be re-transmitted as tx frames)
  11470. * is the ID that the HW uses for referring to the peer in question,
  11471. * rather than the peer ID that the SW+FW use to refer to the peer.
  11472. *
  11473. *
  11474. * |31 24|23 16|15 8|7 0|
  11475. * |-----------------------------------------------------------------------|
  11476. * | SW peer ID | VDEV ID | msg type |
  11477. * |-----------------------------------------------------------------------|
  11478. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11479. * |-----------------------------------------------------------------------|
  11480. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11481. * |-----------------------------------------------------------------------|
  11482. *
  11483. *
  11484. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  11485. *
  11486. * The following diagram shows the format of the rx peer unmap message sent
  11487. * from the target to the host.
  11488. *
  11489. * |31 24|23 16|15 8|7 0|
  11490. * |-----------------------------------------------------------------------|
  11491. * | SW peer ID | VDEV ID | msg type |
  11492. * |-----------------------------------------------------------------------|
  11493. *
  11494. * The following field definitions describe the format of the rx peer map
  11495. * and peer unmap messages sent from the target to the host.
  11496. * - MSG_TYPE
  11497. * Bits 7:0
  11498. * Purpose: identifies this as an rx peer map or peer unmap message
  11499. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  11500. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  11501. * - VDEV_ID
  11502. * Bits 15:8
  11503. * Purpose: Indicates which virtual device the peer is associated
  11504. * with.
  11505. * Value: vdev ID (used in the host to look up the vdev object)
  11506. * - PEER_ID (a.k.a. SW_PEER_ID)
  11507. * Bits 31:16
  11508. * Purpose: The peer ID (index) that WAL is allocating (map) or
  11509. * freeing (unmap)
  11510. * Value: (rx) peer ID
  11511. * - MAC_ADDR_L32 (peer map only)
  11512. * Bits 31:0
  11513. * Purpose: Identifies which peer node the peer ID is for.
  11514. * Value: lower 4 bytes of peer node's MAC address
  11515. * - MAC_ADDR_U16 (peer map only)
  11516. * Bits 15:0
  11517. * Purpose: Identifies which peer node the peer ID is for.
  11518. * Value: upper 2 bytes of peer node's MAC address
  11519. * - HW_PEER_ID
  11520. * Bits 31:16
  11521. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11522. * address, so for rx frames marked for rx --> tx forwarding, the
  11523. * host can determine from the HW peer ID provided as meta-data with
  11524. * the rx frame which peer the frame is supposed to be forwarded to.
  11525. * Value: ID used by the MAC HW to identify the peer
  11526. */
  11527. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  11528. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  11529. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  11530. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  11531. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  11532. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  11533. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11534. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  11535. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  11536. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  11537. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  11538. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  11539. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  11540. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  11541. do { \
  11542. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  11543. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  11544. } while (0)
  11545. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  11546. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  11547. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  11548. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  11549. do { \
  11550. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  11551. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  11552. } while (0)
  11553. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  11554. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  11555. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  11556. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  11557. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  11558. do { \
  11559. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  11560. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  11561. } while (0)
  11562. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  11563. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  11564. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11565. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  11566. #define HTT_RX_PEER_MAP_BYTES 12
  11567. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  11568. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  11569. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  11570. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  11571. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  11572. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  11573. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  11574. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  11575. #define HTT_RX_PEER_UNMAP_BYTES 4
  11576. /**
  11577. * @brief target -> host rx peer map V2 message definition
  11578. *
  11579. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  11580. *
  11581. * @details
  11582. * The following diagram shows the format of the rx peer map v2 message sent
  11583. * from the target to the host. This layout assumes the target operates
  11584. * as little-endian.
  11585. *
  11586. * This message always contains a SW peer ID. The main purpose of the
  11587. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11588. * with, so that the host can use that peer ID to determine which peer
  11589. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11590. * other purposes, such as identifying during tx completions which peer
  11591. * the tx frames in question were transmitted to.
  11592. *
  11593. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  11594. * is used during rx --> tx frame forwarding to identify which peer the
  11595. * frame needs to be forwarded to (i.e. the peer associated with the
  11596. * Destination MAC Address within the packet), and particularly which vdev
  11597. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  11598. * This DA-based peer ID that is provided for certain rx frames
  11599. * (the rx frames that need to be re-transmitted as tx frames)
  11600. * is the ID that the HW uses for referring to the peer in question,
  11601. * rather than the peer ID that the SW+FW use to refer to the peer.
  11602. *
  11603. * The HW peer id here is the same meaning as AST_INDEX_0.
  11604. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  11605. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  11606. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  11607. * AST is valid.
  11608. *
  11609. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  11610. * |-------------------------------------------------------------------------|
  11611. * | SW peer ID | VDEV ID | msg type |
  11612. * |-------------------------------------------------------------------------|
  11613. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11614. * |-------------------------------------------------------------------------|
  11615. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11616. * |-------------------------------------------------------------------------|
  11617. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  11618. * |-------------------------------------------------------------------------|
  11619. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  11620. * |-------------------------------------------------------------------------|
  11621. * |TID valid low pri| TID valid hi pri | AST index 2 |
  11622. * |-------------------------------------------------------------------------|
  11623. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  11624. * |-------------------------------------------------------------------------|
  11625. * | Reserved_2 |
  11626. * |-------------------------------------------------------------------------|
  11627. * Where:
  11628. * NH = Next Hop
  11629. * ASTVM = AST valid mask
  11630. * OA = on-chip AST valid bit
  11631. * ASTFM = AST flow mask
  11632. *
  11633. * The following field definitions describe the format of the rx peer map v2
  11634. * messages sent from the target to the host.
  11635. * - MSG_TYPE
  11636. * Bits 7:0
  11637. * Purpose: identifies this as an rx peer map v2 message
  11638. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  11639. * - VDEV_ID
  11640. * Bits 15:8
  11641. * Purpose: Indicates which virtual device the peer is associated with.
  11642. * Value: vdev ID (used in the host to look up the vdev object)
  11643. * - SW_PEER_ID
  11644. * Bits 31:16
  11645. * Purpose: The peer ID (index) that WAL is allocating
  11646. * Value: (rx) peer ID
  11647. * - MAC_ADDR_L32
  11648. * Bits 31:0
  11649. * Purpose: Identifies which peer node the peer ID is for.
  11650. * Value: lower 4 bytes of peer node's MAC address
  11651. * - MAC_ADDR_U16
  11652. * Bits 15:0
  11653. * Purpose: Identifies which peer node the peer ID is for.
  11654. * Value: upper 2 bytes of peer node's MAC address
  11655. * - HW_PEER_ID / AST_INDEX_0
  11656. * Bits 31:16
  11657. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11658. * address, so for rx frames marked for rx --> tx forwarding, the
  11659. * host can determine from the HW peer ID provided as meta-data with
  11660. * the rx frame which peer the frame is supposed to be forwarded to.
  11661. * Value: ID used by the MAC HW to identify the peer
  11662. * - AST_HASH_VALUE
  11663. * Bits 15:0
  11664. * Purpose: Indicates AST Hash value is required for the TCL AST index
  11665. * override feature.
  11666. * - NEXT_HOP
  11667. * Bit 16
  11668. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  11669. * (Wireless Distribution System).
  11670. * - AST_VALID_MASK
  11671. * Bits 19:17
  11672. * Purpose: Indicate if the AST 1 through AST 3 are valid
  11673. * - ONCHIP_AST_VALID_FLAG
  11674. * Bit 20
  11675. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  11676. * is valid.
  11677. * - AST_INDEX_1
  11678. * Bits 15:0
  11679. * Purpose: indicate the second AST index for this peer
  11680. * - AST_0_FLOW_MASK
  11681. * Bits 19:16
  11682. * Purpose: identify the which flow the AST 0 entry corresponds to.
  11683. * - AST_1_FLOW_MASK
  11684. * Bits 23:20
  11685. * Purpose: identify the which flow the AST 1 entry corresponds to.
  11686. * - AST_2_FLOW_MASK
  11687. * Bits 27:24
  11688. * Purpose: identify the which flow the AST 2 entry corresponds to.
  11689. * - AST_3_FLOW_MASK
  11690. * Bits 31:28
  11691. * Purpose: identify the which flow the AST 3 entry corresponds to.
  11692. * - AST_INDEX_2
  11693. * Bits 15:0
  11694. * Purpose: indicate the third AST index for this peer
  11695. * - TID_VALID_HI_PRI
  11696. * Bits 23:16
  11697. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  11698. * - TID_VALID_LOW_PRI
  11699. * Bits 31:24
  11700. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  11701. * - AST_INDEX_3
  11702. * Bits 15:0
  11703. * Purpose: indicate the fourth AST index for this peer
  11704. * - ONCHIP_AST_IDX / RESERVED
  11705. * Bits 31:16
  11706. * Purpose: This field is valid only when split AST feature is enabled.
  11707. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  11708. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11709. * address, this ast_idx is used for LMAC modules for RXPCU.
  11710. * Value: ID used by the LMAC HW to identify the peer
  11711. */
  11712. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  11713. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  11714. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  11715. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  11716. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  11717. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  11718. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  11719. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  11720. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  11721. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  11722. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  11723. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  11724. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  11725. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  11726. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  11727. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  11728. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  11729. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  11730. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  11731. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  11732. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  11733. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  11734. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  11735. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  11736. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  11737. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  11738. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  11739. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  11740. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  11741. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  11742. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  11743. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  11744. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  11745. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  11746. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  11747. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  11748. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  11749. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  11750. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  11751. do { \
  11752. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  11753. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  11754. } while (0)
  11755. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  11756. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  11757. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  11758. do { \
  11759. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  11760. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  11761. } while (0)
  11762. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  11763. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  11764. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  11765. do { \
  11766. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  11767. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  11768. } while (0)
  11769. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  11770. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  11771. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  11772. do { \
  11773. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  11774. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  11775. } while (0)
  11776. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  11777. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  11778. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  11779. do { \
  11780. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  11781. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  11782. } while (0)
  11783. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  11784. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  11785. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  11786. do { \
  11787. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  11788. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  11789. } while (0)
  11790. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  11791. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  11792. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  11793. do { \
  11794. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  11795. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  11796. } while (0)
  11797. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  11798. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  11799. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11800. do { \
  11801. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  11802. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  11803. } while (0)
  11804. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  11805. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  11806. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  11807. do { \
  11808. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  11809. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  11810. } while (0)
  11811. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  11812. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  11813. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  11814. do { \
  11815. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  11816. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  11817. } while (0)
  11818. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  11819. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  11820. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  11821. do { \
  11822. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  11823. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  11824. } while (0)
  11825. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  11826. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  11827. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  11828. do { \
  11829. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  11830. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  11831. } while (0)
  11832. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  11833. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  11834. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  11835. do { \
  11836. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  11837. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  11838. } while (0)
  11839. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  11840. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  11841. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  11842. do { \
  11843. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  11844. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  11845. } while (0)
  11846. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  11847. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  11848. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  11849. do { \
  11850. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  11851. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  11852. } while (0)
  11853. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  11854. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  11855. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  11856. do { \
  11857. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  11858. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  11859. } while (0)
  11860. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  11861. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  11862. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  11863. do { \
  11864. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  11865. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  11866. } while (0)
  11867. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  11868. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  11869. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11870. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  11871. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  11872. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  11873. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  11874. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  11875. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  11876. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  11877. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  11878. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  11879. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  11880. #define HTT_RX_PEER_MAP_V2_BYTES 32
  11881. /**
  11882. * @brief target -> host rx peer map V3 message definition
  11883. *
  11884. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  11885. *
  11886. * @details
  11887. * The following diagram shows the format of the rx peer map v3 message sent
  11888. * from the target to the host.
  11889. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  11890. * This layout assumes the target operates as little-endian.
  11891. *
  11892. * |31 24|23 20|19|18|17|16|15 8|7 0|
  11893. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  11894. * | SW peer ID | VDEV ID | msg type |
  11895. * |-----------------+--------------------+-----------------+-----------------|
  11896. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11897. * |-----------------+--------------------+-----------------+-----------------|
  11898. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  11899. * |-----------------+--------+-----------+-----------------+-----------------|
  11900. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  11901. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  11902. * | (8bits) | | (4bits) | |
  11903. * |-----------------+--------+--+--+--+--------------------------------------|
  11904. * | RESERVED |E |O | | |
  11905. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  11906. * | |V |V | | |
  11907. * |-----------------+--------------------+-----------------------------------|
  11908. * | HTT_MSDU_IDX_ | RESERVED | |
  11909. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  11910. * | (8bits) | | |
  11911. * |-----------------+--------------------+-----------------------------------|
  11912. * | Reserved_2 |
  11913. * |--------------------------------------------------------------------------|
  11914. * | Reserved_3 |
  11915. * |--------------------------------------------------------------------------|
  11916. *
  11917. * Where:
  11918. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  11919. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  11920. * NH = Next Hop
  11921. * The following field definitions describe the format of the rx peer map v3
  11922. * messages sent from the target to the host.
  11923. * - MSG_TYPE
  11924. * Bits 7:0
  11925. * Purpose: identifies this as a peer map v3 message
  11926. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  11927. * - VDEV_ID
  11928. * Bits 15:8
  11929. * Purpose: Indicates which virtual device the peer is associated with.
  11930. * - SW_PEER_ID
  11931. * Bits 31:16
  11932. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  11933. * - MAC_ADDR_L32
  11934. * Bits 31:0
  11935. * Purpose: Identifies which peer node the peer ID is for.
  11936. * Value: lower 4 bytes of peer node's MAC address
  11937. * - MAC_ADDR_U16
  11938. * Bits 15:0
  11939. * Purpose: Identifies which peer node the peer ID is for.
  11940. * Value: upper 2 bytes of peer node's MAC address
  11941. * - MULTICAST_SW_PEER_ID
  11942. * Bits 31:16
  11943. * Purpose: The multicast peer ID (index)
  11944. * Value: set to HTT_INVALID_PEER if not valid
  11945. * - HW_PEER_ID / AST_INDEX
  11946. * Bits 15:0
  11947. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11948. * address, so for rx frames marked for rx --> tx forwarding, the
  11949. * host can determine from the HW peer ID provided as meta-data with
  11950. * the rx frame which peer the frame is supposed to be forwarded to.
  11951. * - CACHE_SET_NUM
  11952. * Bits 19:16
  11953. * Purpose: Cache Set Number for AST_INDEX
  11954. * Cache set number that should be used to cache the index based
  11955. * search results, for address and flow search.
  11956. * This value should be equal to LSB 4 bits of the hash value
  11957. * of match data, in case of search index points to an entry which
  11958. * may be used in content based search also. The value can be
  11959. * anything when the entry pointed by search index will not be
  11960. * used for content based search.
  11961. * - HTT_MSDU_IDX_VALID_MASK
  11962. * Bits 31:24
  11963. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11964. * - ONCHIP_AST_IDX / RESERVED
  11965. * Bits 15:0
  11966. * Purpose: This field is valid only when split AST feature is enabled.
  11967. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11968. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11969. * address, this ast_idx is used for LMAC modules for RXPCU.
  11970. * - NEXT_HOP
  11971. * Bits 16
  11972. * Purpose: Flag indicates next_hop AST entry used for WDS
  11973. * (Wireless Distribution System).
  11974. * - ONCHIP_AST_VALID
  11975. * Bits 17
  11976. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11977. * - EXT_AST_VALID
  11978. * Bits 18
  11979. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11980. * - EXT_AST_INDEX
  11981. * Bits 15:0
  11982. * Purpose: This field describes Extended AST index
  11983. * Valid if EXT_AST_VALID flag set
  11984. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11985. * Bits 31:24
  11986. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11987. */
  11988. /* dword 0 */
  11989. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11990. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11991. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11992. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11993. /* dword 1 */
  11994. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11995. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  11996. /* dword 2 */
  11997. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  11998. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  11999. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  12000. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  12001. /* dword 3 */
  12002. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  12003. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  12004. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  12005. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  12006. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  12007. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  12008. /* dword 4 */
  12009. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  12010. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  12011. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  12012. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  12013. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  12014. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  12015. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  12016. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  12017. /* dword 5 */
  12018. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  12019. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  12020. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  12021. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  12022. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  12023. do { \
  12024. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  12025. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  12026. } while (0)
  12027. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  12028. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  12029. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  12030. do { \
  12031. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  12032. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  12033. } while (0)
  12034. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  12035. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  12036. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  12037. do { \
  12038. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  12039. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  12040. } while (0)
  12041. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  12042. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  12043. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  12044. do { \
  12045. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  12046. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  12047. } while (0)
  12048. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  12049. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  12050. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  12051. do { \
  12052. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  12053. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  12054. } while (0)
  12055. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  12056. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  12057. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  12058. do { \
  12059. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  12060. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  12061. } while (0)
  12062. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  12063. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  12064. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  12065. do { \
  12066. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  12067. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  12068. } while (0)
  12069. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  12070. (((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)
  12071. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  12072. do { \
  12073. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  12074. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  12075. } while (0)
  12076. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  12077. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  12078. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  12079. do { \
  12080. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  12081. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  12082. } while (0)
  12083. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  12084. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  12085. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  12086. do { \
  12087. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  12088. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  12089. } while (0)
  12090. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  12091. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  12092. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  12093. do { \
  12094. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  12095. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  12096. } while (0)
  12097. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  12098. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  12099. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  12100. do { \
  12101. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  12102. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  12103. } while (0)
  12104. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  12105. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  12106. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  12107. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  12108. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  12109. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  12110. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  12111. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  12112. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  12113. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  12114. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  12115. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  12116. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  12117. #define HTT_RX_PEER_MAP_V3_BYTES 32
  12118. /**
  12119. * @brief target -> host rx peer unmap V2 message definition
  12120. *
  12121. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  12122. *
  12123. * The following diagram shows the format of the rx peer unmap message sent
  12124. * from the target to the host.
  12125. *
  12126. * |31 24|23 16|15 8|7 0|
  12127. * |-----------------------------------------------------------------------|
  12128. * | SW peer ID | VDEV ID | msg type |
  12129. * |-----------------------------------------------------------------------|
  12130. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12131. * |-----------------------------------------------------------------------|
  12132. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  12133. * |-----------------------------------------------------------------------|
  12134. * | Peer Delete Duration |
  12135. * |-----------------------------------------------------------------------|
  12136. * | Reserved_0 | WDS Free Count |
  12137. * |-----------------------------------------------------------------------|
  12138. * | Reserved_1 |
  12139. * |-----------------------------------------------------------------------|
  12140. * | Reserved_2 |
  12141. * |-----------------------------------------------------------------------|
  12142. *
  12143. *
  12144. * The following field definitions describe the format of the rx peer unmap
  12145. * messages sent from the target to the host.
  12146. * - MSG_TYPE
  12147. * Bits 7:0
  12148. * Purpose: identifies this as an rx peer unmap v2 message
  12149. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  12150. * - VDEV_ID
  12151. * Bits 15:8
  12152. * Purpose: Indicates which virtual device the peer is associated
  12153. * with.
  12154. * Value: vdev ID (used in the host to look up the vdev object)
  12155. * - SW_PEER_ID
  12156. * Bits 31:16
  12157. * Purpose: The peer ID (index) that WAL is freeing
  12158. * Value: (rx) peer ID
  12159. * - MAC_ADDR_L32
  12160. * Bits 31:0
  12161. * Purpose: Identifies which peer node the peer ID is for.
  12162. * Value: lower 4 bytes of peer node's MAC address
  12163. * - MAC_ADDR_U16
  12164. * Bits 15:0
  12165. * Purpose: Identifies which peer node the peer ID is for.
  12166. * Value: upper 2 bytes of peer node's MAC address
  12167. * - NEXT_HOP
  12168. * Bits 16
  12169. * Purpose: Bit indicates next_hop AST entry used for WDS
  12170. * (Wireless Distribution System).
  12171. * - PEER_DELETE_DURATION
  12172. * Bits 31:0
  12173. * Purpose: Time taken to delete peer, in msec,
  12174. * Used for monitoring / debugging PEER delete response delay
  12175. * - PEER_WDS_FREE_COUNT
  12176. * Bits 15:0
  12177. * Purpose: Count of WDS entries deleted associated to peer deleted
  12178. */
  12179. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  12180. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  12181. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  12182. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  12183. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  12184. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  12185. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  12186. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  12187. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  12188. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  12189. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  12190. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  12191. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  12192. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  12193. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  12194. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  12195. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  12196. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  12197. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  12198. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  12199. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  12200. do { \
  12201. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  12202. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  12203. } while (0)
  12204. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  12205. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  12206. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  12207. do { \
  12208. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  12209. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  12210. } while (0)
  12211. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  12212. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  12213. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  12214. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  12215. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  12216. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  12217. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  12218. /**
  12219. * @brief target -> host rx peer mlo map message definition
  12220. *
  12221. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  12222. *
  12223. * @details
  12224. * The following diagram shows the format of the rx mlo peer map message sent
  12225. * from the target to the host. This layout assumes the target operates
  12226. * as little-endian.
  12227. *
  12228. * MCC:
  12229. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  12230. *
  12231. * WIN:
  12232. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  12233. * It will be sent on the Assoc Link.
  12234. *
  12235. * This message always contains a MLO peer ID. The main purpose of the
  12236. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  12237. * with, so that the host can use that MLO peer ID to determine which peer
  12238. * transmitted the rx frame.
  12239. *
  12240. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  12241. * |-------------------------------------------------------------------------|
  12242. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  12243. * |-------------------------------------------------------------------------|
  12244. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12245. * |-------------------------------------------------------------------------|
  12246. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  12247. * |-------------------------------------------------------------------------|
  12248. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  12249. * |-------------------------------------------------------------------------|
  12250. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  12251. * |-------------------------------------------------------------------------|
  12252. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  12253. * |-------------------------------------------------------------------------|
  12254. * |RSVD |
  12255. * |-------------------------------------------------------------------------|
  12256. * |RSVD |
  12257. * |-------------------------------------------------------------------------|
  12258. * | htt_tlv_hdr_t |
  12259. * |-------------------------------------------------------------------------|
  12260. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12261. * |-------------------------------------------------------------------------|
  12262. * | htt_tlv_hdr_t |
  12263. * |-------------------------------------------------------------------------|
  12264. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12265. * |-------------------------------------------------------------------------|
  12266. * | htt_tlv_hdr_t |
  12267. * |-------------------------------------------------------------------------|
  12268. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12269. * |-------------------------------------------------------------------------|
  12270. *
  12271. * Where:
  12272. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  12273. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  12274. * V (valid) - 1 Bit Bit17
  12275. * CHIPID - 3 Bits
  12276. * TIDMASK - 8 Bits
  12277. * CACHE_SET_NUM - 8 Bits
  12278. *
  12279. * The following field definitions describe the format of the rx MLO peer map
  12280. * messages sent from the target to the host.
  12281. * - MSG_TYPE
  12282. * Bits 7:0
  12283. * Purpose: identifies this as an rx mlo peer map message
  12284. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  12285. *
  12286. * - MLO_PEER_ID
  12287. * Bits 23:8
  12288. * Purpose: The MLO peer ID (index).
  12289. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  12290. * Value: MLO peer ID
  12291. *
  12292. * - NUMLINK
  12293. * Bits: 26:24 (3Bits)
  12294. * Purpose: Indicate the max number of logical links supported per client.
  12295. * Value: number of logical links
  12296. *
  12297. * - PRC
  12298. * Bits: 29:27 (3Bits)
  12299. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  12300. * if there is migration of the primary chip.
  12301. * Value: Primary REO CHIPID
  12302. *
  12303. * - MAC_ADDR_L32
  12304. * Bits 31:0
  12305. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  12306. * Value: lower 4 bytes of peer node's MAC address
  12307. *
  12308. * - MAC_ADDR_U16
  12309. * Bits 15:0
  12310. * Purpose: Identifies which peer node the peer ID is for.
  12311. * Value: upper 2 bytes of peer node's MAC address
  12312. *
  12313. * - PRIMARY_TCL_AST_IDX
  12314. * Bits 15:0
  12315. * Purpose: Primary TCL AST index for this peer.
  12316. *
  12317. * - V
  12318. * 1 Bit Position 16
  12319. * Purpose: If the ast idx is valid.
  12320. *
  12321. * - CHIPID
  12322. * Bits 19:17
  12323. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  12324. *
  12325. * - TIDMASK
  12326. * Bits 27:20
  12327. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  12328. *
  12329. * - CACHE_SET_NUM
  12330. * Bits 31:28
  12331. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  12332. * Cache set number that should be used to cache the index based
  12333. * search results, for address and flow search.
  12334. * This value should be equal to LSB four bits of the hash value
  12335. * of match data, in case of search index points to an entry which
  12336. * may be used in content based search also. The value can be
  12337. * anything when the entry pointed by search index will not be
  12338. * used for content based search.
  12339. *
  12340. * - htt_tlv_hdr_t
  12341. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  12342. *
  12343. * Bits 11:0
  12344. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  12345. *
  12346. * Bits 23:12
  12347. * Purpose: Length, Length of the value that follows the header
  12348. *
  12349. * Bits 31:28
  12350. * Purpose: Reserved.
  12351. *
  12352. *
  12353. * - SW_PEER_ID
  12354. * Bits 15:0
  12355. * Purpose: The peer ID (index) that WAL is allocating
  12356. * Value: (rx) peer ID
  12357. *
  12358. * - VDEV_ID
  12359. * Bits 23:16
  12360. * Purpose: Indicates which virtual device the peer is associated with.
  12361. * Value: vdev ID (used in the host to look up the vdev object)
  12362. *
  12363. * - CHIPID
  12364. * Bits 26:24
  12365. * Purpose: Indicates which Chip id the peer is associated with.
  12366. * Value: chip ID (Provided by Host as part of QMI exchange)
  12367. */
  12368. typedef enum {
  12369. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  12370. } MLO_PEER_MAP_TLV_TAG_ID;
  12371. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  12372. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  12373. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  12374. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  12375. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  12376. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  12377. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  12378. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  12379. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  12380. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  12381. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  12382. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  12383. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  12384. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  12385. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  12386. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  12387. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  12388. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  12389. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  12390. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  12391. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  12392. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  12393. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  12394. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  12395. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  12396. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  12397. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  12398. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  12399. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  12400. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  12401. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  12402. do { \
  12403. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  12404. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  12405. } while (0)
  12406. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  12407. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  12408. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  12409. do { \
  12410. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  12411. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  12412. } while (0)
  12413. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  12414. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  12415. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  12416. do { \
  12417. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  12418. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  12419. } while (0)
  12420. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  12421. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  12422. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  12423. do { \
  12424. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  12425. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  12426. } while (0)
  12427. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  12428. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  12429. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  12430. do { \
  12431. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  12432. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  12433. } while (0)
  12434. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  12435. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  12436. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  12437. do { \
  12438. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  12439. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  12440. } while (0)
  12441. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  12442. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  12443. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  12444. do { \
  12445. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  12446. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  12447. } while (0)
  12448. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  12449. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  12450. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  12451. do { \
  12452. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  12453. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  12454. } while (0)
  12455. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  12456. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  12457. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  12458. do { \
  12459. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  12460. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  12461. } while (0)
  12462. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  12463. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  12464. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  12465. do { \
  12466. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  12467. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  12468. } while (0)
  12469. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  12470. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  12471. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  12472. do { \
  12473. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  12474. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  12475. } while (0)
  12476. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  12477. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  12478. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  12479. do { \
  12480. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  12481. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  12482. } while (0)
  12483. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  12484. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  12485. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  12486. do { \
  12487. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  12488. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  12489. } while (0)
  12490. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  12491. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  12492. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  12493. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  12494. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  12495. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  12496. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  12497. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  12498. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  12499. *
  12500. * The following diagram shows the format of the rx mlo peer unmap message sent
  12501. * from the target to the host.
  12502. *
  12503. * |31 24|23 16|15 8|7 0|
  12504. * |-----------------------------------------------------------------------|
  12505. * | RSVD_24_31 | MLO peer ID | msg type |
  12506. * |-----------------------------------------------------------------------|
  12507. */
  12508. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  12509. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  12510. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  12511. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  12512. /**
  12513. * @brief target -> host message specifying security parameters
  12514. *
  12515. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  12516. *
  12517. * @details
  12518. * The following diagram shows the format of the security specification
  12519. * message sent from the target to the host.
  12520. * This security specification message tells the host whether a PN check is
  12521. * necessary on rx data frames, and if so, how large the PN counter is.
  12522. * This message also tells the host about the security processing to apply
  12523. * to defragmented rx frames - specifically, whether a Message Integrity
  12524. * Check is required, and the Michael key to use.
  12525. *
  12526. * |31 24|23 16|15|14 8|7 0|
  12527. * |-----------------------------------------------------------------------|
  12528. * | peer ID | U| security type | msg type |
  12529. * |-----------------------------------------------------------------------|
  12530. * | Michael Key K0 |
  12531. * |-----------------------------------------------------------------------|
  12532. * | Michael Key K1 |
  12533. * |-----------------------------------------------------------------------|
  12534. * | WAPI RSC Low0 |
  12535. * |-----------------------------------------------------------------------|
  12536. * | WAPI RSC Low1 |
  12537. * |-----------------------------------------------------------------------|
  12538. * | WAPI RSC Hi0 |
  12539. * |-----------------------------------------------------------------------|
  12540. * | WAPI RSC Hi1 |
  12541. * |-----------------------------------------------------------------------|
  12542. *
  12543. * The following field definitions describe the format of the security
  12544. * indication message sent from the target to the host.
  12545. * - MSG_TYPE
  12546. * Bits 7:0
  12547. * Purpose: identifies this as a security specification message
  12548. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  12549. * - SEC_TYPE
  12550. * Bits 14:8
  12551. * Purpose: specifies which type of security applies to the peer
  12552. * Value: htt_sec_type enum value
  12553. * - UNICAST
  12554. * Bit 15
  12555. * Purpose: whether this security is applied to unicast or multicast data
  12556. * Value: 1 -> unicast, 0 -> multicast
  12557. * - PEER_ID
  12558. * Bits 31:16
  12559. * Purpose: The ID number for the peer the security specification is for
  12560. * Value: peer ID
  12561. * - MICHAEL_KEY_K0
  12562. * Bits 31:0
  12563. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  12564. * Value: Michael Key K0 (if security type is TKIP)
  12565. * - MICHAEL_KEY_K1
  12566. * Bits 31:0
  12567. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  12568. * Value: Michael Key K1 (if security type is TKIP)
  12569. * - WAPI_RSC_LOW0
  12570. * Bits 31:0
  12571. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  12572. * Value: WAPI RSC Low0 (if security type is WAPI)
  12573. * - WAPI_RSC_LOW1
  12574. * Bits 31:0
  12575. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  12576. * Value: WAPI RSC Low1 (if security type is WAPI)
  12577. * - WAPI_RSC_HI0
  12578. * Bits 31:0
  12579. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  12580. * Value: WAPI RSC Hi0 (if security type is WAPI)
  12581. * - WAPI_RSC_HI1
  12582. * Bits 31:0
  12583. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  12584. * Value: WAPI RSC Hi1 (if security type is WAPI)
  12585. */
  12586. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  12587. #define HTT_SEC_IND_SEC_TYPE_S 8
  12588. #define HTT_SEC_IND_UNICAST_M 0x00008000
  12589. #define HTT_SEC_IND_UNICAST_S 15
  12590. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  12591. #define HTT_SEC_IND_PEER_ID_S 16
  12592. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  12593. do { \
  12594. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  12595. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  12596. } while (0)
  12597. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  12598. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  12599. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  12600. do { \
  12601. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  12602. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  12603. } while (0)
  12604. #define HTT_SEC_IND_UNICAST_GET(word) \
  12605. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  12606. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  12607. do { \
  12608. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  12609. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  12610. } while (0)
  12611. #define HTT_SEC_IND_PEER_ID_GET(word) \
  12612. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  12613. #define HTT_SEC_IND_BYTES 28
  12614. /**
  12615. * @brief target -> host rx ADDBA / DELBA message definitions
  12616. *
  12617. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  12618. *
  12619. * @details
  12620. * The following diagram shows the format of the rx ADDBA message sent
  12621. * from the target to the host:
  12622. *
  12623. * |31 20|19 16|15 8|7 0|
  12624. * |---------------------------------------------------------------------|
  12625. * | peer ID | TID | window size | msg type |
  12626. * |---------------------------------------------------------------------|
  12627. *
  12628. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  12629. *
  12630. * The following diagram shows the format of the rx DELBA message sent
  12631. * from the target to the host:
  12632. *
  12633. * |31 20|19 16|15 10|9 8|7 0|
  12634. * |---------------------------------------------------------------------|
  12635. * | peer ID | TID | window size | IR| msg type |
  12636. * |---------------------------------------------------------------------|
  12637. *
  12638. * The following field definitions describe the format of the rx ADDBA
  12639. * and DELBA messages sent from the target to the host.
  12640. * - MSG_TYPE
  12641. * Bits 7:0
  12642. * Purpose: identifies this as an rx ADDBA or DELBA message
  12643. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  12644. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  12645. * - IR (initiator / recipient)
  12646. * Bits 9:8 (DELBA only)
  12647. * Purpose: specify whether the DELBA handshake was initiated by the
  12648. * local STA/AP, or by the peer STA/AP
  12649. * Value:
  12650. * 0 - unspecified
  12651. * 1 - initiator (a.k.a. originator)
  12652. * 2 - recipient (a.k.a. responder)
  12653. * 3 - unused / reserved
  12654. * - WIN_SIZE
  12655. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  12656. * Purpose: Specifies the length of the block ack window (max = 64).
  12657. * Value:
  12658. * block ack window length specified by the received ADDBA/DELBA
  12659. * management message.
  12660. * - TID
  12661. * Bits 19:16
  12662. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12663. * Value:
  12664. * TID specified by the received ADDBA or DELBA management message.
  12665. * - PEER_ID
  12666. * Bits 31:20
  12667. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12668. * Value:
  12669. * ID (hash value) used by the host for fast, direct lookup of
  12670. * host SW peer info, including rx reorder states.
  12671. */
  12672. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  12673. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  12674. #define HTT_RX_ADDBA_TID_M 0xf0000
  12675. #define HTT_RX_ADDBA_TID_S 16
  12676. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  12677. #define HTT_RX_ADDBA_PEER_ID_S 20
  12678. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  12679. do { \
  12680. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  12681. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  12682. } while (0)
  12683. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  12684. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12685. #define HTT_RX_ADDBA_TID_SET(word, value) \
  12686. do { \
  12687. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  12688. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  12689. } while (0)
  12690. #define HTT_RX_ADDBA_TID_GET(word) \
  12691. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  12692. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  12693. do { \
  12694. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  12695. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  12696. } while (0)
  12697. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  12698. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  12699. #define HTT_RX_ADDBA_BYTES 4
  12700. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  12701. #define HTT_RX_DELBA_INITIATOR_S 8
  12702. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  12703. #define HTT_RX_DELBA_WIN_SIZE_S 10
  12704. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  12705. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  12706. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  12707. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  12708. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  12709. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  12710. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  12711. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  12712. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12713. do { \
  12714. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12715. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12716. } while (0)
  12717. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12718. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12719. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  12720. do { \
  12721. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  12722. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  12723. } while (0)
  12724. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  12725. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  12726. #define HTT_RX_DELBA_BYTES 4
  12727. /**
  12728. * @brief target -> host rx ADDBA / DELBA message definitions
  12729. *
  12730. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN
  12731. *
  12732. * @details
  12733. * The following diagram shows the format of the rx ADDBA extn message sent
  12734. * from the target to the host:
  12735. *
  12736. * |31 20|19 16|15 13|12 8|7 0|
  12737. * |---------------------------------------------------------------------|
  12738. * | peer ID | TID | reserved | msg type |
  12739. * |---------------------------------------------------------------------|
  12740. * | reserved | window size |
  12741. * |---------------------------------------------------------------------|
  12742. *
  12743. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA_EXTN
  12744. *
  12745. * The following diagram shows the format of the rx DELBA message sent
  12746. * from the target to the host:
  12747. *
  12748. * |31 20|19 16|15 13|12 10|9 8|7 0|
  12749. * |---------------------------------------------------------------------|
  12750. * | peer ID | TID | reserved | IR| msg type |
  12751. * |---------------------------------------------------------------------|
  12752. * | reserved | window size |
  12753. * |---------------------------------------------------------------------|
  12754. *
  12755. * The following field definitions describe the format of the rx ADDBA
  12756. * and DELBA messages sent from the target to the host.
  12757. * - MSG_TYPE
  12758. * Bits 7:0
  12759. * Purpose: identifies this as an rx ADDBA or DELBA message
  12760. * Value: ADDBA -> 0x31 (HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN),
  12761. * DELBA -> 0x32 (HTT_T2H_MSG_TYPE_RX_DELBA_EXTN)
  12762. * - IR (initiator / recipient)
  12763. * Bits 9:8 (DELBA only)
  12764. * Purpose: specify whether the DELBA handshake was initiated by the
  12765. * local STA/AP, or by the peer STA/AP
  12766. * Value:
  12767. * 0 - unspecified
  12768. * 1 - initiator (a.k.a. originator)
  12769. * 2 - recipient (a.k.a. responder)
  12770. * 3 - unused / reserved
  12771. * Value:
  12772. * block ack window length specified by the received ADDBA/DELBA
  12773. * management message.
  12774. * - TID
  12775. * Bits 19:16
  12776. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12777. * Value:
  12778. * TID specified by the received ADDBA or DELBA management message.
  12779. * - PEER_ID
  12780. * Bits 31:20
  12781. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12782. * Value:
  12783. * ID (hash value) used by the host for fast, direct lookup of
  12784. * host SW peer info, including rx reorder states.
  12785. * == DWORD 1
  12786. * - WIN_SIZE
  12787. * Bits 12:0 for ADDBA, bits 12:0 for DELBA
  12788. * Purpose: Specifies the length of the block ack window (max = 8191).
  12789. */
  12790. #define HTT_RX_ADDBA_EXTN_TID_M 0xf0000
  12791. #define HTT_RX_ADDBA_EXTN_TID_S 16
  12792. #define HTT_RX_ADDBA_EXTN_PEER_ID_M 0xfff00000
  12793. #define HTT_RX_ADDBA_EXTN_PEER_ID_S 20
  12794. /*--- Dword 0 ---*/
  12795. #define HTT_RX_ADDBA_EXTN_TID_SET(word, value) \
  12796. do { \
  12797. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_TID, value); \
  12798. (word) |= (value) << HTT_RX_ADDBA_EXTN_TID_S; \
  12799. } while (0)
  12800. #define HTT_RX_ADDBA_EXTN_TID_GET(word) \
  12801. (((word) & HTT_RX_ADDBA_EXTN_TID_M) >> HTT_RX_ADDBA_EXTN_TID_S)
  12802. #define HTT_RX_ADDBA_EXTN_PEER_ID_SET(word, value) \
  12803. do { \
  12804. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_PEER_ID, value); \
  12805. (word) |= (value) << HTT_RX_ADDBA_EXTN_PEER_ID_S; \
  12806. } while (0)
  12807. #define HTT_RX_ADDBA_EXTN_PEER_ID_GET(word) \
  12808. (((word) & HTT_RX_ADDBA_EXTN_PEER_ID_M) >> HTT_RX_ADDBA_EXTN_PEER_ID_S)
  12809. /*--- Dword 1 ---*/
  12810. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_M 0x1fff
  12811. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_S 0
  12812. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_SET(word, value) \
  12813. do { \
  12814. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_WIN_SIZE, value); \
  12815. (word) |= (value) << HTT_RX_ADDBA_EXTN_WIN_SIZE_S; \
  12816. } while (0)
  12817. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_GET(word) \
  12818. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12819. #define HTT_RX_ADDBA_EXTN_BYTES 8
  12820. #define HTT_RX_DELBA_EXTN_INITIATOR_M 0x00000300
  12821. #define HTT_RX_DELBA_EXTN_INITIATOR_S 8
  12822. #define HTT_RX_DELBA_EXTN_TID_M 0xf0000
  12823. #define HTT_RX_DELBA_EXTN_TID_S 16
  12824. #define HTT_RX_DELBA_EXTN_PEER_ID_M 0xfff00000
  12825. #define HTT_RX_DELBA_EXTN_PEER_ID_S 20
  12826. /*--- Dword 0 ---*/
  12827. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12828. do { \
  12829. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12830. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12831. } while (0)
  12832. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12833. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12834. #define HTT_RX_DELBA_EXTN_TID_SET(word, value) \
  12835. do { \
  12836. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_TID, value); \
  12837. (word) |= (value) << HTT_RX_DELBA_EXTN_TID_S; \
  12838. } while (0)
  12839. #define HTT_RX_DELBA_EXTN_TID_GET(word) \
  12840. (((word) & HTT_RX_DELBA_EXTN_TID_M) >> HTT_RX_DELBA_EXTN_TID_S)
  12841. #define HTT_RX_DELBA_EXTN_PEER_ID_SET(word, value) \
  12842. do { \
  12843. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_PEER_ID, value); \
  12844. (word) |= (value) << HTT_RX_DELBA_EXTN_PEER_ID_S; \
  12845. } while (0)
  12846. #define HTT_RX_DELBA_EXTN_PEER_ID_GET(word) \
  12847. (((word) & HTT_RX_DELBA_EXTN_PEER_ID_M) >> HTT_RX_DELBA_EXTN_PEER_ID_S)
  12848. /*--- Dword 1 ---*/
  12849. #define HTT_RX_DELBA_EXTN_WIN_SIZE_M 0x1fff
  12850. #define HTT_RX_DELBA_EXTN_WIN_SIZE_S 0
  12851. #define HTT_RX_DELBA_EXTN_WIN_SIZE_SET(word, value) \
  12852. do { \
  12853. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_WIN_SIZE, value); \
  12854. (word) |= (value) << HTT_RX_DELBA_EXTN_WIN_SIZE_S; \
  12855. } while (0)
  12856. #define HTT_RX_DELBA_EXTN_WIN_SIZE_GET(word) \
  12857. (((word) & HTT_RX_DELBA_EXTN_WIN_SIZE_M) >> HTT_RX_DELBA_EXTN_WIN_SIZE_S)
  12858. #define HTT_RX_DELBA_EXTN_BYTES 8
  12859. /**
  12860. * @brief tx queue group information element definition
  12861. *
  12862. * @details
  12863. * The following diagram shows the format of the tx queue group
  12864. * information element, which can be included in target --> host
  12865. * messages to specify the number of tx "credits" (tx descriptors
  12866. * for LL, or tx buffers for HL) available to a particular group
  12867. * of host-side tx queues, and which host-side tx queues belong to
  12868. * the group.
  12869. *
  12870. * |31|30 24|23 16|15|14|13 0|
  12871. * |------------------------------------------------------------------------|
  12872. * | X| reserved | tx queue grp ID | A| S| credit count |
  12873. * |------------------------------------------------------------------------|
  12874. * | vdev ID mask | AC mask |
  12875. * |------------------------------------------------------------------------|
  12876. *
  12877. * The following definitions describe the fields within the tx queue group
  12878. * information element:
  12879. * - credit_count
  12880. * Bits 13:1
  12881. * Purpose: specify how many tx credits are available to the tx queue group
  12882. * Value: An absolute or relative, positive or negative credit value
  12883. * The 'A' bit specifies whether the value is absolute or relative.
  12884. * The 'S' bit specifies whether the value is positive or negative.
  12885. * A negative value can only be relative, not absolute.
  12886. * An absolute value replaces any prior credit value the host has for
  12887. * the tx queue group in question.
  12888. * A relative value is added to the prior credit value the host has for
  12889. * the tx queue group in question.
  12890. * - sign
  12891. * Bit 14
  12892. * Purpose: specify whether the credit count is positive or negative
  12893. * Value: 0 -> positive, 1 -> negative
  12894. * - absolute
  12895. * Bit 15
  12896. * Purpose: specify whether the credit count is absolute or relative
  12897. * Value: 0 -> relative, 1 -> absolute
  12898. * - txq_group_id
  12899. * Bits 23:16
  12900. * Purpose: indicate which tx queue group's credit and/or membership are
  12901. * being specified
  12902. * Value: 0 to max_tx_queue_groups-1
  12903. * - reserved
  12904. * Bits 30:16
  12905. * Value: 0x0
  12906. * - eXtension
  12907. * Bit 31
  12908. * Purpose: specify whether another tx queue group info element follows
  12909. * Value: 0 -> no more tx queue group information elements
  12910. * 1 -> another tx queue group information element immediately follows
  12911. * - ac_mask
  12912. * Bits 15:0
  12913. * Purpose: specify which Access Categories belong to the tx queue group
  12914. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  12915. * the tx queue group.
  12916. * The AC bit-mask values are obtained by left-shifting by the
  12917. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  12918. * - vdev_id_mask
  12919. * Bits 31:16
  12920. * Purpose: specify which vdev's tx queues belong to the tx queue group
  12921. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  12922. * belong to the tx queue group.
  12923. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  12924. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  12925. */
  12926. PREPACK struct htt_txq_group {
  12927. A_UINT32
  12928. credit_count: 14,
  12929. sign: 1,
  12930. absolute: 1,
  12931. tx_queue_group_id: 8,
  12932. reserved0: 7,
  12933. extension: 1;
  12934. A_UINT32
  12935. ac_mask: 16,
  12936. vdev_id_mask: 16;
  12937. } POSTPACK;
  12938. /* first word */
  12939. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  12940. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  12941. #define HTT_TXQ_GROUP_SIGN_S 14
  12942. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  12943. #define HTT_TXQ_GROUP_ABS_S 15
  12944. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  12945. #define HTT_TXQ_GROUP_ID_S 16
  12946. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  12947. #define HTT_TXQ_GROUP_EXT_S 31
  12948. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  12949. /* second word */
  12950. #define HTT_TXQ_GROUP_AC_MASK_S 0
  12951. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  12952. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  12953. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  12954. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  12955. do { \
  12956. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  12957. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  12958. } while (0)
  12959. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  12960. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  12961. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  12962. do { \
  12963. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  12964. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  12965. } while (0)
  12966. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  12967. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  12968. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  12969. do { \
  12970. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  12971. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  12972. } while (0)
  12973. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  12974. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  12975. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  12976. do { \
  12977. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  12978. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  12979. } while (0)
  12980. #define HTT_TXQ_GROUP_ID_GET(_info) \
  12981. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  12982. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  12983. do { \
  12984. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  12985. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  12986. } while (0)
  12987. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  12988. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  12989. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  12990. do { \
  12991. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  12992. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  12993. } while (0)
  12994. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  12995. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  12996. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  12997. do { \
  12998. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  12999. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  13000. } while (0)
  13001. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  13002. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  13003. /**
  13004. * @brief target -> host TX completion indication message definition
  13005. *
  13006. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  13007. *
  13008. * @details
  13009. * The following diagram shows the format of the TX completion indication sent
  13010. * from the target to the host
  13011. *
  13012. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  13013. * |-------------------------------------------------------------------|
  13014. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  13015. * |-------------------------------------------------------------------|
  13016. * payload:| MSDU1 ID | MSDU0 ID |
  13017. * |-------------------------------------------------------------------|
  13018. * : MSDU3 ID | MSDU2 ID :
  13019. * |-------------------------------------------------------------------|
  13020. * | struct htt_tx_compl_ind_append_retries |
  13021. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13022. * | struct htt_tx_compl_ind_append_tx_tstamp |
  13023. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13024. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  13025. * |-------------------------------------------------------------------|
  13026. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  13027. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13028. * | MSDU0 tx_tsf64_low |
  13029. * |-------------------------------------------------------------------|
  13030. * | MSDU0 tx_tsf64_high |
  13031. * |-------------------------------------------------------------------|
  13032. * | MSDU1 tx_tsf64_low |
  13033. * |-------------------------------------------------------------------|
  13034. * | MSDU1 tx_tsf64_high |
  13035. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13036. * | phy_timestamp |
  13037. * |-------------------------------------------------------------------|
  13038. * | rate specs (see below) |
  13039. * |-------------------------------------------------------------------|
  13040. * | seqctrl | framectrl |
  13041. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13042. * Where:
  13043. * A0 = append (a.k.a. append0)
  13044. * A1 = append1
  13045. * TP = MSDU tx power presence
  13046. * A2 = append2
  13047. * A3 = append3
  13048. * A4 = append4
  13049. *
  13050. * The following field definitions describe the format of the TX completion
  13051. * indication sent from the target to the host
  13052. * Header fields:
  13053. * - msg_type
  13054. * Bits 7:0
  13055. * Purpose: identifies this as HTT TX completion indication
  13056. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  13057. * - status
  13058. * Bits 10:8
  13059. * Purpose: the TX completion status of payload fragmentations descriptors
  13060. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  13061. * - tid
  13062. * Bits 14:11
  13063. * Purpose: the tid associated with those fragmentation descriptors. It is
  13064. * valid or not, depending on the tid_invalid bit.
  13065. * Value: 0 to 15
  13066. * - tid_invalid
  13067. * Bits 15:15
  13068. * Purpose: this bit indicates whether the tid field is valid or not
  13069. * Value: 0 indicates valid; 1 indicates invalid
  13070. * - num
  13071. * Bits 23:16
  13072. * Purpose: the number of payload in this indication
  13073. * Value: 1 to 255
  13074. * - append (a.k.a. append0)
  13075. * Bits 24:24
  13076. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  13077. * the number of tx retries for one MSDU at the end of this message
  13078. * Value: 0 indicates no appending; 1 indicates appending
  13079. * - append1
  13080. * Bits 25:25
  13081. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  13082. * contains the timestamp info for each TX msdu id in payload.
  13083. * The order of the timestamps matches the order of the MSDU IDs.
  13084. * Note that a big-endian host needs to account for the reordering
  13085. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  13086. * conversion) when determining which tx timestamp corresponds to
  13087. * which MSDU ID.
  13088. * Value: 0 indicates no appending; 1 indicates appending
  13089. * - msdu_tx_power_presence
  13090. * Bits 26:26
  13091. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  13092. * for each MSDU referenced by the TX_COMPL_IND message.
  13093. * The tx power is reported in 0.5 dBm units.
  13094. * The order of the per-MSDU tx power reports matches the order
  13095. * of the MSDU IDs.
  13096. * Note that a big-endian host needs to account for the reordering
  13097. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  13098. * conversion) when determining which Tx Power corresponds to
  13099. * which MSDU ID.
  13100. * Value: 0 indicates MSDU tx power reports are not appended,
  13101. * 1 indicates MSDU tx power reports are appended
  13102. * - append2
  13103. * Bits 27:27
  13104. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  13105. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  13106. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  13107. * same for all MSDUs within a single PPDU, the RSSI is duplicated
  13108. * for each MSDU, for convenience.
  13109. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  13110. * this append2 bit is set).
  13111. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  13112. * dB above the noise floor.
  13113. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  13114. * 1 indicates MSDU ACK RSSI values are appended.
  13115. * - append3
  13116. * Bits 28:28
  13117. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  13118. * contains the tx tsf info based on wlan global TSF for
  13119. * each TX msdu id in payload.
  13120. * The order of the tx tsf matches the order of the MSDU IDs.
  13121. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  13122. * values to indicate the the lower 32 bits and higher 32 bits of
  13123. * the tx tsf.
  13124. * The tx_tsf64 here represents the time MSDU was acked and the
  13125. * tx_tsf64 has microseconds units.
  13126. * Value: 0 indicates no appending; 1 indicates appending
  13127. * - append4
  13128. * Bits 29:29
  13129. * Purpose: Indicate whether data frame control fields and fields required
  13130. * for radio tap header are appended for each MSDU in TX_COMP_IND
  13131. * message. The order of the this message matches the order of
  13132. * the MSDU IDs.
  13133. * Value: 0 indicates frame control fields and fields required for
  13134. * radio tap header values are not appended,
  13135. * 1 indicates frame control fields and fields required for
  13136. * radio tap header values are appended.
  13137. * Payload fields:
  13138. * - hmsdu_id
  13139. * Bits 15:0
  13140. * Purpose: this ID is used to track the Tx buffer in host
  13141. * Value: 0 to "size of host MSDU descriptor pool - 1"
  13142. */
  13143. PREPACK struct htt_tx_data_hdr_information {
  13144. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  13145. A_UINT32 /* word 1 */
  13146. /* preamble:
  13147. * 0-OFDM,
  13148. * 1-CCk,
  13149. * 2-HT,
  13150. * 3-VHT
  13151. */
  13152. preamble: 2, /* [1:0] */
  13153. /* mcs:
  13154. * In case of HT preamble interpret
  13155. * MCS along with NSS.
  13156. * Valid values for HT are 0 to 7.
  13157. * HT mcs 0 with NSS 2 is mcs 8.
  13158. * Valid values for VHT are 0 to 9.
  13159. */
  13160. mcs: 4, /* [5:2] */
  13161. /* rate:
  13162. * This is applicable only for
  13163. * CCK and OFDM preamble type
  13164. * rate 0: OFDM 48 Mbps,
  13165. * 1: OFDM 24 Mbps,
  13166. * 2: OFDM 12 Mbps
  13167. * 3: OFDM 6 Mbps
  13168. * 4: OFDM 54 Mbps
  13169. * 5: OFDM 36 Mbps
  13170. * 6: OFDM 18 Mbps
  13171. * 7: OFDM 9 Mbps
  13172. * rate 0: CCK 11 Mbps Long
  13173. * 1: CCK 5.5 Mbps Long
  13174. * 2: CCK 2 Mbps Long
  13175. * 3: CCK 1 Mbps Long
  13176. * 4: CCK 11 Mbps Short
  13177. * 5: CCK 5.5 Mbps Short
  13178. * 6: CCK 2 Mbps Short
  13179. */
  13180. rate : 3, /* [ 8: 6] */
  13181. rssi : 8, /* [16: 9] units=dBm */
  13182. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  13183. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  13184. stbc : 1, /* [22] */
  13185. sgi : 1, /* [23] */
  13186. ldpc : 1, /* [24] */
  13187. beamformed: 1, /* [25] */
  13188. /* tx_retry_cnt:
  13189. * Indicates retry count of data tx frames provided by the host.
  13190. */
  13191. tx_retry_cnt: 6; /* [31:26] */
  13192. A_UINT32 /* word 2 */
  13193. framectrl:16, /* [15: 0] */
  13194. seqno:16; /* [31:16] */
  13195. } POSTPACK;
  13196. #define HTT_TX_COMPL_IND_STATUS_S 8
  13197. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  13198. #define HTT_TX_COMPL_IND_TID_S 11
  13199. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  13200. #define HTT_TX_COMPL_IND_TID_INV_S 15
  13201. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  13202. #define HTT_TX_COMPL_IND_NUM_S 16
  13203. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  13204. #define HTT_TX_COMPL_IND_APPEND_S 24
  13205. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  13206. #define HTT_TX_COMPL_IND_APPEND1_S 25
  13207. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  13208. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  13209. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  13210. #define HTT_TX_COMPL_IND_APPEND2_S 27
  13211. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  13212. #define HTT_TX_COMPL_IND_APPEND3_S 28
  13213. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  13214. #define HTT_TX_COMPL_IND_APPEND4_S 29
  13215. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  13216. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  13217. do { \
  13218. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  13219. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  13220. } while (0)
  13221. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  13222. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  13223. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  13224. do { \
  13225. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  13226. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  13227. } while (0)
  13228. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  13229. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  13230. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  13231. do { \
  13232. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  13233. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  13234. } while (0)
  13235. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  13236. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  13237. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  13238. do { \
  13239. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  13240. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  13241. } while (0)
  13242. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  13243. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  13244. HTT_TX_COMPL_IND_TID_INV_S)
  13245. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  13246. do { \
  13247. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  13248. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  13249. } while (0)
  13250. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  13251. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  13252. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  13253. do { \
  13254. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  13255. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  13256. } while (0)
  13257. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  13258. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  13259. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  13260. do { \
  13261. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  13262. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  13263. } while (0)
  13264. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  13265. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  13266. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  13267. do { \
  13268. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  13269. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  13270. } while (0)
  13271. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  13272. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  13273. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  13274. do { \
  13275. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  13276. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  13277. } while (0)
  13278. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  13279. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  13280. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  13281. do { \
  13282. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  13283. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  13284. } while (0)
  13285. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  13286. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  13287. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  13288. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  13289. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  13290. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  13291. #define HTT_TX_COMPL_IND_STAT_OK 0
  13292. /* DISCARD:
  13293. * current meaning:
  13294. * MSDUs were queued for transmission but filtered by HW or SW
  13295. * without any over the air attempts
  13296. * legacy meaning (HL Rome):
  13297. * MSDUs were discarded by the target FW without any over the air
  13298. * attempts due to lack of space
  13299. */
  13300. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  13301. /* NO_ACK:
  13302. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  13303. */
  13304. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  13305. /* POSTPONE:
  13306. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  13307. * be downloaded again later (in the appropriate order), when they are
  13308. * deliverable.
  13309. */
  13310. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  13311. /*
  13312. * The PEER_DEL tx completion status is used for HL cases
  13313. * where the peer the frame is for has been deleted.
  13314. * The host has already discarded its copy of the frame, but
  13315. * it still needs the tx completion to restore its credit.
  13316. */
  13317. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  13318. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  13319. #define HTT_TX_COMPL_IND_STAT_DROP 5
  13320. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  13321. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  13322. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  13323. PREPACK struct htt_tx_compl_ind_base {
  13324. A_UINT32 hdr;
  13325. A_UINT16 payload[1/*or more*/];
  13326. } POSTPACK;
  13327. PREPACK struct htt_tx_compl_ind_append_retries {
  13328. A_UINT16 msdu_id;
  13329. A_UINT8 tx_retries;
  13330. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  13331. 0: this is the last append_retries struct */
  13332. } POSTPACK;
  13333. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  13334. A_UINT32 timestamp[1/*or more*/];
  13335. } POSTPACK;
  13336. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  13337. A_UINT32 tx_tsf64_low;
  13338. A_UINT32 tx_tsf64_high;
  13339. } POSTPACK;
  13340. /* htt_tx_data_hdr_information payload extension fields: */
  13341. /* DWORD zero */
  13342. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  13343. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  13344. /* DWORD one */
  13345. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  13346. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  13347. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  13348. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  13349. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  13350. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  13351. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  13352. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  13353. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  13354. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  13355. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  13356. #define HTT_FW_TX_DATA_HDR_BW_S 19
  13357. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  13358. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  13359. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  13360. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  13361. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  13362. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  13363. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  13364. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  13365. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  13366. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  13367. /* DWORD two */
  13368. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  13369. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  13370. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  13371. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  13372. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  13373. do { \
  13374. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  13375. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  13376. } while (0)
  13377. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  13378. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  13379. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  13380. do { \
  13381. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  13382. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  13383. } while (0)
  13384. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  13385. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  13386. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  13387. do { \
  13388. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  13389. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  13390. } while (0)
  13391. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  13392. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  13393. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  13394. do { \
  13395. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  13396. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  13397. } while (0)
  13398. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  13399. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  13400. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  13401. do { \
  13402. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  13403. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  13404. } while (0)
  13405. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  13406. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  13407. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  13408. do { \
  13409. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  13410. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  13411. } while (0)
  13412. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  13413. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  13414. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  13415. do { \
  13416. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  13417. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  13418. } while (0)
  13419. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  13420. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  13421. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  13422. do { \
  13423. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  13424. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  13425. } while (0)
  13426. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  13427. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  13428. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  13429. do { \
  13430. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  13431. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  13432. } while (0)
  13433. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  13434. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  13435. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  13436. do { \
  13437. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  13438. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  13439. } while (0)
  13440. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  13441. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  13442. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  13443. do { \
  13444. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  13445. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  13446. } while (0)
  13447. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  13448. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  13449. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  13450. do { \
  13451. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  13452. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  13453. } while (0)
  13454. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  13455. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  13456. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  13457. do { \
  13458. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  13459. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  13460. } while (0)
  13461. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  13462. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  13463. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  13464. do { \
  13465. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  13466. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  13467. } while (0)
  13468. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  13469. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  13470. /**
  13471. * @brief target -> host rate-control update indication message
  13472. *
  13473. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  13474. *
  13475. * @details
  13476. * The following diagram shows the format of the RC Update message
  13477. * sent from the target to the host, while processing the tx-completion
  13478. * of a transmitted PPDU.
  13479. *
  13480. * |31 24|23 16|15 8|7 0|
  13481. * |-------------------------------------------------------------|
  13482. * | peer ID | vdev ID | msg_type |
  13483. * |-------------------------------------------------------------|
  13484. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  13485. * |-------------------------------------------------------------|
  13486. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  13487. * |-------------------------------------------------------------|
  13488. * | : |
  13489. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  13490. * | : |
  13491. * |-------------------------------------------------------------|
  13492. * | : |
  13493. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  13494. * | : |
  13495. * |-------------------------------------------------------------|
  13496. * : :
  13497. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13498. *
  13499. */
  13500. typedef struct {
  13501. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  13502. A_UINT32 rate_code_flags;
  13503. A_UINT32 flags; /* Encodes information such as excessive
  13504. retransmission, aggregate, some info
  13505. from .11 frame control,
  13506. STBC, LDPC, (SGI and Tx Chain Mask
  13507. are encoded in ptx_rc->flags field),
  13508. AMPDU truncation (BT/time based etc.),
  13509. RTS/CTS attempt */
  13510. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  13511. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  13512. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  13513. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  13514. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  13515. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  13516. } HTT_RC_TX_DONE_PARAMS;
  13517. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  13518. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  13519. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  13520. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  13521. #define HTT_RC_UPDATE_VDEVID_S 8
  13522. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  13523. #define HTT_RC_UPDATE_PEERID_S 16
  13524. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  13525. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  13526. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  13527. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  13528. do { \
  13529. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  13530. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  13531. } while (0)
  13532. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  13533. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  13534. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  13535. do { \
  13536. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  13537. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  13538. } while (0)
  13539. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  13540. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  13541. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  13542. do { \
  13543. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  13544. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  13545. } while (0)
  13546. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  13547. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  13548. /**
  13549. * @brief target -> host rx fragment indication message definition
  13550. *
  13551. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  13552. *
  13553. * @details
  13554. * The following field definitions describe the format of the rx fragment
  13555. * indication message sent from the target to the host.
  13556. * The rx fragment indication message shares the format of the
  13557. * rx indication message, but not all fields from the rx indication message
  13558. * are relevant to the rx fragment indication message.
  13559. *
  13560. *
  13561. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  13562. * |-----------+-------------------+---------------------+-------------|
  13563. * | peer ID | |FV| ext TID | msg type |
  13564. * |-------------------------------------------------------------------|
  13565. * | | flush | flush |
  13566. * | | end | start |
  13567. * | | seq num | seq num |
  13568. * |-------------------------------------------------------------------|
  13569. * | reserved | FW rx desc bytes |
  13570. * |-------------------------------------------------------------------|
  13571. * | | FW MSDU Rx |
  13572. * | | desc B0 |
  13573. * |-------------------------------------------------------------------|
  13574. * Header fields:
  13575. * - MSG_TYPE
  13576. * Bits 7:0
  13577. * Purpose: identifies this as an rx fragment indication message
  13578. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  13579. * - EXT_TID
  13580. * Bits 12:8
  13581. * Purpose: identify the traffic ID of the rx data, including
  13582. * special "extended" TID values for multicast, broadcast, and
  13583. * non-QoS data frames
  13584. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  13585. * - FLUSH_VALID (FV)
  13586. * Bit 13
  13587. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  13588. * is valid
  13589. * Value:
  13590. * 1 -> flush IE is valid and needs to be processed
  13591. * 0 -> flush IE is not valid and should be ignored
  13592. * - PEER_ID
  13593. * Bits 31:16
  13594. * Purpose: Identify, by ID, which peer sent the rx data
  13595. * Value: ID of the peer who sent the rx data
  13596. * - FLUSH_SEQ_NUM_START
  13597. * Bits 5:0
  13598. * Purpose: Indicate the start of a series of MPDUs to flush
  13599. * Not all MPDUs within this series are necessarily valid - the host
  13600. * must check each sequence number within this range to see if the
  13601. * corresponding MPDU is actually present.
  13602. * This field is only valid if the FV bit is set.
  13603. * Value:
  13604. * The sequence number for the first MPDUs to check to flush.
  13605. * The sequence number is masked by 0x3f.
  13606. * - FLUSH_SEQ_NUM_END
  13607. * Bits 11:6
  13608. * Purpose: Indicate the end of a series of MPDUs to flush
  13609. * Value:
  13610. * The sequence number one larger than the sequence number of the
  13611. * last MPDU to check to flush.
  13612. * The sequence number is masked by 0x3f.
  13613. * Not all MPDUs within this series are necessarily valid - the host
  13614. * must check each sequence number within this range to see if the
  13615. * corresponding MPDU is actually present.
  13616. * This field is only valid if the FV bit is set.
  13617. * Rx descriptor fields:
  13618. * - FW_RX_DESC_BYTES
  13619. * Bits 15:0
  13620. * Purpose: Indicate how many bytes in the Rx indication are used for
  13621. * FW Rx descriptors
  13622. * Value: 1
  13623. */
  13624. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  13625. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  13626. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  13627. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  13628. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  13629. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  13630. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  13631. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  13632. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  13633. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  13634. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  13635. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  13636. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  13637. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  13638. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  13639. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  13640. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  13641. #define HTT_RX_FRAG_IND_BYTES \
  13642. (4 /* msg hdr */ + \
  13643. 4 /* flush spec */ + \
  13644. 4 /* (unused) FW rx desc bytes spec */ + \
  13645. 4 /* FW rx desc */)
  13646. /**
  13647. * @brief target -> host test message definition
  13648. *
  13649. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  13650. *
  13651. * @details
  13652. * The following field definitions describe the format of the test
  13653. * message sent from the target to the host.
  13654. * The message consists of a 4-octet header, followed by a variable
  13655. * number of 32-bit integer values, followed by a variable number
  13656. * of 8-bit character values.
  13657. *
  13658. * |31 16|15 8|7 0|
  13659. * |-----------------------------------------------------------|
  13660. * | num chars | num ints | msg type |
  13661. * |-----------------------------------------------------------|
  13662. * | int 0 |
  13663. * |-----------------------------------------------------------|
  13664. * | int 1 |
  13665. * |-----------------------------------------------------------|
  13666. * | ... |
  13667. * |-----------------------------------------------------------|
  13668. * | char 3 | char 2 | char 1 | char 0 |
  13669. * |-----------------------------------------------------------|
  13670. * | | | ... | char 4 |
  13671. * |-----------------------------------------------------------|
  13672. * - MSG_TYPE
  13673. * Bits 7:0
  13674. * Purpose: identifies this as a test message
  13675. * Value: HTT_MSG_TYPE_TEST
  13676. * - NUM_INTS
  13677. * Bits 15:8
  13678. * Purpose: indicate how many 32-bit integers follow the message header
  13679. * - NUM_CHARS
  13680. * Bits 31:16
  13681. * Purpose: indicate how many 8-bit characters follow the series of integers
  13682. */
  13683. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  13684. #define HTT_RX_TEST_NUM_INTS_S 8
  13685. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  13686. #define HTT_RX_TEST_NUM_CHARS_S 16
  13687. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  13688. do { \
  13689. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  13690. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  13691. } while (0)
  13692. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  13693. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  13694. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  13695. do { \
  13696. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  13697. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  13698. } while (0)
  13699. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  13700. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  13701. /**
  13702. * @brief target -> host packet log message
  13703. *
  13704. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  13705. *
  13706. * @details
  13707. * The following field definitions describe the format of the packet log
  13708. * message sent from the target to the host.
  13709. * The message consists of a 4-octet header,followed by a variable number
  13710. * of 32-bit character values.
  13711. *
  13712. * |31 16|15 12|11 10|9 8|7 0|
  13713. * |------------------------------------------------------------------|
  13714. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  13715. * |------------------------------------------------------------------|
  13716. * | payload |
  13717. * |------------------------------------------------------------------|
  13718. * - MSG_TYPE
  13719. * Bits 7:0
  13720. * Purpose: identifies this as a pktlog message
  13721. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  13722. * - mac_id
  13723. * Bits 9:8
  13724. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  13725. * Value: 0-3
  13726. * - pdev_id
  13727. * Bits 11:10
  13728. * Purpose: pdev_id
  13729. * Value: 0-3
  13730. * 0 (for rings at SOC level),
  13731. * 1/2/3 PDEV -> 0/1/2
  13732. * - payload_size
  13733. * Bits 31:16
  13734. * Purpose: explicitly specify the payload size
  13735. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  13736. */
  13737. PREPACK struct htt_pktlog_msg {
  13738. A_UINT32 header;
  13739. A_UINT32 payload[1/* or more */];
  13740. } POSTPACK;
  13741. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  13742. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  13743. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  13744. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  13745. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  13746. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  13747. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  13748. do { \
  13749. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  13750. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  13751. } while (0)
  13752. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  13753. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  13754. HTT_T2H_PKTLOG_MAC_ID_S)
  13755. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  13756. do { \
  13757. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  13758. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  13759. } while (0)
  13760. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  13761. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  13762. HTT_T2H_PKTLOG_PDEV_ID_S)
  13763. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  13764. do { \
  13765. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  13766. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  13767. } while (0)
  13768. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  13769. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  13770. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  13771. /*
  13772. * Rx reorder statistics
  13773. * NB: all the fields must be defined in 4 octets size.
  13774. */
  13775. struct rx_reorder_stats {
  13776. /* Non QoS MPDUs received */
  13777. A_UINT32 deliver_non_qos;
  13778. /* MPDUs received in-order */
  13779. A_UINT32 deliver_in_order;
  13780. /* Flush due to reorder timer expired */
  13781. A_UINT32 deliver_flush_timeout;
  13782. /* Flush due to move out of window */
  13783. A_UINT32 deliver_flush_oow;
  13784. /* Flush due to DELBA */
  13785. A_UINT32 deliver_flush_delba;
  13786. /* MPDUs dropped due to FCS error */
  13787. A_UINT32 fcs_error;
  13788. /* MPDUs dropped due to monitor mode non-data packet */
  13789. A_UINT32 mgmt_ctrl;
  13790. /* Unicast-data MPDUs dropped due to invalid peer */
  13791. A_UINT32 invalid_peer;
  13792. /* MPDUs dropped due to duplication (non aggregation) */
  13793. A_UINT32 dup_non_aggr;
  13794. /* MPDUs dropped due to processed before */
  13795. A_UINT32 dup_past;
  13796. /* MPDUs dropped due to duplicate in reorder queue */
  13797. A_UINT32 dup_in_reorder;
  13798. /* Reorder timeout happened */
  13799. A_UINT32 reorder_timeout;
  13800. /* invalid bar ssn */
  13801. A_UINT32 invalid_bar_ssn;
  13802. /* reorder reset due to bar ssn */
  13803. A_UINT32 ssn_reset;
  13804. /* Flush due to delete peer */
  13805. A_UINT32 deliver_flush_delpeer;
  13806. /* Flush due to offload*/
  13807. A_UINT32 deliver_flush_offload;
  13808. /* Flush due to out of buffer*/
  13809. A_UINT32 deliver_flush_oob;
  13810. /* MPDUs dropped due to PN check fail */
  13811. A_UINT32 pn_fail;
  13812. /* MPDUs dropped due to unable to allocate memory */
  13813. A_UINT32 store_fail;
  13814. /* Number of times the tid pool alloc succeeded */
  13815. A_UINT32 tid_pool_alloc_succ;
  13816. /* Number of times the MPDU pool alloc succeeded */
  13817. A_UINT32 mpdu_pool_alloc_succ;
  13818. /* Number of times the MSDU pool alloc succeeded */
  13819. A_UINT32 msdu_pool_alloc_succ;
  13820. /* Number of times the tid pool alloc failed */
  13821. A_UINT32 tid_pool_alloc_fail;
  13822. /* Number of times the MPDU pool alloc failed */
  13823. A_UINT32 mpdu_pool_alloc_fail;
  13824. /* Number of times the MSDU pool alloc failed */
  13825. A_UINT32 msdu_pool_alloc_fail;
  13826. /* Number of times the tid pool freed */
  13827. A_UINT32 tid_pool_free;
  13828. /* Number of times the MPDU pool freed */
  13829. A_UINT32 mpdu_pool_free;
  13830. /* Number of times the MSDU pool freed */
  13831. A_UINT32 msdu_pool_free;
  13832. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  13833. A_UINT32 msdu_queued;
  13834. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  13835. A_UINT32 msdu_recycled;
  13836. /* Number of MPDUs with invalid peer but A2 found in AST */
  13837. A_UINT32 invalid_peer_a2_in_ast;
  13838. /* Number of MPDUs with invalid peer but A3 found in AST */
  13839. A_UINT32 invalid_peer_a3_in_ast;
  13840. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  13841. A_UINT32 invalid_peer_bmc_mpdus;
  13842. /* Number of MSDUs with err attention word */
  13843. A_UINT32 rxdesc_err_att;
  13844. /* Number of MSDUs with flag of peer_idx_invalid */
  13845. A_UINT32 rxdesc_err_peer_idx_inv;
  13846. /* Number of MSDUs with flag of peer_idx_timeout */
  13847. A_UINT32 rxdesc_err_peer_idx_to;
  13848. /* Number of MSDUs with flag of overflow */
  13849. A_UINT32 rxdesc_err_ov;
  13850. /* Number of MSDUs with flag of msdu_length_err */
  13851. A_UINT32 rxdesc_err_msdu_len;
  13852. /* Number of MSDUs with flag of mpdu_length_err */
  13853. A_UINT32 rxdesc_err_mpdu_len;
  13854. /* Number of MSDUs with flag of tkip_mic_err */
  13855. A_UINT32 rxdesc_err_tkip_mic;
  13856. /* Number of MSDUs with flag of decrypt_err */
  13857. A_UINT32 rxdesc_err_decrypt;
  13858. /* Number of MSDUs with flag of fcs_err */
  13859. A_UINT32 rxdesc_err_fcs;
  13860. /* Number of Unicast (bc_mc bit is not set in attention word)
  13861. * frames with invalid peer handler
  13862. */
  13863. A_UINT32 rxdesc_uc_msdus_inv_peer;
  13864. /* Number of unicast frame directly (direct bit is set in attention word)
  13865. * to DUT with invalid peer handler
  13866. */
  13867. A_UINT32 rxdesc_direct_msdus_inv_peer;
  13868. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  13869. * frames with invalid peer handler
  13870. */
  13871. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  13872. /* Number of MSDUs dropped due to no first MSDU flag */
  13873. A_UINT32 rxdesc_no_1st_msdu;
  13874. /* Number of MSDUs dropped due to ring overflow */
  13875. A_UINT32 msdu_drop_ring_ov;
  13876. /* Number of MSDUs dropped due to FC mismatch */
  13877. A_UINT32 msdu_drop_fc_mismatch;
  13878. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  13879. A_UINT32 msdu_drop_mgmt_remote_ring;
  13880. /* Number of MSDUs dropped due to errors not reported in attention word */
  13881. A_UINT32 msdu_drop_misc;
  13882. /* Number of MSDUs go to offload before reorder */
  13883. A_UINT32 offload_msdu_wal;
  13884. /* Number of data frame dropped by offload after reorder */
  13885. A_UINT32 offload_msdu_reorder;
  13886. /* Number of MPDUs with sequence number in the past and within the BA window */
  13887. A_UINT32 dup_past_within_window;
  13888. /* Number of MPDUs with sequence number in the past and outside the BA window */
  13889. A_UINT32 dup_past_outside_window;
  13890. /* Number of MSDUs with decrypt/MIC error */
  13891. A_UINT32 rxdesc_err_decrypt_mic;
  13892. /* Number of data MSDUs received on both local and remote rings */
  13893. A_UINT32 data_msdus_on_both_rings;
  13894. /* MPDUs never filled */
  13895. A_UINT32 holes_not_filled;
  13896. };
  13897. /*
  13898. * Rx Remote buffer statistics
  13899. * NB: all the fields must be defined in 4 octets size.
  13900. */
  13901. struct rx_remote_buffer_mgmt_stats {
  13902. /* Total number of MSDUs reaped for Rx processing */
  13903. A_UINT32 remote_reaped;
  13904. /* MSDUs recycled within firmware */
  13905. A_UINT32 remote_recycled;
  13906. /* MSDUs stored by Data Rx */
  13907. A_UINT32 data_rx_msdus_stored;
  13908. /* Number of HTT indications from WAL Rx MSDU */
  13909. A_UINT32 wal_rx_ind;
  13910. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  13911. A_UINT32 wal_rx_ind_unconsumed;
  13912. /* Number of HTT indications from Data Rx MSDU */
  13913. A_UINT32 data_rx_ind;
  13914. /* Number of unconsumed HTT indications from Data Rx MSDU */
  13915. A_UINT32 data_rx_ind_unconsumed;
  13916. /* Number of HTT indications from ATHBUF */
  13917. A_UINT32 athbuf_rx_ind;
  13918. /* Number of remote buffers requested for refill */
  13919. A_UINT32 refill_buf_req;
  13920. /* Number of remote buffers filled by the host */
  13921. A_UINT32 refill_buf_rsp;
  13922. /* Number of times MAC hw_index = f/w write_index */
  13923. A_INT32 mac_no_bufs;
  13924. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  13925. A_INT32 fw_indices_equal;
  13926. /* Number of times f/w finds no buffers to post */
  13927. A_INT32 host_no_bufs;
  13928. };
  13929. /*
  13930. * TXBF MU/SU packets and NDPA statistics
  13931. * NB: all the fields must be defined in 4 octets size.
  13932. */
  13933. struct rx_txbf_musu_ndpa_pkts_stats {
  13934. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  13935. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  13936. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  13937. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  13938. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  13939. A_UINT32 reserved[3]; /* must be set to 0x0 */
  13940. };
  13941. /*
  13942. * htt_dbg_stats_status -
  13943. * present - The requested stats have been delivered in full.
  13944. * This indicates that either the stats information was contained
  13945. * in its entirety within this message, or else this message
  13946. * completes the delivery of the requested stats info that was
  13947. * partially delivered through earlier STATS_CONF messages.
  13948. * partial - The requested stats have been delivered in part.
  13949. * One or more subsequent STATS_CONF messages with the same
  13950. * cookie value will be sent to deliver the remainder of the
  13951. * information.
  13952. * error - The requested stats could not be delivered, for example due
  13953. * to a shortage of memory to construct a message holding the
  13954. * requested stats.
  13955. * invalid - The requested stat type is either not recognized, or the
  13956. * target is configured to not gather the stats type in question.
  13957. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13958. * series_done - This special value indicates that no further stats info
  13959. * elements are present within a series of stats info elems
  13960. * (within a stats upload confirmation message).
  13961. */
  13962. enum htt_dbg_stats_status {
  13963. HTT_DBG_STATS_STATUS_PRESENT = 0,
  13964. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  13965. HTT_DBG_STATS_STATUS_ERROR = 2,
  13966. HTT_DBG_STATS_STATUS_INVALID = 3,
  13967. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  13968. };
  13969. /**
  13970. * @brief target -> host statistics upload
  13971. *
  13972. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  13973. *
  13974. * @details
  13975. * The following field definitions describe the format of the HTT target
  13976. * to host stats upload confirmation message.
  13977. * The message contains a cookie echoed from the HTT host->target stats
  13978. * upload request, which identifies which request the confirmation is
  13979. * for, and a series of tag-length-value stats information elements.
  13980. * The tag-length header for each stats info element also includes a
  13981. * status field, to indicate whether the request for the stat type in
  13982. * question was fully met, partially met, unable to be met, or invalid
  13983. * (if the stat type in question is disabled in the target).
  13984. * A special value of all 1's in this status field is used to indicate
  13985. * the end of the series of stats info elements.
  13986. *
  13987. *
  13988. * |31 16|15 8|7 5|4 0|
  13989. * |------------------------------------------------------------|
  13990. * | reserved | msg type |
  13991. * |------------------------------------------------------------|
  13992. * | cookie LSBs |
  13993. * |------------------------------------------------------------|
  13994. * | cookie MSBs |
  13995. * |------------------------------------------------------------|
  13996. * | stats entry length | reserved | S |stat type|
  13997. * |------------------------------------------------------------|
  13998. * | |
  13999. * | type-specific stats info |
  14000. * | |
  14001. * |------------------------------------------------------------|
  14002. * | stats entry length | reserved | S |stat type|
  14003. * |------------------------------------------------------------|
  14004. * | |
  14005. * | type-specific stats info |
  14006. * | |
  14007. * |------------------------------------------------------------|
  14008. * | n/a | reserved | 111 | n/a |
  14009. * |------------------------------------------------------------|
  14010. * Header fields:
  14011. * - MSG_TYPE
  14012. * Bits 7:0
  14013. * Purpose: identifies this is a statistics upload confirmation message
  14014. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  14015. * - COOKIE_LSBS
  14016. * Bits 31:0
  14017. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14018. * message with its preceding host->target stats request message.
  14019. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14020. * - COOKIE_MSBS
  14021. * Bits 31:0
  14022. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14023. * message with its preceding host->target stats request message.
  14024. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14025. *
  14026. * Stats Information Element tag-length header fields:
  14027. * - STAT_TYPE
  14028. * Bits 4:0
  14029. * Purpose: identifies the type of statistics info held in the
  14030. * following information element
  14031. * Value: htt_dbg_stats_type
  14032. * - STATUS
  14033. * Bits 7:5
  14034. * Purpose: indicate whether the requested stats are present
  14035. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  14036. * the completion of the stats entry series
  14037. * - LENGTH
  14038. * Bits 31:16
  14039. * Purpose: indicate the stats information size
  14040. * Value: This field specifies the number of bytes of stats information
  14041. * that follows the element tag-length header.
  14042. * It is expected but not required that this length is a multiple of
  14043. * 4 bytes. Even if the length is not an integer multiple of 4, the
  14044. * subsequent stats entry header will begin on a 4-byte aligned
  14045. * boundary.
  14046. */
  14047. #define HTT_T2H_STATS_COOKIE_SIZE 8
  14048. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  14049. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  14050. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  14051. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  14052. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  14053. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  14054. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  14055. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14056. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  14057. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  14058. do { \
  14059. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  14060. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  14061. } while (0)
  14062. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  14063. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  14064. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  14065. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  14066. do { \
  14067. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  14068. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  14069. } while (0)
  14070. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  14071. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  14072. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  14073. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14074. do { \
  14075. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  14076. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  14077. } while (0)
  14078. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  14079. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  14080. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  14081. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  14082. #define HTT_MAX_AGGR 64
  14083. #define HTT_HL_MAX_AGGR 18
  14084. /**
  14085. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  14086. *
  14087. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  14088. *
  14089. * @details
  14090. * The following field definitions describe the format of the HTT host
  14091. * to target frag_desc/msdu_ext bank configuration message.
  14092. * The message contains the based address and the min and max id of the
  14093. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  14094. * MSDU_EXT/FRAG_DESC.
  14095. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  14096. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  14097. * the hardware does the mapping/translation.
  14098. *
  14099. * Total banks that can be configured is configured to 16.
  14100. *
  14101. * This should be called before any TX has be initiated by the HTT
  14102. *
  14103. * |31 16|15 8|7 5|4 0|
  14104. * |------------------------------------------------------------|
  14105. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  14106. * |------------------------------------------------------------|
  14107. * | BANK0_BASE_ADDRESS (bits 31:0) |
  14108. #if HTT_PADDR64
  14109. * | BANK0_BASE_ADDRESS (bits 63:32) |
  14110. #endif
  14111. * |------------------------------------------------------------|
  14112. * | ... |
  14113. * |------------------------------------------------------------|
  14114. * | BANK15_BASE_ADDRESS (bits 31:0) |
  14115. #if HTT_PADDR64
  14116. * | BANK15_BASE_ADDRESS (bits 63:32) |
  14117. #endif
  14118. * |------------------------------------------------------------|
  14119. * | BANK0_MAX_ID | BANK0_MIN_ID |
  14120. * |------------------------------------------------------------|
  14121. * | ... |
  14122. * |------------------------------------------------------------|
  14123. * | BANK15_MAX_ID | BANK15_MIN_ID |
  14124. * |------------------------------------------------------------|
  14125. * Header fields:
  14126. * - MSG_TYPE
  14127. * Bits 7:0
  14128. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  14129. * for systems with 64-bit format for bus addresses:
  14130. * - BANKx_BASE_ADDRESS_LO
  14131. * Bits 31:0
  14132. * Purpose: Provide a mechanism to specify the base address of the
  14133. * MSDU_EXT bank physical/bus address.
  14134. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  14135. * - BANKx_BASE_ADDRESS_HI
  14136. * Bits 31:0
  14137. * Purpose: Provide a mechanism to specify the base address of the
  14138. * MSDU_EXT bank physical/bus address.
  14139. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  14140. * for systems with 32-bit format for bus addresses:
  14141. * - BANKx_BASE_ADDRESS
  14142. * Bits 31:0
  14143. * Purpose: Provide a mechanism to specify the base address of the
  14144. * MSDU_EXT bank physical/bus address.
  14145. * Value: MSDU_EXT bank physical / bus address
  14146. * - BANKx_MIN_ID
  14147. * Bits 15:0
  14148. * Purpose: Provide a mechanism to specify the min index that needs to
  14149. * mapped.
  14150. * - BANKx_MAX_ID
  14151. * Bits 31:16
  14152. * Purpose: Provide a mechanism to specify the max index that needs to
  14153. * mapped.
  14154. *
  14155. */
  14156. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  14157. * safe value.
  14158. * @note MAX supported banks is 16.
  14159. */
  14160. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  14161. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  14162. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  14163. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  14164. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  14165. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  14166. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  14167. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  14168. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  14169. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  14170. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  14171. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  14172. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  14173. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  14174. do { \
  14175. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  14176. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  14177. } while (0)
  14178. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  14179. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  14180. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  14181. do { \
  14182. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  14183. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  14184. } while (0)
  14185. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  14186. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  14187. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  14188. do { \
  14189. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  14190. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  14191. } while (0)
  14192. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  14193. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  14194. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  14195. do { \
  14196. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  14197. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  14198. } while (0)
  14199. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  14200. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  14201. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  14202. do { \
  14203. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  14204. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  14205. } while (0)
  14206. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  14207. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  14208. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  14209. do { \
  14210. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  14211. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  14212. } while (0)
  14213. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  14214. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  14215. /*
  14216. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  14217. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  14218. * addresses are stored in a XXX-bit field.
  14219. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  14220. * htt_tx_frag_desc64_bank_cfg_t structs.
  14221. */
  14222. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  14223. _paddr_bits_, \
  14224. _paddr__bank_base_address_) \
  14225. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  14226. /** word 0 \
  14227. * msg_type: 8, \
  14228. * pdev_id: 2, \
  14229. * swap: 1, \
  14230. * reserved0: 5, \
  14231. * num_banks: 8, \
  14232. * desc_size: 8; \
  14233. */ \
  14234. A_UINT32 word0; \
  14235. /* \
  14236. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  14237. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  14238. * the second A_UINT32). \
  14239. */ \
  14240. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  14241. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  14242. } POSTPACK
  14243. /* define htt_tx_frag_desc32_bank_cfg_t */
  14244. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  14245. /* define htt_tx_frag_desc64_bank_cfg_t */
  14246. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  14247. /*
  14248. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  14249. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  14250. */
  14251. #if HTT_PADDR64
  14252. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  14253. #else
  14254. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  14255. #endif
  14256. /**
  14257. * @brief target -> host HTT TX Credit total count update message definition
  14258. *
  14259. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  14260. *
  14261. *|31 16|15|14 9| 8 |7 0 |
  14262. *|---------------------+--+----------+-------+----------|
  14263. *|cur htt credit delta | Q| reserved | sign | msg type |
  14264. *|------------------------------------------------------|
  14265. *
  14266. * Header fields:
  14267. * - MSG_TYPE
  14268. * Bits 7:0
  14269. * Purpose: identifies this as a htt tx credit delta update message
  14270. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  14271. * - SIGN
  14272. * Bits 8
  14273. * identifies whether credit delta is positive or negative
  14274. * Value:
  14275. * - 0x0: credit delta is positive, rebalance in some buffers
  14276. * - 0x1: credit delta is negative, rebalance out some buffers
  14277. * - reserved
  14278. * Bits 14:9
  14279. * Value: 0x0
  14280. * - TXQ_GRP
  14281. * Bit 15
  14282. * Purpose: indicates whether any tx queue group information elements
  14283. * are appended to the tx credit update message
  14284. * Value: 0 -> no tx queue group information element is present
  14285. * 1 -> a tx queue group information element immediately follows
  14286. * - DELTA_COUNT
  14287. * Bits 31:16
  14288. * Purpose: Specify current htt credit delta absolute count
  14289. */
  14290. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  14291. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  14292. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  14293. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  14294. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  14295. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  14296. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  14297. do { \
  14298. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  14299. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  14300. } while (0)
  14301. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  14302. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  14303. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  14304. do { \
  14305. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  14306. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  14307. } while (0)
  14308. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  14309. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  14310. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  14311. do { \
  14312. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  14313. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  14314. } while (0)
  14315. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  14316. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  14317. #define HTT_TX_CREDIT_MSG_BYTES 4
  14318. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  14319. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  14320. /**
  14321. * @brief HTT WDI_IPA Operation Response Message
  14322. *
  14323. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  14324. *
  14325. * @details
  14326. * HTT WDI_IPA Operation Response message is sent by target
  14327. * to host confirming suspend or resume operation.
  14328. * |31 24|23 16|15 8|7 0|
  14329. * |----------------+----------------+----------------+----------------|
  14330. * | op_code | Rsvd | msg_type |
  14331. * |-------------------------------------------------------------------|
  14332. * | Rsvd | Response len |
  14333. * |-------------------------------------------------------------------|
  14334. * | |
  14335. * | Response-type specific info |
  14336. * | |
  14337. * | |
  14338. * |-------------------------------------------------------------------|
  14339. * Header fields:
  14340. * - MSG_TYPE
  14341. * Bits 7:0
  14342. * Purpose: Identifies this as WDI_IPA Operation Response message
  14343. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  14344. * - OP_CODE
  14345. * Bits 31:16
  14346. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  14347. * value: = enum htt_wdi_ipa_op_code
  14348. * - RSP_LEN
  14349. * Bits 16:0
  14350. * Purpose: length for the response-type specific info
  14351. * value: = length in bytes for response-type specific info
  14352. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  14353. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  14354. */
  14355. PREPACK struct htt_wdi_ipa_op_response_t
  14356. {
  14357. /* DWORD 0: flags and meta-data */
  14358. A_UINT32
  14359. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  14360. reserved1: 8,
  14361. op_code: 16;
  14362. A_UINT32
  14363. rsp_len: 16,
  14364. reserved2: 16;
  14365. } POSTPACK;
  14366. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  14367. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  14368. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  14369. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  14370. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  14371. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  14372. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  14373. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  14374. do { \
  14375. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  14376. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  14377. } while (0)
  14378. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  14379. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  14380. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  14381. do { \
  14382. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  14383. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  14384. } while (0)
  14385. enum htt_phy_mode {
  14386. htt_phy_mode_11a = 0,
  14387. htt_phy_mode_11g = 1,
  14388. htt_phy_mode_11b = 2,
  14389. htt_phy_mode_11g_only = 3,
  14390. htt_phy_mode_11na_ht20 = 4,
  14391. htt_phy_mode_11ng_ht20 = 5,
  14392. htt_phy_mode_11na_ht40 = 6,
  14393. htt_phy_mode_11ng_ht40 = 7,
  14394. htt_phy_mode_11ac_vht20 = 8,
  14395. htt_phy_mode_11ac_vht40 = 9,
  14396. htt_phy_mode_11ac_vht80 = 10,
  14397. htt_phy_mode_11ac_vht20_2g = 11,
  14398. htt_phy_mode_11ac_vht40_2g = 12,
  14399. htt_phy_mode_11ac_vht80_2g = 13,
  14400. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  14401. htt_phy_mode_11ac_vht160 = 15,
  14402. htt_phy_mode_max,
  14403. };
  14404. /**
  14405. * @brief target -> host HTT channel change indication
  14406. *
  14407. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  14408. *
  14409. * @details
  14410. * Specify when a channel change occurs.
  14411. * This allows the host to precisely determine which rx frames arrived
  14412. * on the old channel and which rx frames arrived on the new channel.
  14413. *
  14414. *|31 |7 0 |
  14415. *|-------------------------------------------+----------|
  14416. *| reserved | msg type |
  14417. *|------------------------------------------------------|
  14418. *| primary_chan_center_freq_mhz |
  14419. *|------------------------------------------------------|
  14420. *| contiguous_chan1_center_freq_mhz |
  14421. *|------------------------------------------------------|
  14422. *| contiguous_chan2_center_freq_mhz |
  14423. *|------------------------------------------------------|
  14424. *| phy_mode |
  14425. *|------------------------------------------------------|
  14426. *
  14427. * Header fields:
  14428. * - MSG_TYPE
  14429. * Bits 7:0
  14430. * Purpose: identifies this as a htt channel change indication message
  14431. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  14432. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  14433. * Bits 31:0
  14434. * Purpose: identify the (center of the) new 20 MHz primary channel
  14435. * Value: center frequency of the 20 MHz primary channel, in MHz units
  14436. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  14437. * Bits 31:0
  14438. * Purpose: identify the (center of the) contiguous frequency range
  14439. * comprising the new channel.
  14440. * For example, if the new channel is a 80 MHz channel extending
  14441. * 60 MHz beyond the primary channel, this field would be 30 larger
  14442. * than the primary channel center frequency field.
  14443. * Value: center frequency of the contiguous frequency range comprising
  14444. * the full channel in MHz units
  14445. * (80+80 channels also use the CONTIG_CHAN2 field)
  14446. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  14447. * Bits 31:0
  14448. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  14449. * within a VHT 80+80 channel.
  14450. * This field is only relevant for VHT 80+80 channels.
  14451. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  14452. * channel (arbitrary value for cases besides VHT 80+80)
  14453. * - PHY_MODE
  14454. * Bits 31:0
  14455. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  14456. * and band
  14457. * Value: htt_phy_mode enum value
  14458. */
  14459. PREPACK struct htt_chan_change_t
  14460. {
  14461. /* DWORD 0: flags and meta-data */
  14462. A_UINT32
  14463. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  14464. reserved1: 24;
  14465. A_UINT32 primary_chan_center_freq_mhz;
  14466. A_UINT32 contig_chan1_center_freq_mhz;
  14467. A_UINT32 contig_chan2_center_freq_mhz;
  14468. A_UINT32 phy_mode;
  14469. } POSTPACK;
  14470. /*
  14471. * Due to historical / backwards-compatibility reasons, maintain the
  14472. * below htt_chan_change_msg struct definition, which needs to be
  14473. * consistent with the above htt_chan_change_t struct definition
  14474. * (aside from the htt_chan_change_t definition including the msg_type
  14475. * dword within the message, and the htt_chan_change_msg only containing
  14476. * the payload of the message that follows the msg_type dword).
  14477. */
  14478. PREPACK struct htt_chan_change_msg {
  14479. A_UINT32 chan_mhz; /* frequency in mhz */
  14480. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  14481. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  14482. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  14483. } POSTPACK;
  14484. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  14485. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  14486. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  14487. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  14488. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  14489. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  14490. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  14491. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  14492. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  14493. do { \
  14494. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  14495. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  14496. } while (0)
  14497. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  14498. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  14499. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  14500. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  14501. do { \
  14502. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  14503. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  14504. } while (0)
  14505. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  14506. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  14507. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  14508. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  14509. do { \
  14510. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  14511. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  14512. } while (0)
  14513. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  14514. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  14515. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  14516. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  14517. do { \
  14518. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  14519. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  14520. } while (0)
  14521. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  14522. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  14523. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  14524. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  14525. /**
  14526. * @brief rx offload packet error message
  14527. *
  14528. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  14529. *
  14530. * @details
  14531. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  14532. * of target payload like mic err.
  14533. *
  14534. * |31 24|23 16|15 8|7 0|
  14535. * |----------------+----------------+----------------+----------------|
  14536. * | tid | vdev_id | msg_sub_type | msg_type |
  14537. * |-------------------------------------------------------------------|
  14538. * : (sub-type dependent content) :
  14539. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14540. * Header fields:
  14541. * - msg_type
  14542. * Bits 7:0
  14543. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  14544. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  14545. * - msg_sub_type
  14546. * Bits 15:8
  14547. * Purpose: Identifies which type of rx error is reported by this message
  14548. * value: htt_rx_ofld_pkt_err_type
  14549. * - vdev_id
  14550. * Bits 23:16
  14551. * Purpose: Identifies which vdev received the erroneous rx frame
  14552. * value:
  14553. * - tid
  14554. * Bits 31:24
  14555. * Purpose: Identifies the traffic type of the rx frame
  14556. * value:
  14557. *
  14558. * - The payload fields used if the sub-type == MIC error are shown below.
  14559. * Note - MIC err is per MSDU, while PN is per MPDU.
  14560. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  14561. * with MIC err in A-MSDU case, so FW will send only one HTT message
  14562. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  14563. * instead of sending separate HTT messages for each wrong MSDU within
  14564. * the MPDU.
  14565. *
  14566. * |31 24|23 16|15 8|7 0|
  14567. * |----------------+----------------+----------------+----------------|
  14568. * | Rsvd | key_id | peer_id |
  14569. * |-------------------------------------------------------------------|
  14570. * | receiver MAC addr 31:0 |
  14571. * |-------------------------------------------------------------------|
  14572. * | Rsvd | receiver MAC addr 47:32 |
  14573. * |-------------------------------------------------------------------|
  14574. * | transmitter MAC addr 31:0 |
  14575. * |-------------------------------------------------------------------|
  14576. * | Rsvd | transmitter MAC addr 47:32 |
  14577. * |-------------------------------------------------------------------|
  14578. * | PN 31:0 |
  14579. * |-------------------------------------------------------------------|
  14580. * | Rsvd | PN 47:32 |
  14581. * |-------------------------------------------------------------------|
  14582. * - peer_id
  14583. * Bits 15:0
  14584. * Purpose: identifies which peer is frame is from
  14585. * value:
  14586. * - key_id
  14587. * Bits 23:16
  14588. * Purpose: identifies key_id of rx frame
  14589. * value:
  14590. * - RA_31_0 (receiver MAC addr 31:0)
  14591. * Bits 31:0
  14592. * Purpose: identifies by MAC address which vdev received the frame
  14593. * value: MAC address lower 4 bytes
  14594. * - RA_47_32 (receiver MAC addr 47:32)
  14595. * Bits 15:0
  14596. * Purpose: identifies by MAC address which vdev received the frame
  14597. * value: MAC address upper 2 bytes
  14598. * - TA_31_0 (transmitter MAC addr 31:0)
  14599. * Bits 31:0
  14600. * Purpose: identifies by MAC address which peer transmitted the frame
  14601. * value: MAC address lower 4 bytes
  14602. * - TA_47_32 (transmitter MAC addr 47:32)
  14603. * Bits 15:0
  14604. * Purpose: identifies by MAC address which peer transmitted the frame
  14605. * value: MAC address upper 2 bytes
  14606. * - PN_31_0
  14607. * Bits 31:0
  14608. * Purpose: Identifies pn of rx frame
  14609. * value: PN lower 4 bytes
  14610. * - PN_47_32
  14611. * Bits 15:0
  14612. * Purpose: Identifies pn of rx frame
  14613. * value:
  14614. * TKIP or CCMP: PN upper 2 bytes
  14615. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  14616. */
  14617. enum htt_rx_ofld_pkt_err_type {
  14618. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  14619. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  14620. };
  14621. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  14622. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  14623. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  14624. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  14625. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  14626. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  14627. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  14628. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  14629. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  14630. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  14631. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  14632. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  14633. do { \
  14634. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  14635. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  14636. } while (0)
  14637. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  14638. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  14639. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  14640. do { \
  14641. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  14642. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  14643. } while (0)
  14644. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  14645. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  14646. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  14647. do { \
  14648. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  14649. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  14650. } while (0)
  14651. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  14652. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  14653. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  14654. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  14655. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  14656. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  14657. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  14658. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  14659. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  14660. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  14661. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  14662. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  14663. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  14664. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  14665. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  14666. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  14667. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  14668. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  14669. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  14670. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  14671. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  14672. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  14673. do { \
  14674. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  14675. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  14676. } while (0)
  14677. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  14678. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  14679. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  14680. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  14681. do { \
  14682. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  14683. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  14684. } while (0)
  14685. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  14686. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  14687. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  14688. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  14689. do { \
  14690. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  14691. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  14692. } while (0)
  14693. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  14694. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  14695. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  14696. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  14697. do { \
  14698. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  14699. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  14700. } while (0)
  14701. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  14702. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  14703. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  14704. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  14705. do { \
  14706. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  14707. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  14708. } while (0)
  14709. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  14710. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  14711. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  14712. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  14713. do { \
  14714. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  14715. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  14716. } while (0)
  14717. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  14718. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  14719. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  14720. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  14721. do { \
  14722. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  14723. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  14724. } while (0)
  14725. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  14726. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  14727. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  14728. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  14729. do { \
  14730. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  14731. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  14732. } while (0)
  14733. /**
  14734. * @brief target -> host peer rate report message
  14735. *
  14736. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  14737. *
  14738. * @details
  14739. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  14740. * justified rate of all the peers.
  14741. *
  14742. * |31 24|23 16|15 8|7 0|
  14743. * |----------------+----------------+----------------+----------------|
  14744. * | peer_count | | msg_type |
  14745. * |-------------------------------------------------------------------|
  14746. * : Payload (variant number of peer rate report) :
  14747. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14748. * Header fields:
  14749. * - msg_type
  14750. * Bits 7:0
  14751. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  14752. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  14753. * - reserved
  14754. * Bits 15:8
  14755. * Purpose:
  14756. * value:
  14757. * - peer_count
  14758. * Bits 31:16
  14759. * Purpose: Specify how many peer rate report elements are present in the payload.
  14760. * value:
  14761. *
  14762. * Payload:
  14763. * There are variant number of peer rate report follow the first 32 bits.
  14764. * The peer rate report is defined as follows.
  14765. *
  14766. * |31 20|19 16|15 0|
  14767. * |-----------------------+---------+---------------------------------|-
  14768. * | reserved | phy | peer_id | \
  14769. * |-------------------------------------------------------------------| -> report #0
  14770. * | rate | /
  14771. * |-----------------------+---------+---------------------------------|-
  14772. * | reserved | phy | peer_id | \
  14773. * |-------------------------------------------------------------------| -> report #1
  14774. * | rate | /
  14775. * |-----------------------+---------+---------------------------------|-
  14776. * | reserved | phy | peer_id | \
  14777. * |-------------------------------------------------------------------| -> report #2
  14778. * | rate | /
  14779. * |-------------------------------------------------------------------|-
  14780. * : :
  14781. * : :
  14782. * : :
  14783. * :-------------------------------------------------------------------:
  14784. *
  14785. * - peer_id
  14786. * Bits 15:0
  14787. * Purpose: identify the peer
  14788. * value:
  14789. * - phy
  14790. * Bits 19:16
  14791. * Purpose: identify which phy is in use
  14792. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  14793. * Please see enum htt_peer_report_phy_type for detail.
  14794. * - reserved
  14795. * Bits 31:20
  14796. * Purpose:
  14797. * value:
  14798. * - rate
  14799. * Bits 31:0
  14800. * Purpose: represent the justified rate of the peer specified by peer_id
  14801. * value:
  14802. */
  14803. enum htt_peer_rate_report_phy_type {
  14804. HTT_PEER_RATE_REPORT_11B = 0,
  14805. HTT_PEER_RATE_REPORT_11A_G,
  14806. HTT_PEER_RATE_REPORT_11N,
  14807. HTT_PEER_RATE_REPORT_11AC,
  14808. };
  14809. #define HTT_PEER_RATE_REPORT_SIZE 8
  14810. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  14811. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  14812. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  14813. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  14814. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  14815. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  14816. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  14817. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  14818. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  14819. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  14820. do { \
  14821. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  14822. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  14823. } while (0)
  14824. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  14825. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  14826. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  14827. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  14828. do { \
  14829. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  14830. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  14831. } while (0)
  14832. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  14833. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  14834. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  14835. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  14836. do { \
  14837. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  14838. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  14839. } while (0)
  14840. /**
  14841. * @brief target -> host flow pool map message
  14842. *
  14843. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  14844. *
  14845. * @details
  14846. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  14847. * a flow of descriptors.
  14848. *
  14849. * This message is in TLV format and indicates the parameters to be setup a
  14850. * flow in the host. Each entry indicates that a particular flow ID is ready to
  14851. * receive descriptors from a specified pool.
  14852. *
  14853. * The message would appear as follows:
  14854. *
  14855. * |31 24|23 16|15 8|7 0|
  14856. * |----------------+----------------+----------------+----------------|
  14857. * header | reserved | num_flows | msg_type |
  14858. * |-------------------------------------------------------------------|
  14859. * | |
  14860. * : payload :
  14861. * | |
  14862. * |-------------------------------------------------------------------|
  14863. *
  14864. * The header field is one DWORD long and is interpreted as follows:
  14865. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  14866. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  14867. * this message
  14868. * b'16-31 - reserved: These bits are reserved for future use
  14869. *
  14870. * Payload:
  14871. * The payload would contain multiple objects of the following structure. Each
  14872. * object represents a flow.
  14873. *
  14874. * |31 24|23 16|15 8|7 0|
  14875. * |----------------+----------------+----------------+----------------|
  14876. * header | reserved | num_flows | msg_type |
  14877. * |-------------------------------------------------------------------|
  14878. * payload0| flow_type |
  14879. * |-------------------------------------------------------------------|
  14880. * | flow_id |
  14881. * |-------------------------------------------------------------------|
  14882. * | reserved0 | flow_pool_id |
  14883. * |-------------------------------------------------------------------|
  14884. * | reserved1 | flow_pool_size |
  14885. * |-------------------------------------------------------------------|
  14886. * | reserved2 |
  14887. * |-------------------------------------------------------------------|
  14888. * payload1| flow_type |
  14889. * |-------------------------------------------------------------------|
  14890. * | flow_id |
  14891. * |-------------------------------------------------------------------|
  14892. * | reserved0 | flow_pool_id |
  14893. * |-------------------------------------------------------------------|
  14894. * | reserved1 | flow_pool_size |
  14895. * |-------------------------------------------------------------------|
  14896. * | reserved2 |
  14897. * |-------------------------------------------------------------------|
  14898. * | . |
  14899. * | . |
  14900. * | . |
  14901. * |-------------------------------------------------------------------|
  14902. *
  14903. * Each payload is 5 DWORDS long and is interpreted as follows:
  14904. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  14905. * this flow is associated. It can be VDEV, peer,
  14906. * or tid (AC). Based on enum htt_flow_type.
  14907. *
  14908. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14909. * object. For flow_type vdev it is set to the
  14910. * vdevid, for peer it is peerid and for tid, it is
  14911. * tid_num.
  14912. *
  14913. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  14914. * in the host for this flow
  14915. * b'16:31 - reserved0: This field in reserved for the future. In case
  14916. * we have a hierarchical implementation (HCM) of
  14917. * pools, it can be used to indicate the ID of the
  14918. * parent-pool.
  14919. *
  14920. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  14921. * Descriptors for this flow will be
  14922. * allocated from this pool in the host.
  14923. * b'16:31 - reserved1: This field in reserved for the future. In case
  14924. * we have a hierarchical implementation of pools,
  14925. * it can be used to indicate the max number of
  14926. * descriptors in the pool. The b'0:15 can be used
  14927. * to indicate min number of descriptors in the
  14928. * HCM scheme.
  14929. *
  14930. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  14931. * we have a hierarchical implementation of pools,
  14932. * b'0:15 can be used to indicate the
  14933. * priority-based borrowing (PBB) threshold of
  14934. * the flow's pool. The b'16:31 are still left
  14935. * reserved.
  14936. */
  14937. enum htt_flow_type {
  14938. FLOW_TYPE_VDEV = 0,
  14939. /* Insert new flow types above this line */
  14940. };
  14941. PREPACK struct htt_flow_pool_map_payload_t {
  14942. A_UINT32 flow_type;
  14943. A_UINT32 flow_id;
  14944. A_UINT32 flow_pool_id:16,
  14945. reserved0:16;
  14946. A_UINT32 flow_pool_size:16,
  14947. reserved1:16;
  14948. A_UINT32 reserved2;
  14949. } POSTPACK;
  14950. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  14951. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  14952. (sizeof(struct htt_flow_pool_map_payload_t))
  14953. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  14954. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  14955. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  14956. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  14957. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  14958. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  14959. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  14960. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  14961. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  14962. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  14963. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  14964. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  14965. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  14966. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  14967. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  14968. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  14969. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  14970. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  14971. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  14972. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  14973. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  14974. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  14975. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  14976. do { \
  14977. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  14978. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  14979. } while (0)
  14980. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  14981. do { \
  14982. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  14983. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  14984. } while (0)
  14985. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  14986. do { \
  14987. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  14988. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  14989. } while (0)
  14990. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  14991. do { \
  14992. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  14993. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  14994. } while (0)
  14995. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  14996. do { \
  14997. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  14998. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  14999. } while (0)
  15000. /**
  15001. * @brief target -> host flow pool unmap message
  15002. *
  15003. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  15004. *
  15005. * @details
  15006. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  15007. * down a flow of descriptors.
  15008. * This message indicates that for the flow (whose ID is provided) is wanting
  15009. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  15010. * pool of descriptors from where descriptors are being allocated for this
  15011. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  15012. * be unmapped by the host.
  15013. *
  15014. * The message would appear as follows:
  15015. *
  15016. * |31 24|23 16|15 8|7 0|
  15017. * |----------------+----------------+----------------+----------------|
  15018. * | reserved0 | msg_type |
  15019. * |-------------------------------------------------------------------|
  15020. * | flow_type |
  15021. * |-------------------------------------------------------------------|
  15022. * | flow_id |
  15023. * |-------------------------------------------------------------------|
  15024. * | reserved1 | flow_pool_id |
  15025. * |-------------------------------------------------------------------|
  15026. *
  15027. * The message is interpreted as follows:
  15028. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  15029. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  15030. * b'8:31 - reserved0: Reserved for future use
  15031. *
  15032. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  15033. * this flow is associated. It can be VDEV, peer,
  15034. * or tid (AC). Based on enum htt_flow_type.
  15035. *
  15036. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  15037. * object. For flow_type vdev it is set to the
  15038. * vdevid, for peer it is peerid and for tid, it is
  15039. * tid_num.
  15040. *
  15041. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  15042. * used in the host for this flow
  15043. * b'16:31 - reserved0: This field in reserved for the future.
  15044. *
  15045. */
  15046. PREPACK struct htt_flow_pool_unmap_t {
  15047. A_UINT32 msg_type:8,
  15048. reserved0:24;
  15049. A_UINT32 flow_type;
  15050. A_UINT32 flow_id;
  15051. A_UINT32 flow_pool_id:16,
  15052. reserved1:16;
  15053. } POSTPACK;
  15054. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  15055. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  15056. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  15057. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  15058. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  15059. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  15060. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  15061. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  15062. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  15063. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  15064. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  15065. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  15066. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  15067. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  15068. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  15069. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  15070. do { \
  15071. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  15072. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  15073. } while (0)
  15074. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  15075. do { \
  15076. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  15077. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  15078. } while (0)
  15079. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  15080. do { \
  15081. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  15082. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  15083. } while (0)
  15084. /**
  15085. * @brief target -> host SRING setup done message
  15086. *
  15087. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  15088. *
  15089. * @details
  15090. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  15091. * SRNG ring setup is done
  15092. *
  15093. * This message indicates whether the last setup operation is successful.
  15094. * It will be sent to host when host set respose_required bit in
  15095. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  15096. * The message would appear as follows:
  15097. *
  15098. * |31 24|23 16|15 8|7 0|
  15099. * |--------------- +----------------+----------------+----------------|
  15100. * | setup_status | ring_id | pdev_id | msg_type |
  15101. * |-------------------------------------------------------------------|
  15102. *
  15103. * The message is interpreted as follows:
  15104. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  15105. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  15106. * b'8:15 - pdev_id:
  15107. * 0 (for rings at SOC/UMAC level),
  15108. * 1/2/3 mac id (for rings at LMAC level)
  15109. * b'16:23 - ring_id: Identify the ring which is set up
  15110. * More details can be got from enum htt_srng_ring_id
  15111. * b'24:31 - setup_status: Indicate status of setup operation
  15112. * Refer to htt_ring_setup_status
  15113. */
  15114. PREPACK struct htt_sring_setup_done_t {
  15115. A_UINT32 msg_type: 8,
  15116. pdev_id: 8,
  15117. ring_id: 8,
  15118. setup_status: 8;
  15119. } POSTPACK;
  15120. enum htt_ring_setup_status {
  15121. htt_ring_setup_status_ok = 0,
  15122. htt_ring_setup_status_error,
  15123. };
  15124. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  15125. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  15126. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  15127. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  15128. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  15129. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  15130. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  15131. do { \
  15132. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  15133. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  15134. } while (0)
  15135. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  15136. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  15137. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  15138. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  15139. HTT_SRING_SETUP_DONE_RING_ID_S)
  15140. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  15141. do { \
  15142. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  15143. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  15144. } while (0)
  15145. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  15146. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  15147. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  15148. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  15149. HTT_SRING_SETUP_DONE_STATUS_S)
  15150. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  15151. do { \
  15152. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  15153. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  15154. } while (0)
  15155. /**
  15156. * @brief target -> flow map flow info
  15157. *
  15158. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  15159. *
  15160. * @details
  15161. * HTT TX map flow entry with tqm flow pointer
  15162. * Sent from firmware to host to add tqm flow pointer in corresponding
  15163. * flow search entry. Flow metadata is replayed back to host as part of this
  15164. * struct to enable host to find the specific flow search entry
  15165. *
  15166. * The message would appear as follows:
  15167. *
  15168. * |31 28|27 18|17 14|13 8|7 0|
  15169. * |-------+------------------------------------------+----------------|
  15170. * | rsvd0 | fse_hsh_idx | msg_type |
  15171. * |-------------------------------------------------------------------|
  15172. * | rsvd1 | tid | peer_id |
  15173. * |-------------------------------------------------------------------|
  15174. * | tqm_flow_pntr_lo |
  15175. * |-------------------------------------------------------------------|
  15176. * | tqm_flow_pntr_hi |
  15177. * |-------------------------------------------------------------------|
  15178. * | fse_meta_data |
  15179. * |-------------------------------------------------------------------|
  15180. *
  15181. * The message is interpreted as follows:
  15182. *
  15183. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  15184. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  15185. *
  15186. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  15187. * for this flow entry
  15188. *
  15189. * dword0 - b'28:31 - rsvd0: Reserved for future use
  15190. *
  15191. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  15192. *
  15193. * dword1 - b'14:17 - tid
  15194. *
  15195. * dword1 - b'18:31 - rsvd1: Reserved for future use
  15196. *
  15197. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  15198. *
  15199. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  15200. *
  15201. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  15202. * given by host
  15203. */
  15204. PREPACK struct htt_tx_map_flow_info {
  15205. A_UINT32
  15206. msg_type: 8,
  15207. fse_hsh_idx: 20,
  15208. rsvd0: 4;
  15209. A_UINT32
  15210. peer_id: 14,
  15211. tid: 4,
  15212. rsvd1: 14;
  15213. A_UINT32 tqm_flow_pntr_lo;
  15214. A_UINT32 tqm_flow_pntr_hi;
  15215. struct htt_tx_flow_metadata fse_meta_data;
  15216. } POSTPACK;
  15217. /* DWORD 0 */
  15218. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  15219. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  15220. /* DWORD 1 */
  15221. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  15222. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  15223. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  15224. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  15225. /* DWORD 0 */
  15226. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  15227. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  15228. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  15229. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  15230. do { \
  15231. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  15232. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  15233. } while (0)
  15234. /* DWORD 1 */
  15235. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  15236. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  15237. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  15238. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  15239. do { \
  15240. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  15241. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  15242. } while (0)
  15243. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  15244. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  15245. HTT_TX_MAP_FLOW_INFO_TID_S)
  15246. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  15247. do { \
  15248. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  15249. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  15250. } while (0)
  15251. /*
  15252. * htt_dbg_ext_stats_status -
  15253. * present - The requested stats have been delivered in full.
  15254. * This indicates that either the stats information was contained
  15255. * in its entirety within this message, or else this message
  15256. * completes the delivery of the requested stats info that was
  15257. * partially delivered through earlier STATS_CONF messages.
  15258. * partial - The requested stats have been delivered in part.
  15259. * One or more subsequent STATS_CONF messages with the same
  15260. * cookie value will be sent to deliver the remainder of the
  15261. * information.
  15262. * error - The requested stats could not be delivered, for example due
  15263. * to a shortage of memory to construct a message holding the
  15264. * requested stats.
  15265. * invalid - The requested stat type is either not recognized, or the
  15266. * target is configured to not gather the stats type in question.
  15267. */
  15268. enum htt_dbg_ext_stats_status {
  15269. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  15270. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  15271. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  15272. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  15273. };
  15274. /**
  15275. * @brief target -> host ppdu stats upload
  15276. *
  15277. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  15278. *
  15279. * @details
  15280. * The following field definitions describe the format of the HTT target
  15281. * to host ppdu stats indication message.
  15282. *
  15283. *
  15284. * |31 16|15 12|11 10|9 8|7 0 |
  15285. * |----------------------------------------------------------------------|
  15286. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  15287. * |----------------------------------------------------------------------|
  15288. * | ppdu_id |
  15289. * |----------------------------------------------------------------------|
  15290. * | Timestamp in us |
  15291. * |----------------------------------------------------------------------|
  15292. * | reserved |
  15293. * |----------------------------------------------------------------------|
  15294. * | type-specific stats info |
  15295. * | (see htt_ppdu_stats.h) |
  15296. * |----------------------------------------------------------------------|
  15297. * Header fields:
  15298. * - MSG_TYPE
  15299. * Bits 7:0
  15300. * Purpose: Identifies this is a PPDU STATS indication
  15301. * message.
  15302. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  15303. * - mac_id
  15304. * Bits 9:8
  15305. * Purpose: mac_id of this ppdu_id
  15306. * Value: 0-3
  15307. * - pdev_id
  15308. * Bits 11:10
  15309. * Purpose: pdev_id of this ppdu_id
  15310. * Value: 0-3
  15311. * 0 (for rings at SOC level),
  15312. * 1/2/3 PDEV -> 0/1/2
  15313. * - payload_size
  15314. * Bits 31:16
  15315. * Purpose: total tlv size
  15316. * Value: payload_size in bytes
  15317. */
  15318. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  15319. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  15320. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  15321. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  15322. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  15323. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  15324. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  15325. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  15326. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  15327. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  15328. do { \
  15329. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  15330. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  15331. } while (0)
  15332. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  15333. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  15334. HTT_T2H_PPDU_STATS_MAC_ID_S)
  15335. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  15336. do { \
  15337. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  15338. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  15339. } while (0)
  15340. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  15341. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  15342. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  15343. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  15344. do { \
  15345. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  15346. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  15347. } while (0)
  15348. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  15349. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  15350. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  15351. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  15352. do { \
  15353. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  15354. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  15355. } while (0)
  15356. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  15357. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  15358. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  15359. /* htt_t2h_ppdu_stats_ind_hdr_t
  15360. * This struct contains the fields within the header of the
  15361. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  15362. * stats info.
  15363. * This struct assumes little-endian layout, and thus is only
  15364. * suitable for use within processors known to be little-endian
  15365. * (such as the target).
  15366. * In contrast, the above macros provide endian-portable methods
  15367. * to get and set the bitfields within this PPDU_STATS_IND header.
  15368. */
  15369. typedef struct {
  15370. A_UINT32 msg_type: 8, /* bits 7:0 */
  15371. mac_id: 2, /* bits 9:8 */
  15372. pdev_id: 2, /* bits 11:10 */
  15373. reserved1: 4, /* bits 15:12 */
  15374. payload_size: 16; /* bits 31:16 */
  15375. A_UINT32 ppdu_id;
  15376. A_UINT32 timestamp_us;
  15377. A_UINT32 reserved2;
  15378. } htt_t2h_ppdu_stats_ind_hdr_t;
  15379. /**
  15380. * @brief target -> host extended statistics upload
  15381. *
  15382. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  15383. *
  15384. * @details
  15385. * The following field definitions describe the format of the HTT target
  15386. * to host stats upload confirmation message.
  15387. * The message contains a cookie echoed from the HTT host->target stats
  15388. * upload request, which identifies which request the confirmation is
  15389. * for, and a single stats can span over multiple HTT stats indication
  15390. * due to the HTT message size limitation so every HTT ext stats indication
  15391. * will have tag-length-value stats information elements.
  15392. * The tag-length header for each HTT stats IND message also includes a
  15393. * status field, to indicate whether the request for the stat type in
  15394. * question was fully met, partially met, unable to be met, or invalid
  15395. * (if the stat type in question is disabled in the target).
  15396. * A Done bit 1's indicate the end of the of stats info elements.
  15397. *
  15398. *
  15399. * |31 16|15 12|11|10 8|7 5|4 0|
  15400. * |--------------------------------------------------------------|
  15401. * | reserved | msg type |
  15402. * |--------------------------------------------------------------|
  15403. * | cookie LSBs |
  15404. * |--------------------------------------------------------------|
  15405. * | cookie MSBs |
  15406. * |--------------------------------------------------------------|
  15407. * | stats entry length | rsvd | D| S | stat type |
  15408. * |--------------------------------------------------------------|
  15409. * | type-specific stats info |
  15410. * | (see htt_stats.h) |
  15411. * |--------------------------------------------------------------|
  15412. * Header fields:
  15413. * - MSG_TYPE
  15414. * Bits 7:0
  15415. * Purpose: Identifies this is a extended statistics upload confirmation
  15416. * message.
  15417. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  15418. * - COOKIE_LSBS
  15419. * Bits 31:0
  15420. * Purpose: Provide a mechanism to match a target->host stats confirmation
  15421. * message with its preceding host->target stats request message.
  15422. * Value: LSBs of the opaque cookie specified by the host-side requestor
  15423. * - COOKIE_MSBS
  15424. * Bits 31:0
  15425. * Purpose: Provide a mechanism to match a target->host stats confirmation
  15426. * message with its preceding host->target stats request message.
  15427. * Value: MSBs of the opaque cookie specified by the host-side requestor
  15428. *
  15429. * Stats Information Element tag-length header fields:
  15430. * - STAT_TYPE
  15431. * Bits 7:0
  15432. * Purpose: identifies the type of statistics info held in the
  15433. * following information element
  15434. * Value: htt_dbg_ext_stats_type
  15435. * - STATUS
  15436. * Bits 10:8
  15437. * Purpose: indicate whether the requested stats are present
  15438. * Value: htt_dbg_ext_stats_status
  15439. * - DONE
  15440. * Bits 11
  15441. * Purpose:
  15442. * Indicates the completion of the stats entry, this will be the last
  15443. * stats conf HTT segment for the requested stats type.
  15444. * Value:
  15445. * 0 -> the stats retrieval is ongoing
  15446. * 1 -> the stats retrieval is complete
  15447. * - LENGTH
  15448. * Bits 31:16
  15449. * Purpose: indicate the stats information size
  15450. * Value: This field specifies the number of bytes of stats information
  15451. * that follows the element tag-length header.
  15452. * It is expected but not required that this length is a multiple of
  15453. * 4 bytes.
  15454. */
  15455. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  15456. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  15457. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  15458. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  15459. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  15460. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  15461. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  15462. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  15463. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  15464. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  15465. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  15466. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  15467. do { \
  15468. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  15469. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  15470. } while (0)
  15471. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  15472. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  15473. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  15474. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  15475. do { \
  15476. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  15477. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  15478. } while (0)
  15479. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  15480. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  15481. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  15482. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  15483. do { \
  15484. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  15485. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  15486. } while (0)
  15487. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  15488. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  15489. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  15490. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  15491. do { \
  15492. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  15493. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  15494. } while (0)
  15495. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  15496. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  15497. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  15498. /**
  15499. * @brief target -> host streaming statistics upload
  15500. *
  15501. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  15502. *
  15503. * @details
  15504. * The following field definitions describe the format of the HTT target
  15505. * to host streaming stats upload indication message.
  15506. * The host can use a STREAMING_STATS_REQ message to enable the target to
  15507. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  15508. * use the STREAMING_STATS_REQ message to halt the target's production of
  15509. * STREAMING_STATS_IND messages.
  15510. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  15511. * the stats enabled by the host's STREAMING_STATS_REQ message.
  15512. *
  15513. * |31 8|7 0|
  15514. * |--------------------------------------------------------------|
  15515. * | reserved | msg type |
  15516. * |--------------------------------------------------------------|
  15517. * | type-specific stats info |
  15518. * | (see htt_stats.h) |
  15519. * |--------------------------------------------------------------|
  15520. * Header fields:
  15521. * - MSG_TYPE
  15522. * Bits 7:0
  15523. * Purpose: Identifies this as a streaming statistics upload indication
  15524. * message.
  15525. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  15526. */
  15527. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  15528. typedef enum {
  15529. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  15530. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  15531. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  15532. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  15533. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  15534. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  15535. /* Reserved from 128 - 255 for target internal use.*/
  15536. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  15537. } HTT_PEER_TYPE;
  15538. /** macro to convert MAC address from char array to HTT word format */
  15539. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  15540. (phtt_mac_addr)->mac_addr31to0 = \
  15541. (((c_macaddr)[0] << 0) | \
  15542. ((c_macaddr)[1] << 8) | \
  15543. ((c_macaddr)[2] << 16) | \
  15544. ((c_macaddr)[3] << 24)); \
  15545. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  15546. } while (0)
  15547. /**
  15548. * @brief target -> host monitor mac header indication message
  15549. *
  15550. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  15551. *
  15552. * @details
  15553. * The following diagram shows the format of the monitor mac header message
  15554. * sent from the target to the host.
  15555. * This message is primarily sent when promiscuous rx mode is enabled.
  15556. * One message is sent per rx PPDU.
  15557. *
  15558. * |31 24|23 16|15 8|7 0|
  15559. * |-------------------------------------------------------------|
  15560. * | peer_id | reserved0 | msg_type |
  15561. * |-------------------------------------------------------------|
  15562. * | reserved1 | num_mpdu |
  15563. * |-------------------------------------------------------------|
  15564. * | struct hw_rx_desc |
  15565. * | (see wal_rx_desc.h) |
  15566. * |-------------------------------------------------------------|
  15567. * | struct ieee80211_frame_addr4 |
  15568. * | (see ieee80211_defs.h) |
  15569. * |-------------------------------------------------------------|
  15570. * | struct ieee80211_frame_addr4 |
  15571. * | (see ieee80211_defs.h) |
  15572. * |-------------------------------------------------------------|
  15573. * | ...... |
  15574. * |-------------------------------------------------------------|
  15575. *
  15576. * Header fields:
  15577. * - msg_type
  15578. * Bits 7:0
  15579. * Purpose: Identifies this is a monitor mac header indication message.
  15580. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  15581. * - peer_id
  15582. * Bits 31:16
  15583. * Purpose: Software peer id given by host during association,
  15584. * During promiscuous mode, the peer ID will be invalid (0xFF)
  15585. * for rx PPDUs received from unassociated peers.
  15586. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  15587. * - num_mpdu
  15588. * Bits 15:0
  15589. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  15590. * delivered within the message.
  15591. * Value: 1 to 32
  15592. * num_mpdu is limited to a maximum value of 32, due to buffer
  15593. * size limits. For PPDUs with more than 32 MPDUs, only the
  15594. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  15595. * the PPDU will be provided.
  15596. */
  15597. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  15598. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  15599. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  15600. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  15601. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  15602. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  15603. do { \
  15604. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  15605. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  15606. } while (0)
  15607. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  15608. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  15609. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  15610. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  15611. do { \
  15612. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  15613. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  15614. } while (0)
  15615. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  15616. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  15617. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  15618. /**
  15619. * @brief target -> host flow pool resize Message
  15620. *
  15621. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  15622. *
  15623. * @details
  15624. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  15625. * the flow pool associated with the specified ID is resized
  15626. *
  15627. * The message would appear as follows:
  15628. *
  15629. * |31 16|15 8|7 0|
  15630. * |---------------------------------+----------------+----------------|
  15631. * | reserved0 | Msg type |
  15632. * |-------------------------------------------------------------------|
  15633. * | flow pool new size | flow pool ID |
  15634. * |-------------------------------------------------------------------|
  15635. *
  15636. * The message is interpreted as follows:
  15637. * b'0:7 - msg_type: This will be set to 0x21
  15638. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  15639. *
  15640. * b'0:15 - flow pool ID: Existing flow pool ID
  15641. *
  15642. * b'16:31 - flow pool new size: new pool size for existing flow pool ID
  15643. *
  15644. */
  15645. PREPACK struct htt_flow_pool_resize_t {
  15646. A_UINT32 msg_type:8,
  15647. reserved0:24;
  15648. A_UINT32 flow_pool_id:16,
  15649. flow_pool_new_size:16;
  15650. } POSTPACK;
  15651. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  15652. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  15653. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  15654. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  15655. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  15656. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  15657. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  15658. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  15659. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  15660. do { \
  15661. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  15662. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  15663. } while (0)
  15664. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  15665. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  15666. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  15667. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  15668. do { \
  15669. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  15670. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  15671. } while (0)
  15672. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  15673. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  15674. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  15675. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  15676. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  15677. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  15678. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  15679. /*
  15680. * The read and write indices point to the data within the host buffer.
  15681. * Because the first 4 bytes of the host buffer is used for the read index and
  15682. * the next 4 bytes for the write index, the data itself starts at offset 8.
  15683. * The read index and write index are the byte offsets from the base of the
  15684. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  15685. * Refer the ASCII text picture below.
  15686. */
  15687. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  15688. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  15689. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  15690. /*
  15691. ***************************************************************************
  15692. *
  15693. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15694. *
  15695. ***************************************************************************
  15696. *
  15697. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  15698. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  15699. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  15700. * written into the Host memory region mentioned below.
  15701. *
  15702. * Read index is updated by the Host. At any point of time, the read index will
  15703. * indicate the index that will next be read by the Host. The read index is
  15704. * in units of bytes offset from the base of the meta-data buffer.
  15705. *
  15706. * Write index is updated by the FW. At any point of time, the write index will
  15707. * indicate from where the FW can start writing any new data. The write index is
  15708. * in units of bytes offset from the base of the meta-data buffer.
  15709. *
  15710. * If the Host is not fast enough in reading the CFR data, any new capture data
  15711. * would be dropped if there is no space left to write the new captures.
  15712. *
  15713. * The last 4 bytes of the memory region will have the magic pattern
  15714. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  15715. * not overrun the host buffer.
  15716. *
  15717. * ,--------------------. read and write indices store the
  15718. * | | byte offset from the base of the
  15719. * | ,--------+--------. meta-data buffer to the next
  15720. * | | | | location within the data buffer
  15721. * | | v v that will be read / written
  15722. * ************************************************************************
  15723. * * Read * Write * * Magic *
  15724. * * index * index * CFR data1 ...... CFR data N * pattern *
  15725. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  15726. * ************************************************************************
  15727. * |<---------- data buffer ---------->|
  15728. *
  15729. * |<----------------- meta-data buffer allocated in Host ----------------|
  15730. *
  15731. * Note:
  15732. * - Considering the 4 bytes needed to store the Read index (R) and the
  15733. * Write index (W), the initial value is as follows:
  15734. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  15735. * - Buffer empty condition:
  15736. * R = W
  15737. *
  15738. * Regarding CFR data format:
  15739. * --------------------------
  15740. *
  15741. * Each CFR tone is stored in HW as 16-bits with the following format:
  15742. * {bits[15:12], bits[11:6], bits[5:0]} =
  15743. * {unsigned exponent (4 bits),
  15744. * signed mantissa_real (6 bits),
  15745. * signed mantissa_imag (6 bits)}
  15746. *
  15747. * CFR_real = mantissa_real * 2^(exponent-5)
  15748. * CFR_imag = mantissa_imag * 2^(exponent-5)
  15749. *
  15750. *
  15751. * The CFR data is written to the 16-bit unsigned output array (buff) in
  15752. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  15753. *
  15754. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  15755. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  15756. * .
  15757. * .
  15758. * .
  15759. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  15760. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  15761. */
  15762. /* Bandwidth of peer CFR captures */
  15763. typedef enum {
  15764. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  15765. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  15766. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  15767. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  15768. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  15769. HTT_PEER_CFR_CAPTURE_BW_MAX,
  15770. } HTT_PEER_CFR_CAPTURE_BW;
  15771. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  15772. * was captured
  15773. */
  15774. typedef enum {
  15775. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  15776. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  15777. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  15778. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  15779. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  15780. } HTT_PEER_CFR_CAPTURE_MODE;
  15781. typedef enum {
  15782. /* This message type is currently used for the below purpose:
  15783. *
  15784. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  15785. * wmi_peer_cfr_capture_cmd.
  15786. * If payload_present bit is set to 0 then the associated memory region
  15787. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  15788. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  15789. * message; the CFR dump will be present at the end of the message,
  15790. * after the chan_phy_mode.
  15791. */
  15792. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  15793. /* Always keep this last */
  15794. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  15795. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  15796. /**
  15797. * @brief target -> host CFR dump completion indication message definition
  15798. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  15799. *
  15800. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  15801. *
  15802. * @details
  15803. * The following diagram shows the format of the Channel Frequency Response
  15804. * (CFR) dump completion indication. This inidcation is sent to the Host when
  15805. * the channel capture of a peer is copied by Firmware into the Host memory
  15806. *
  15807. * **************************************************************************
  15808. *
  15809. * Message format when the CFR capture message type is
  15810. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15811. *
  15812. * **************************************************************************
  15813. *
  15814. * |31 16|15 |8|7 0|
  15815. * |----------------------------------------------------------------|
  15816. * header: | reserved |P| msg_type |
  15817. * word 0 | | | |
  15818. * |----------------------------------------------------------------|
  15819. * payload: | cfr_capture_msg_type |
  15820. * word 1 | |
  15821. * |----------------------------------------------------------------|
  15822. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  15823. * word 2 | | | | | | | | |
  15824. * |----------------------------------------------------------------|
  15825. * | mac_addr31to0 |
  15826. * word 3 | |
  15827. * |----------------------------------------------------------------|
  15828. * | unused / reserved | mac_addr47to32 |
  15829. * word 4 | | |
  15830. * |----------------------------------------------------------------|
  15831. * | index |
  15832. * word 5 | |
  15833. * |----------------------------------------------------------------|
  15834. * | length |
  15835. * word 6 | |
  15836. * |----------------------------------------------------------------|
  15837. * | timestamp |
  15838. * word 7 | |
  15839. * |----------------------------------------------------------------|
  15840. * | counter |
  15841. * word 8 | |
  15842. * |----------------------------------------------------------------|
  15843. * | chan_mhz |
  15844. * word 9 | |
  15845. * |----------------------------------------------------------------|
  15846. * | band_center_freq1 |
  15847. * word 10 | |
  15848. * |----------------------------------------------------------------|
  15849. * | band_center_freq2 |
  15850. * word 11 | |
  15851. * |----------------------------------------------------------------|
  15852. * | chan_phy_mode |
  15853. * word 12 | |
  15854. * |----------------------------------------------------------------|
  15855. * where,
  15856. * P - payload present bit (payload_present explained below)
  15857. * req_id - memory request id (mem_req_id explained below)
  15858. * S - status field (status explained below)
  15859. * capbw - capture bandwidth (capture_bw explained below)
  15860. * mode - mode of capture (mode explained below)
  15861. * sts - space time streams (sts_count explained below)
  15862. * chbw - channel bandwidth (channel_bw explained below)
  15863. * captype - capture type (cap_type explained below)
  15864. *
  15865. * The following field definitions describe the format of the CFR dump
  15866. * completion indication sent from the target to the host
  15867. *
  15868. * Header fields:
  15869. *
  15870. * Word 0
  15871. * - msg_type
  15872. * Bits 7:0
  15873. * Purpose: Identifies this as CFR TX completion indication
  15874. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  15875. * - payload_present
  15876. * Bit 8
  15877. * Purpose: Identifies how CFR data is sent to host
  15878. * Value: 0 - If CFR Payload is written to host memory
  15879. * 1 - If CFR Payload is sent as part of HTT message
  15880. * (This is the requirement for SDIO/USB where it is
  15881. * not possible to write CFR data to host memory)
  15882. * - reserved
  15883. * Bits 31:9
  15884. * Purpose: Reserved
  15885. * Value: 0
  15886. *
  15887. * Payload fields:
  15888. *
  15889. * Word 1
  15890. * - cfr_capture_msg_type
  15891. * Bits 31:0
  15892. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  15893. * to specify the format used for the remainder of the message
  15894. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15895. * (currently only MSG_TYPE_1 is defined)
  15896. *
  15897. * Word 2
  15898. * - mem_req_id
  15899. * Bits 6:0
  15900. * Purpose: Contain the mem request id of the region where the CFR capture
  15901. * has been stored - of type WMI_HOST_MEM_REQ_ID
  15902. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  15903. this value is invalid)
  15904. * - status
  15905. * Bit 7
  15906. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  15907. * Value: 1 (True) - Successful; 0 (False) - Not successful
  15908. * - capture_bw
  15909. * Bits 10:8
  15910. * Purpose: Carry the bandwidth of the CFR capture
  15911. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  15912. * - mode
  15913. * Bits 13:11
  15914. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  15915. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  15916. * - sts_count
  15917. * Bits 16:14
  15918. * Purpose: Carry the number of space time streams
  15919. * Value: Number of space time streams
  15920. * - channel_bw
  15921. * Bits 19:17
  15922. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  15923. * measurement
  15924. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  15925. * - cap_type
  15926. * Bits 23:20
  15927. * Purpose: Carry the type of the capture
  15928. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  15929. * - vdev_id
  15930. * Bits 31:24
  15931. * Purpose: Carry the virtual device id
  15932. * Value: vdev ID
  15933. *
  15934. * Word 3
  15935. * - mac_addr31to0
  15936. * Bits 31:0
  15937. * Purpose: Contain the bits 31:0 of the peer MAC address
  15938. * Value: Bits 31:0 of the peer MAC address
  15939. *
  15940. * Word 4
  15941. * - mac_addr47to32
  15942. * Bits 15:0
  15943. * Purpose: Contain the bits 47:32 of the peer MAC address
  15944. * Value: Bits 47:32 of the peer MAC address
  15945. *
  15946. * Word 5
  15947. * - index
  15948. * Bits 31:0
  15949. * Purpose: Contain the index at which this CFR dump was written in the Host
  15950. * allocated memory. This index is the number of bytes from the base address.
  15951. * Value: Index position
  15952. *
  15953. * Word 6
  15954. * - length
  15955. * Bits 31:0
  15956. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  15957. * Value: Length of the CFR capture of the peer
  15958. *
  15959. * Word 7
  15960. * - timestamp
  15961. * Bits 31:0
  15962. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  15963. * clock used for this timestamp is private to the target and not visible to
  15964. * the host i.e., Host can interpret only the relative timestamp deltas from
  15965. * one message to the next, but can't interpret the absolute timestamp from a
  15966. * single message.
  15967. * Value: Timestamp in microseconds
  15968. *
  15969. * Word 8
  15970. * - counter
  15971. * Bits 31:0
  15972. * Purpose: Carry the count of the current CFR capture from FW. This is
  15973. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  15974. * in host memory)
  15975. * Value: Count of the current CFR capture
  15976. *
  15977. * Word 9
  15978. * - chan_mhz
  15979. * Bits 31:0
  15980. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  15981. * Value: Primary 20 channel frequency
  15982. *
  15983. * Word 10
  15984. * - band_center_freq1
  15985. * Bits 31:0
  15986. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  15987. * Value: Center frequency 1 in MHz
  15988. *
  15989. * Word 11
  15990. * - band_center_freq2
  15991. * Bits 31:0
  15992. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  15993. * the VDEV
  15994. * 80plus80 mode
  15995. * Value: Center frequency 2 in MHz
  15996. *
  15997. * Word 12
  15998. * - chan_phy_mode
  15999. * Bits 31:0
  16000. * Purpose: Carry the phy mode of the channel, of the VDEV
  16001. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  16002. */
  16003. PREPACK struct htt_cfr_dump_ind_type_1 {
  16004. A_UINT32 mem_req_id:7,
  16005. status:1,
  16006. capture_bw:3,
  16007. mode:3,
  16008. sts_count:3,
  16009. channel_bw:3,
  16010. cap_type:4,
  16011. vdev_id:8;
  16012. htt_mac_addr addr;
  16013. A_UINT32 index;
  16014. A_UINT32 length;
  16015. A_UINT32 timestamp;
  16016. A_UINT32 counter;
  16017. struct htt_chan_change_msg chan;
  16018. } POSTPACK;
  16019. PREPACK struct htt_cfr_dump_compl_ind {
  16020. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  16021. union {
  16022. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  16023. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  16024. /* If there is a need to change the memory layout and its associated
  16025. * HTT indication format, a new CFR capture message type can be
  16026. * introduced and added into this union.
  16027. */
  16028. };
  16029. } POSTPACK;
  16030. /*
  16031. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  16032. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  16033. */
  16034. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  16035. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  16036. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  16037. do { \
  16038. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  16039. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  16040. } while(0)
  16041. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  16042. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  16043. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  16044. /*
  16045. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  16046. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  16047. */
  16048. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  16049. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  16050. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  16051. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  16052. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  16053. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  16054. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  16055. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  16056. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  16057. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  16058. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  16059. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  16060. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  16061. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  16062. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  16063. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  16064. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  16065. do { \
  16066. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  16067. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  16068. } while (0)
  16069. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  16070. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  16071. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  16072. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  16073. do { \
  16074. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  16075. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  16076. } while (0)
  16077. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  16078. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  16079. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  16080. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  16081. do { \
  16082. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  16083. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  16084. } while (0)
  16085. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  16086. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  16087. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  16088. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  16089. do { \
  16090. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  16091. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  16092. } while (0)
  16093. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  16094. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  16095. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  16096. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  16097. do { \
  16098. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  16099. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  16100. } while (0)
  16101. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  16102. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  16103. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  16104. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  16105. do { \
  16106. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  16107. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  16108. } while (0)
  16109. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  16110. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  16111. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  16112. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  16113. do { \
  16114. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  16115. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  16116. } while (0)
  16117. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  16118. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  16119. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  16120. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  16121. do { \
  16122. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  16123. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  16124. } while (0)
  16125. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  16126. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  16127. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  16128. /**
  16129. * @brief target -> host peer (PPDU) stats message
  16130. *
  16131. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  16132. *
  16133. * @details
  16134. * This message is generated by FW when FW is sending stats to host
  16135. * about one or more PPDUs that the FW has transmitted to one or more peers.
  16136. * This message is sent autonomously by the target rather than upon request
  16137. * by the host.
  16138. * The following field definitions describe the format of the HTT target
  16139. * to host peer stats indication message.
  16140. *
  16141. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  16142. * or more PPDU stats records.
  16143. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  16144. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  16145. * then the message would start with the
  16146. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  16147. * below.
  16148. *
  16149. * |31 16|15|14|13 11|10 9|8|7 0|
  16150. * |-------------------------------------------------------------|
  16151. * | reserved |MSG_TYPE |
  16152. * |-------------------------------------------------------------|
  16153. * rec 0 | TLV header |
  16154. * rec 0 |-------------------------------------------------------------|
  16155. * rec 0 | ppdu successful bytes |
  16156. * rec 0 |-------------------------------------------------------------|
  16157. * rec 0 | ppdu retry bytes |
  16158. * rec 0 |-------------------------------------------------------------|
  16159. * rec 0 | ppdu failed bytes |
  16160. * rec 0 |-------------------------------------------------------------|
  16161. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  16162. * rec 0 |-------------------------------------------------------------|
  16163. * rec 0 | retried MSDUs | successful MSDUs |
  16164. * rec 0 |-------------------------------------------------------------|
  16165. * rec 0 | TX duration | failed MSDUs |
  16166. * rec 0 |-------------------------------------------------------------|
  16167. * ...
  16168. * |-------------------------------------------------------------|
  16169. * rec N | TLV header |
  16170. * rec N |-------------------------------------------------------------|
  16171. * rec N | ppdu successful bytes |
  16172. * rec N |-------------------------------------------------------------|
  16173. * rec N | ppdu retry bytes |
  16174. * rec N |-------------------------------------------------------------|
  16175. * rec N | ppdu failed bytes |
  16176. * rec N |-------------------------------------------------------------|
  16177. * rec N | peer id | S|SG| BW | BA |A|rate code|
  16178. * rec N |-------------------------------------------------------------|
  16179. * rec N | retried MSDUs | successful MSDUs |
  16180. * rec N |-------------------------------------------------------------|
  16181. * rec N | TX duration | failed MSDUs |
  16182. * rec N |-------------------------------------------------------------|
  16183. *
  16184. * where:
  16185. * A = is A-MPDU flag
  16186. * BA = block-ack failure flags
  16187. * BW = bandwidth spec
  16188. * SG = SGI enabled spec
  16189. * S = skipped rate ctrl
  16190. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  16191. *
  16192. * Header
  16193. * ------
  16194. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  16195. * dword0 - b'8:31 - reserved : Reserved for future use
  16196. *
  16197. * payload include below peer_stats information
  16198. * --------------------------------------------
  16199. * @TLV : HTT_PPDU_STATS_INFO_TLV
  16200. * @tx_success_bytes : total successful bytes in the PPDU.
  16201. * @tx_retry_bytes : total retried bytes in the PPDU.
  16202. * @tx_failed_bytes : total failed bytes in the PPDU.
  16203. * @tx_ratecode : rate code used for the PPDU.
  16204. * @is_ampdu : Indicates PPDU is AMPDU or not.
  16205. * @ba_ack_failed : BA/ACK failed for this PPDU
  16206. * b00 -> BA received
  16207. * b01 -> BA failed once
  16208. * b10 -> BA failed twice, when HW retry is enabled.
  16209. * @bw : BW
  16210. * b00 -> 20 MHz
  16211. * b01 -> 40 MHz
  16212. * b10 -> 80 MHz
  16213. * b11 -> 160 MHz (or 80+80)
  16214. * @sg : SGI enabled
  16215. * @s : skipped ratectrl
  16216. * @peer_id : peer id
  16217. * @tx_success_msdus : successful MSDUs
  16218. * @tx_retry_msdus : retried MSDUs
  16219. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  16220. * @tx_duration : Tx duration for the PPDU (microsecond units)
  16221. */
  16222. /**
  16223. * @brief target -> host backpressure event
  16224. *
  16225. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  16226. *
  16227. * @details
  16228. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  16229. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  16230. * This message will only be sent if the backpressure condition has existed
  16231. * continuously for an initial period (100 ms).
  16232. * Repeat messages with updated information will be sent after each
  16233. * subsequent period (100 ms) as long as the backpressure remains unabated.
  16234. * This message indicates the ring id along with current head and tail index
  16235. * locations (i.e. write and read indices).
  16236. * The backpressure time indicates the time in ms for which continuous
  16237. * backpressure has been observed in the ring.
  16238. *
  16239. * The message format is as follows:
  16240. *
  16241. * |31 24|23 16|15 8|7 0|
  16242. * |----------------+----------------+----------------+----------------|
  16243. * | ring_id | ring_type | pdev_id | msg_type |
  16244. * |-------------------------------------------------------------------|
  16245. * | tail_idx | head_idx |
  16246. * |-------------------------------------------------------------------|
  16247. * | backpressure_time_ms |
  16248. * |-------------------------------------------------------------------|
  16249. *
  16250. * The message is interpreted as follows:
  16251. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  16252. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  16253. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  16254. * 1, 2, 3 indicates pdev_id 0,1,2 and
  16255. * the msg is for LMAC ring.
  16256. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  16257. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  16258. * htt_backpressure_lmac_ring_id. This represents
  16259. * the ring id for which continuous backpressure
  16260. * is seen
  16261. *
  16262. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  16263. * the ring indicated by the ring_id
  16264. *
  16265. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  16266. * the ring indicated by the ring id
  16267. *
  16268. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continuous
  16269. * backpressure has been seen in the ring
  16270. * indicated by the ring_id.
  16271. * Units = milliseconds
  16272. */
  16273. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  16274. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  16275. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  16276. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  16277. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  16278. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  16279. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  16280. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  16281. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  16282. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  16283. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  16284. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  16285. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  16286. do { \
  16287. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  16288. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  16289. } while (0)
  16290. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  16291. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  16292. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  16293. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  16294. do { \
  16295. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  16296. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  16297. } while (0)
  16298. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  16299. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  16300. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  16301. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  16302. do { \
  16303. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  16304. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  16305. } while (0)
  16306. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  16307. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  16308. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  16309. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  16310. do { \
  16311. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  16312. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  16313. } while (0)
  16314. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  16315. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  16316. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  16317. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  16318. do { \
  16319. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  16320. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  16321. } while (0)
  16322. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  16323. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  16324. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  16325. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  16326. do { \
  16327. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  16328. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  16329. } while (0)
  16330. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  16331. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  16332. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  16333. enum htt_backpressure_ring_type {
  16334. HTT_SW_RING_TYPE_UMAC,
  16335. HTT_SW_RING_TYPE_LMAC,
  16336. HTT_SW_RING_TYPE_MAX,
  16337. };
  16338. /* Ring id for which the message is sent to host */
  16339. enum htt_backpressure_umac_ringid {
  16340. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  16341. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  16342. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  16343. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  16344. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  16345. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  16346. HTT_SW_RING_IDX_REO_REO2FW_RING,
  16347. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  16348. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  16349. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  16350. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  16351. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  16352. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  16353. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  16354. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  16355. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  16356. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  16357. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  16358. HTT_SW_UMAC_RING_IDX_MAX,
  16359. };
  16360. enum htt_backpressure_lmac_ringid {
  16361. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  16362. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  16363. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  16364. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  16365. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  16366. HTT_SW_RING_IDX_RXDMA2FW_RING,
  16367. HTT_SW_RING_IDX_RXDMA2SW_RING,
  16368. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  16369. HTT_SW_RING_IDX_RXDMA2REO_RING,
  16370. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  16371. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  16372. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  16373. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  16374. HTT_SW_LMAC_RING_IDX_MAX,
  16375. };
  16376. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  16377. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  16378. pdev_id: 8,
  16379. ring_type: 8, /* htt_backpressure_ring_type */
  16380. /*
  16381. * ring_id holds an enum value from either
  16382. * htt_backpressure_umac_ringid or
  16383. * htt_backpressure_lmac_ringid, based on
  16384. * the ring_type setting.
  16385. */
  16386. ring_id: 8;
  16387. A_UINT16 head_idx;
  16388. A_UINT16 tail_idx;
  16389. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  16390. } POSTPACK;
  16391. /*
  16392. * Defines two 32 bit words that can be used by the target to indicate a per
  16393. * user RU allocation and rate information.
  16394. *
  16395. * This information is currently provided in the "sw_response_reference_ptr"
  16396. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  16397. * "rx_ppdu_end_user_stats" TLV.
  16398. *
  16399. * VALID:
  16400. * The consumer of these words must explicitly check the valid bit,
  16401. * and only attempt interpretation of any of the remaining fields if
  16402. * the valid bit is set to 1.
  16403. *
  16404. * VERSION:
  16405. * The consumer of these words must also explicitly check the version bit,
  16406. * and only use the V0 definition if the VERSION field is set to 0.
  16407. *
  16408. * Version 1 is currently undefined, with the exception of the VALID and
  16409. * VERSION fields.
  16410. *
  16411. * Version 0:
  16412. *
  16413. * The fields below are duplicated per BW.
  16414. *
  16415. * The consumer must determine which BW field to use, based on the UL OFDMA
  16416. * PPDU BW indicated by HW.
  16417. *
  16418. * RU_START: RU26 start index for the user.
  16419. * Note that this is always using the RU26 index, regardless
  16420. * of the actual RU assigned to the user
  16421. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  16422. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  16423. *
  16424. * For example, 20MHz (the value in the top row is RU_START)
  16425. *
  16426. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  16427. * RU Size 1 (52): | | | | | |
  16428. * RU Size 2 (106): | | | |
  16429. * RU Size 3 (242): | |
  16430. *
  16431. * RU_SIZE: Indicates the RU size, as defined by enum
  16432. * htt_ul_ofdma_user_info_ru_size.
  16433. *
  16434. * LDPC: LDPC enabled (if 0, BCC is used)
  16435. *
  16436. * DCM: DCM enabled
  16437. *
  16438. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  16439. * |---------------------------------+--------------------------------|
  16440. * |Ver|Valid| FW internal |
  16441. * |---------------------------------+--------------------------------|
  16442. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  16443. * |---------------------------------+--------------------------------|
  16444. */
  16445. enum htt_ul_ofdma_user_info_ru_size {
  16446. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  16447. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  16448. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  16449. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  16450. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  16451. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  16452. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  16453. };
  16454. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  16455. struct htt_ul_ofdma_user_info_v0 {
  16456. A_UINT32 word0;
  16457. A_UINT32 word1;
  16458. };
  16459. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  16460. A_UINT32 w0_fw_rsvd:30; \
  16461. A_UINT32 w0_valid:1; \
  16462. A_UINT32 w0_version:1;
  16463. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  16464. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  16465. };
  16466. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  16467. A_UINT32 w1_nss:3; \
  16468. A_UINT32 w1_mcs:4; \
  16469. A_UINT32 w1_ldpc:1; \
  16470. A_UINT32 w1_dcm:1; \
  16471. A_UINT32 w1_ru_start:7; \
  16472. A_UINT32 w1_ru_size:3; \
  16473. A_UINT32 w1_trig_type:4; \
  16474. A_UINT32 w1_unused:9;
  16475. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  16476. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  16477. };
  16478. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  16479. A_UINT32 w0_fw_rsvd:27; \
  16480. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  16481. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  16482. 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) */
  16483. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  16484. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  16485. };
  16486. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  16487. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  16488. A_UINT32 w1_trig_type:4; \
  16489. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  16490. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  16491. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  16492. };
  16493. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  16494. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  16495. union {
  16496. A_UINT32 word0;
  16497. struct {
  16498. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  16499. };
  16500. };
  16501. union {
  16502. A_UINT32 word1;
  16503. struct {
  16504. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  16505. };
  16506. };
  16507. } POSTPACK;
  16508. /*
  16509. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  16510. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  16511. * this should be picked.
  16512. */
  16513. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  16514. union {
  16515. A_UINT32 word0;
  16516. struct {
  16517. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  16518. };
  16519. };
  16520. union {
  16521. A_UINT32 word1;
  16522. struct {
  16523. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  16524. };
  16525. };
  16526. } POSTPACK;
  16527. enum HTT_UL_OFDMA_TRIG_TYPE {
  16528. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  16529. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  16530. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  16531. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  16532. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  16533. };
  16534. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  16535. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  16536. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  16537. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  16538. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  16539. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  16540. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  16541. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  16542. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  16543. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  16544. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  16545. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  16546. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  16547. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  16548. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  16549. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  16550. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  16551. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  16552. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  16553. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  16554. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  16555. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  16556. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  16557. /*--- word 0 ---*/
  16558. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  16559. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  16560. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  16561. do { \
  16562. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  16563. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  16564. } while (0)
  16565. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  16566. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  16567. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  16568. do { \
  16569. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  16570. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  16571. } while (0)
  16572. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  16573. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  16574. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  16575. do { \
  16576. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  16577. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  16578. } while (0)
  16579. /*--- word 1 ---*/
  16580. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  16581. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  16582. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  16583. do { \
  16584. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  16585. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  16586. } while (0)
  16587. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  16588. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  16589. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  16590. do { \
  16591. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  16592. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  16593. } while (0)
  16594. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  16595. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  16596. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  16597. do { \
  16598. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  16599. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  16600. } while (0)
  16601. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  16602. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  16603. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  16604. do { \
  16605. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  16606. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  16607. } while (0)
  16608. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  16609. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  16610. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  16611. do { \
  16612. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  16613. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  16614. } while (0)
  16615. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  16616. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  16617. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  16618. do { \
  16619. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  16620. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  16621. } while (0)
  16622. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  16623. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  16624. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  16625. do { \
  16626. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  16627. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  16628. } while (0)
  16629. /**
  16630. * @brief target -> host channel calibration data message
  16631. *
  16632. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  16633. *
  16634. * @brief host -> target channel calibration data message
  16635. *
  16636. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  16637. *
  16638. * @details
  16639. * The following field definitions describe the format of the channel
  16640. * calibration data message sent from the target to the host when
  16641. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  16642. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  16643. * The message is defined as htt_chan_caldata_msg followed by a variable
  16644. * number of 32-bit character values.
  16645. *
  16646. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  16647. * |------------------------------------------------------------------|
  16648. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  16649. * |------------------------------------------------------------------|
  16650. * | payload size | mhz |
  16651. * |------------------------------------------------------------------|
  16652. * | center frequency 2 | center frequency 1 |
  16653. * |------------------------------------------------------------------|
  16654. * | check sum |
  16655. * |------------------------------------------------------------------|
  16656. * | payload |
  16657. * |------------------------------------------------------------------|
  16658. * message info field:
  16659. * - MSG_TYPE
  16660. * Bits 7:0
  16661. * Purpose: identifies this as a channel calibration data message
  16662. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  16663. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  16664. * - SUB_TYPE
  16665. * Bits 11:8
  16666. * Purpose: T2H: indicates whether target is providing chan cal data
  16667. * to the host to store, or requesting that the host
  16668. * download previously-stored data.
  16669. * H2T: indicates whether the host is providing the requested
  16670. * channel cal data, or if it is rejecting the data
  16671. * request because it does not have the requested data.
  16672. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  16673. * - CHKSUM_VALID
  16674. * Bit 12
  16675. * Purpose: indicates if the checksum field is valid
  16676. * value:
  16677. * - FRAG
  16678. * Bit 19:16
  16679. * Purpose: indicates the fragment index for message
  16680. * value: 0 for first fragment, 1 for second fragment, ...
  16681. * - APPEND
  16682. * Bit 20
  16683. * Purpose: indicates if this is the last fragment
  16684. * value: 0 = final fragment, 1 = more fragments will be appended
  16685. *
  16686. * channel and payload size field
  16687. * - MHZ
  16688. * Bits 15:0
  16689. * Purpose: indicates the channel primary frequency
  16690. * Value:
  16691. * - PAYLOAD_SIZE
  16692. * Bits 31:16
  16693. * Purpose: indicates the bytes of calibration data in payload
  16694. * Value:
  16695. *
  16696. * center frequency field
  16697. * - CENTER FREQUENCY 1
  16698. * Bits 15:0
  16699. * Purpose: indicates the channel center frequency
  16700. * Value: channel center frequency, in MHz units
  16701. * - CENTER FREQUENCY 2
  16702. * Bits 31:16
  16703. * Purpose: indicates the secondary channel center frequency,
  16704. * only for 11acvht 80plus80 mode
  16705. * Value: secondary channel center frequency, in MHz units, if applicable
  16706. *
  16707. * checksum field
  16708. * - CHECK_SUM
  16709. * Bits 31:0
  16710. * Purpose: check the payload data, it is just for this fragment.
  16711. * This is intended for the target to check that the channel
  16712. * calibration data returned by the host is the unmodified data
  16713. * that was previously provided to the host by the target.
  16714. * value: checksum of fragment payload
  16715. */
  16716. PREPACK struct htt_chan_caldata_msg {
  16717. /* DWORD 0: message info */
  16718. A_UINT32
  16719. msg_type: 8,
  16720. sub_type: 4 ,
  16721. chksum_valid: 1, /** 1:valid, 0:invalid */
  16722. reserved1: 3,
  16723. frag_idx: 4, /** fragment index for calibration data */
  16724. appending: 1, /** 0: no fragment appending,
  16725. * 1: extra fragment appending */
  16726. reserved2: 11;
  16727. /* DWORD 1: channel and payload size */
  16728. A_UINT32
  16729. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  16730. payload_size: 16; /** unit: bytes */
  16731. /* DWORD 2: center frequency */
  16732. A_UINT32
  16733. band_center_freq1: 16, /** Center frequency 1 in MHz */
  16734. band_center_freq2: 16; /** Center frequency 2 in MHz,
  16735. * valid only for 11acvht 80plus80 mode */
  16736. /* DWORD 3: check sum */
  16737. A_UINT32 chksum;
  16738. /* variable length for calibration data */
  16739. A_UINT32 payload[1/* or more */];
  16740. } POSTPACK;
  16741. /* T2H SUBTYPE */
  16742. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  16743. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  16744. /* H2T SUBTYPE */
  16745. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  16746. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  16747. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  16748. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  16749. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  16750. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  16751. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  16752. do { \
  16753. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  16754. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  16755. } while (0)
  16756. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  16757. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  16758. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  16759. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  16760. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  16761. do { \
  16762. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  16763. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  16764. } while (0)
  16765. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  16766. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  16767. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  16768. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  16769. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  16770. do { \
  16771. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  16772. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  16773. } while (0)
  16774. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  16775. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  16776. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  16777. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  16778. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  16779. do { \
  16780. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  16781. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  16782. } while (0)
  16783. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  16784. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  16785. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  16786. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  16787. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  16788. do { \
  16789. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  16790. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  16791. } while (0)
  16792. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  16793. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  16794. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  16795. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  16796. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  16797. do { \
  16798. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  16799. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  16800. } while (0)
  16801. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  16802. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  16803. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  16804. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  16805. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  16806. do { \
  16807. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  16808. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  16809. } while (0)
  16810. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  16811. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  16812. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  16813. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  16814. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  16815. do { \
  16816. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  16817. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  16818. } while (0)
  16819. /**
  16820. * @brief target -> host FSE CMEM based send
  16821. *
  16822. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  16823. *
  16824. * @details
  16825. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  16826. * FSE placement in CMEM is enabled.
  16827. *
  16828. * This message sends the non-secure CMEM base address.
  16829. * It will be sent to host in response to message
  16830. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  16831. * The message would appear as follows:
  16832. *
  16833. * |31 24|23 16|15 8|7 0|
  16834. * |----------------+----------------+----------------+----------------|
  16835. * | reserved | num_entries | msg_type |
  16836. * |----------------+----------------+----------------+----------------|
  16837. * | base_address_lo |
  16838. * |----------------+----------------+----------------+----------------|
  16839. * | base_address_hi |
  16840. * |-------------------------------------------------------------------|
  16841. *
  16842. * The message is interpreted as follows:
  16843. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  16844. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  16845. * b'8:15 - number_entries: Indicated the number of entries
  16846. * programmed.
  16847. * b'16:31 - reserved.
  16848. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  16849. * CMEM base address
  16850. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  16851. * CMEM base address
  16852. */
  16853. PREPACK struct htt_cmem_base_send_t {
  16854. A_UINT32 msg_type: 8,
  16855. num_entries: 8,
  16856. reserved: 16;
  16857. A_UINT32 base_address_lo;
  16858. A_UINT32 base_address_hi;
  16859. } POSTPACK;
  16860. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  16861. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  16862. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  16863. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  16864. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  16865. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  16866. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  16867. do { \
  16868. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  16869. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  16870. } while (0)
  16871. /**
  16872. * @brief - HTT PPDU ID format
  16873. *
  16874. * @details
  16875. * The following field definitions describe the format of the PPDU ID.
  16876. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  16877. *
  16878. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  16879. * +--------------------------------------------------------------------------
  16880. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  16881. * +--------------------------------------------------------------------------
  16882. *
  16883. * sch id :Schedule command id
  16884. * Bits [11 : 0] : monotonically increasing counter to track the
  16885. * PPDU posted to a specific transmit queue.
  16886. *
  16887. * hwq_id: Hardware Queue ID.
  16888. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  16889. *
  16890. * mac_id: MAC ID
  16891. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  16892. *
  16893. * seq_idx: Sequence index.
  16894. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  16895. * a particular TXOP.
  16896. *
  16897. * tqm_cmd: HWSCH/TQM flag.
  16898. * Bit [23] : Always set to 0.
  16899. *
  16900. * seq_cmd_type: Sequence command type.
  16901. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  16902. * Refer to enum HTT_STATS_FTYPE for values.
  16903. */
  16904. PREPACK struct htt_ppdu_id {
  16905. A_UINT32
  16906. sch_id: 12,
  16907. hwq_id: 5,
  16908. mac_id: 2,
  16909. seq_idx: 2,
  16910. reserved1: 2,
  16911. tqm_cmd: 1,
  16912. seq_cmd_type: 6,
  16913. reserved2: 2;
  16914. } POSTPACK;
  16915. #define HTT_PPDU_ID_SCH_ID_S 0
  16916. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  16917. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  16918. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  16919. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  16920. do { \
  16921. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  16922. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  16923. } while (0)
  16924. #define HTT_PPDU_ID_HWQ_ID_S 12
  16925. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  16926. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  16927. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  16928. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  16929. do { \
  16930. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  16931. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  16932. } while (0)
  16933. #define HTT_PPDU_ID_MAC_ID_S 17
  16934. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  16935. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  16936. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  16937. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  16938. do { \
  16939. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  16940. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  16941. } while (0)
  16942. #define HTT_PPDU_ID_SEQ_IDX_S 19
  16943. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  16944. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  16945. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  16946. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  16947. do { \
  16948. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  16949. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  16950. } while (0)
  16951. #define HTT_PPDU_ID_TQM_CMD_S 23
  16952. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  16953. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  16954. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  16955. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  16956. do { \
  16957. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  16958. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  16959. } while (0)
  16960. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  16961. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  16962. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  16963. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  16964. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  16965. do { \
  16966. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  16967. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  16968. } while (0)
  16969. /**
  16970. * @brief target -> RX PEER METADATA V0 format
  16971. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16972. * message from target, and will confirm to the target which peer metadata
  16973. * version to use in the wmi_init message.
  16974. *
  16975. * The following diagram shows the format of the RX PEER METADATA.
  16976. *
  16977. * |31 24|23 16|15 8|7 0|
  16978. * |-----------------------------------------------------------------------|
  16979. * | Reserved | VDEV ID | PEER ID |
  16980. * |-----------------------------------------------------------------------|
  16981. */
  16982. PREPACK struct htt_rx_peer_metadata_v0 {
  16983. A_UINT32
  16984. peer_id: 16,
  16985. vdev_id: 8,
  16986. reserved1: 8;
  16987. } POSTPACK;
  16988. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  16989. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  16990. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  16991. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  16992. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  16993. do { \
  16994. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  16995. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  16996. } while (0)
  16997. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  16998. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  16999. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  17000. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  17001. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  17002. do { \
  17003. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  17004. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  17005. } while (0)
  17006. /**
  17007. * @brief target -> RX PEER METADATA V1 format
  17008. * Host will know the peer metadata version from the wmi_service_ready_ext2
  17009. * message from target, and will confirm to the target which peer metadata
  17010. * version to use in the wmi_init message.
  17011. *
  17012. * The following diagram shows the format of the RX PEER METADATA V1 format.
  17013. *
  17014. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  17015. * |---------------------------------------------------------------------------|
  17016. * |Rsvd2|CHIP ID|LMAC ID|VDEV ID|logical_link_id|ML PEER|SW PEER ID/ML PEER ID|
  17017. * |---------------------------------------------------------------------------|
  17018. */
  17019. PREPACK struct htt_rx_peer_metadata_v1 {
  17020. A_UINT32
  17021. peer_id: 13,
  17022. ml_peer_valid: 1,
  17023. logical_link_id: 2,
  17024. vdev_id: 8,
  17025. lmac_id: 2,
  17026. chip_id: 3,
  17027. reserved2: 3;
  17028. } POSTPACK;
  17029. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  17030. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  17031. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  17032. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  17033. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  17034. do { \
  17035. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  17036. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  17037. } while (0)
  17038. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  17039. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  17040. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  17041. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  17042. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  17043. do { \
  17044. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  17045. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  17046. } while (0)
  17047. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  17048. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  17049. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  17050. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  17051. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S 14
  17052. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M 0x0000c000
  17053. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_GET(_var) \
  17054. (((_var) & HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M) >> HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)
  17055. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_SET(_var, _val) \
  17056. do { \
  17057. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID, _val); \
  17058. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)); \
  17059. } while (0)
  17060. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  17061. do { \
  17062. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  17063. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  17064. } while (0)
  17065. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  17066. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  17067. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  17068. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  17069. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  17070. do { \
  17071. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  17072. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  17073. } while (0)
  17074. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  17075. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  17076. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  17077. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  17078. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  17079. do { \
  17080. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  17081. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  17082. } while (0)
  17083. /*
  17084. * In some systems, the host SW wants to specify priorities between
  17085. * different MSDU / flow queues within the same peer-TID.
  17086. * The below enums are used for the host to identify to the target
  17087. * which MSDU queue's priority it wants to adjust.
  17088. */
  17089. /*
  17090. * The MSDUQ index describe index of TCL HW, where each index is
  17091. * used for queuing particular types of MSDUs.
  17092. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  17093. */
  17094. enum HTT_MSDUQ_INDEX {
  17095. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  17096. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  17097. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  17098. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  17099. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  17100. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  17101. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  17102. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  17103. HTT_MSDUQ_MAX_INDEX,
  17104. };
  17105. /* MSDU qtype definition */
  17106. enum HTT_MSDU_QTYPE {
  17107. /*
  17108. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  17109. * relative priority. Instead, the relative priority of CRIT_0 versus
  17110. * CRIT_1 is controlled by the FW, through the configuration parameters
  17111. * it applies to the queues.
  17112. */
  17113. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  17114. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  17115. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  17116. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  17117. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  17118. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  17119. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  17120. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  17121. /* New MSDU_QTYPE should be added above this line */
  17122. /*
  17123. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  17124. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  17125. * any host/target message definitions. The QTYPE_MAX value can
  17126. * only be used internally within the host or within the target.
  17127. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  17128. * it must regard the unexpected value as a default qtype value,
  17129. * or ignore it.
  17130. */
  17131. HTT_MSDU_QTYPE_MAX,
  17132. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  17133. };
  17134. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  17135. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  17136. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  17137. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  17138. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  17139. };
  17140. /**
  17141. * @brief target -> host mlo timestamp offset indication
  17142. *
  17143. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  17144. *
  17145. * @details
  17146. * The following field definitions describe the format of the HTT target
  17147. * to host mlo timestamp offset indication message.
  17148. *
  17149. *
  17150. * |31 16|15 12|11 10|9 8|7 0 |
  17151. * |----------------------------------------------------------------------|
  17152. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  17153. * |----------------------------------------------------------------------|
  17154. * | Sync time stamp lo in us |
  17155. * |----------------------------------------------------------------------|
  17156. * | Sync time stamp hi in us |
  17157. * |----------------------------------------------------------------------|
  17158. * | mlo time stamp offset lo in us |
  17159. * |----------------------------------------------------------------------|
  17160. * | mlo time stamp offset hi in us |
  17161. * |----------------------------------------------------------------------|
  17162. * | mlo time stamp offset clocks in clock ticks |
  17163. * |----------------------------------------------------------------------|
  17164. * |31 26|25 16|15 0 |
  17165. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  17166. * | | compensation in clks | |
  17167. * |----------------------------------------------------------------------|
  17168. * |31 22|21 0 |
  17169. * | rsvd 3 | mlo time stamp comp timer period |
  17170. * |----------------------------------------------------------------------|
  17171. * The message is interpreted as follows:
  17172. *
  17173. * dword0 - b'0:7 - msg_type: This will be set to
  17174. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  17175. * value: 0x28
  17176. *
  17177. * dword0 - b'9:8 - pdev_id
  17178. *
  17179. * dword0 - b'11:10 - chip_id
  17180. *
  17181. * dword0 - b'15:12 - rsvd1: Reserved for future use
  17182. *
  17183. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  17184. *
  17185. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  17186. * which last sync interrupt was received
  17187. *
  17188. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  17189. * which last sync interrupt was received
  17190. *
  17191. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  17192. *
  17193. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  17194. *
  17195. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  17196. *
  17197. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  17198. *
  17199. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  17200. * for sub us resolution
  17201. *
  17202. * dword6 - b'31:26 - rsvd2: Reserved for future use
  17203. *
  17204. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  17205. * is applied, in us
  17206. *
  17207. * dword7 - b'31:22 - rsvd3: Reserved for future use
  17208. */
  17209. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  17210. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  17211. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  17212. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  17213. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  17214. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  17215. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  17216. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  17217. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  17218. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  17219. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  17220. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  17221. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  17222. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  17223. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  17224. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  17225. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  17226. do { \
  17227. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  17228. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  17229. } while (0)
  17230. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  17231. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  17232. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  17233. do { \
  17234. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  17235. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  17236. } while (0)
  17237. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  17238. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  17239. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  17240. do { \
  17241. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  17242. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  17243. } while (0)
  17244. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  17245. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  17246. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  17247. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  17248. do { \
  17249. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  17250. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  17251. } while (0)
  17252. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  17253. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  17254. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  17255. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  17256. do { \
  17257. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  17258. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  17259. } while (0)
  17260. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  17261. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  17262. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  17263. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  17264. do { \
  17265. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  17266. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  17267. } while (0)
  17268. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  17269. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  17270. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  17271. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  17272. do { \
  17273. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  17274. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  17275. } while (0)
  17276. typedef struct {
  17277. A_UINT32 msg_type: 8, /* bits 7:0 */
  17278. pdev_id: 2, /* bits 9:8 */
  17279. chip_id: 2, /* bits 11:10 */
  17280. reserved1: 4, /* bits 15:12 */
  17281. mac_clk_freq_mhz: 16; /* bits 31:16 */
  17282. A_UINT32 sync_timestamp_lo_us;
  17283. A_UINT32 sync_timestamp_hi_us;
  17284. A_UINT32 mlo_timestamp_offset_lo_us;
  17285. A_UINT32 mlo_timestamp_offset_hi_us;
  17286. A_UINT32 mlo_timestamp_offset_clks;
  17287. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  17288. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  17289. reserved2: 6; /* bits 31:26 */
  17290. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  17291. reserved3: 10; /* bits 31:22 */
  17292. } htt_t2h_mlo_offset_ind_t;
  17293. /*
  17294. * @brief target -> host VDEV TX RX STATS
  17295. *
  17296. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  17297. *
  17298. * @details
  17299. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  17300. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  17301. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  17302. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  17303. * periodically by target even in the absence of any further HTT request
  17304. * messages from host.
  17305. *
  17306. * The message is formatted as follows:
  17307. *
  17308. * |31 16|15 8|7 0|
  17309. * |---------------------------------+----------------+----------------|
  17310. * | payload_size | pdev_id | msg_type |
  17311. * |---------------------------------+----------------+----------------|
  17312. * | reserved0 |
  17313. * |-------------------------------------------------------------------|
  17314. * | reserved1 |
  17315. * |-------------------------------------------------------------------|
  17316. * | reserved2 |
  17317. * |-------------------------------------------------------------------|
  17318. * | |
  17319. * | VDEV specific Tx Rx stats info |
  17320. * | |
  17321. * |-------------------------------------------------------------------|
  17322. *
  17323. * The message is interpreted as follows:
  17324. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  17325. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  17326. * b'8:15 - pdev_id
  17327. * b'16:31 - size in bytes of the payload that follows the 16-byte
  17328. * message header fields (msg_type through reserved2)
  17329. * dword1 - b'0:31 - reserved0.
  17330. * dword2 - b'0:31 - reserved1.
  17331. * dword3 - b'0:31 - reserved2.
  17332. */
  17333. typedef struct {
  17334. A_UINT32 msg_type: 8,
  17335. pdev_id: 8,
  17336. payload_size: 16;
  17337. A_UINT32 reserved0;
  17338. A_UINT32 reserved1;
  17339. A_UINT32 reserved2;
  17340. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  17341. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  17342. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  17343. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  17344. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  17345. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  17346. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  17347. do { \
  17348. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  17349. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  17350. } while (0)
  17351. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  17352. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  17353. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  17354. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  17355. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  17356. do { \
  17357. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  17358. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  17359. } while (0)
  17360. /* SOC related stats */
  17361. typedef struct {
  17362. htt_tlv_hdr_t tlv_hdr;
  17363. /* When TQM is not able to find the peers during Tx, then it drops the packets
  17364. * This can be due to either the peer is deleted or deletion is ongoing
  17365. * */
  17366. A_UINT32 inv_peers_msdu_drop_count_lo;
  17367. A_UINT32 inv_peers_msdu_drop_count_hi;
  17368. } htt_t2h_soc_txrx_stats_common_tlv;
  17369. /* VDEV HW Tx/Rx stats */
  17370. typedef struct {
  17371. htt_tlv_hdr_t tlv_hdr;
  17372. A_UINT32 vdev_id;
  17373. /* Rx msdu byte cnt */
  17374. A_UINT32 rx_msdu_byte_cnt_lo;
  17375. A_UINT32 rx_msdu_byte_cnt_hi;
  17376. /* Rx msdu cnt */
  17377. A_UINT32 rx_msdu_cnt_lo;
  17378. A_UINT32 rx_msdu_cnt_hi;
  17379. /* tx msdu byte cnt */
  17380. A_UINT32 tx_msdu_byte_cnt_lo;
  17381. A_UINT32 tx_msdu_byte_cnt_hi;
  17382. /* tx msdu cnt */
  17383. A_UINT32 tx_msdu_cnt_lo;
  17384. A_UINT32 tx_msdu_cnt_hi;
  17385. /* tx excessive retry discarded msdu cnt */
  17386. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  17387. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  17388. /* TX congestion ctrl msdu drop cnt */
  17389. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  17390. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  17391. /* discarded tx msdus cnt coz of time to live expiry */
  17392. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  17393. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  17394. /* tx excessive retry discarded msdu byte cnt */
  17395. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  17396. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  17397. /* TX congestion ctrl msdu drop byte cnt */
  17398. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  17399. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  17400. /* discarded tx msdus byte cnt coz of time to live expiry */
  17401. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  17402. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  17403. /* TQM bypass frame cnt */
  17404. A_UINT32 tqm_bypass_frame_cnt_lo;
  17405. A_UINT32 tqm_bypass_frame_cnt_hi;
  17406. /* TQM bypass byte cnt */
  17407. A_UINT32 tqm_bypass_byte_cnt_lo;
  17408. A_UINT32 tqm_bypass_byte_cnt_hi;
  17409. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  17410. /*
  17411. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  17412. *
  17413. * @details
  17414. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  17415. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  17416. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  17417. * the default MSDU queues of each of the specified TIDs for the peer
  17418. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  17419. * If the default MSDU queues of a given TID within the peer are not linked
  17420. * to a service class, the svc_class_id field for that TID will have a
  17421. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  17422. * queues for that TID are not mapped to any service class.
  17423. *
  17424. * |31 16|15 8|7 0|
  17425. * |------------------------------+--------------+--------------|
  17426. * | peer ID | reserved | msg type |
  17427. * |------------------------------+--------------+------+-------|
  17428. * | reserved | svc class ID | TID |
  17429. * |------------------------------------------------------------|
  17430. * ...
  17431. * |------------------------------------------------------------|
  17432. * | reserved | svc class ID | TID |
  17433. * |------------------------------------------------------------|
  17434. * Header fields:
  17435. * dword0 - b'7:0 - msg_type: This will be set to
  17436. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  17437. * b'31:16 - peer ID
  17438. * dword1 - b'7:0 - TID
  17439. * b'15:8 - svc class ID
  17440. * (dword2, etc. same format as dword1)
  17441. */
  17442. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  17443. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  17444. A_UINT32 msg_type :8,
  17445. reserved0 :8,
  17446. peer_id :16;
  17447. struct {
  17448. A_UINT32 tid :8,
  17449. svc_class_id :8,
  17450. reserved1 :16;
  17451. } tid_reports[1/*or more*/];
  17452. } POSTPACK;
  17453. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  17454. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  17455. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  17456. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  17457. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  17458. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  17459. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  17460. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  17461. do { \
  17462. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  17463. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  17464. } while (0)
  17465. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  17466. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  17467. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  17468. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  17469. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  17470. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  17471. do { \
  17472. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  17473. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  17474. } while (0)
  17475. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  17476. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  17477. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  17478. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  17479. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  17480. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  17481. do { \
  17482. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  17483. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  17484. } while (0)
  17485. /*
  17486. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  17487. *
  17488. * @details
  17489. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  17490. * flow if the flow is seen the associated service class is conveyed to the
  17491. * target via TCL Data Command. Target on the other hand internally creates the
  17492. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  17493. * of the newly created MSDUQ and some other identifiers to uniquely identity
  17494. * the newly created MSDUQ
  17495. *
  17496. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  17497. * |------------------------------+------------------------+--------------|
  17498. * | peer ID | HTT qtype | msg type |
  17499. * |---------------------------------+--------------+--+---+-------+------|
  17500. * | reserved |AST list index|FO|WC | HLOS | remap|
  17501. * | | | | | TID | TID |
  17502. * |---------------------+------------------------------------------------|
  17503. * | reserved1 | tgt_opaque_id |
  17504. * |---------------------+------------------------------------------------|
  17505. *
  17506. * Header fields:
  17507. *
  17508. * dword0 - b'7:0 - msg_type: This will be set to
  17509. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  17510. * b'15:8 - HTT qtype
  17511. * b'31:16 - peer ID
  17512. *
  17513. * dword1 - b'3:0 - remap TID, as assigned in firmware
  17514. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  17515. * hlos_tid : Common to Lithium and Beryllium
  17516. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  17517. * TCL Data Command : Beryllium
  17518. * b10 - flow_override (FO), as sent by host in
  17519. * TCL Data Command: Beryllium
  17520. * b11:14 - ast_list_idx
  17521. * Array index into the list of extension AST entries
  17522. * (not the actual AST 16-bit index).
  17523. * The ast_list_idx is one-based, with the following
  17524. * range of values:
  17525. * - legacy targets supporting 16 user-defined
  17526. * MSDU queues: 1-2
  17527. * - legacy targets supporting 48 user-defined
  17528. * MSDU queues: 1-6
  17529. * - new targets: 0 (peer_id is used instead)
  17530. * Note that since ast_list_idx is one-based,
  17531. * the host will need to subtract 1 to use it as an
  17532. * index into a list of extension AST entries.
  17533. * b15:31 - reserved
  17534. *
  17535. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  17536. * unique MSDUQ id in firmware
  17537. * b'24:31 - reserved1
  17538. */
  17539. PREPACK struct htt_t2h_sawf_msduq_event {
  17540. A_UINT32 msg_type : 8,
  17541. htt_qtype : 8,
  17542. peer_id :16;
  17543. A_UINT32 remap_tid : 4,
  17544. hlos_tid : 4,
  17545. who_classify_info_sel : 2,
  17546. flow_override : 1,
  17547. ast_list_idx : 4,
  17548. reserved :17;
  17549. A_UINT32 tgt_opaque_id :24,
  17550. reserved1 : 8;
  17551. } POSTPACK;
  17552. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  17553. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  17554. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  17555. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  17556. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  17557. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  17558. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  17559. do { \
  17560. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  17561. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  17562. } while (0)
  17563. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  17564. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  17565. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  17566. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  17567. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  17568. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  17569. do { \
  17570. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  17571. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  17572. } while (0)
  17573. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  17574. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  17575. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  17576. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  17577. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  17578. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  17579. do { \
  17580. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  17581. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  17582. } while (0)
  17583. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  17584. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  17585. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  17586. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  17587. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  17588. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  17589. do { \
  17590. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  17591. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  17592. } while (0)
  17593. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  17594. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  17595. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  17596. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  17597. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  17598. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  17599. do { \
  17600. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  17601. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  17602. } while (0)
  17603. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  17604. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  17605. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  17606. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  17607. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  17608. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  17609. do { \
  17610. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  17611. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  17612. } while (0)
  17613. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  17614. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  17615. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  17616. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  17617. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  17618. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  17619. do { \
  17620. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  17621. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  17622. } while (0)
  17623. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  17624. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  17625. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  17626. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  17627. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  17628. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  17629. do { \
  17630. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  17631. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  17632. } while (0)
  17633. /**
  17634. * @brief target -> PPDU id format indication
  17635. *
  17636. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  17637. *
  17638. * @details
  17639. * The following field definitions describe the format of the HTT target
  17640. * to host PPDU ID format indication message.
  17641. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  17642. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  17643. * seq_idx :- Sequence control index of this PPDU.
  17644. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  17645. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  17646. * tqm_cmd:-
  17647. *
  17648. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  17649. * |--------------------------------------------------+------------------------|
  17650. * | rsvd0 | msg type |
  17651. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17652. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  17653. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17654. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  17655. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17656. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  17657. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17658. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  17659. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17660. * Where: OF = bit offset, NB = number of bits, V = valid
  17661. * The message is interpreted as follows:
  17662. *
  17663. * dword0 - b'7:0 - msg_type: This will be set to
  17664. * HTT_T2H_PPDU_ID_FMT_IND
  17665. * value: 0x30
  17666. *
  17667. * dword0 - b'31:8 - reserved
  17668. *
  17669. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  17670. *
  17671. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  17672. *
  17673. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  17674. *
  17675. * dword1 - b'15:11 - reserved for future use
  17676. *
  17677. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  17678. *
  17679. * dword1 - b'21:17 - number of bits in ring_id
  17680. *
  17681. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  17682. *
  17683. * dword1 - b'31:27 - reserved for future use
  17684. *
  17685. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  17686. *
  17687. * dword2 - b'5:1 - number of bits in sequence index
  17688. *
  17689. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  17690. *
  17691. * dword2 - b'15:11 - reserved for future use
  17692. *
  17693. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  17694. *
  17695. * dword2 - b'21:17 - number of bits in link_id
  17696. *
  17697. * dword2 - b'26:22 - offset of link_id (in number of bits)
  17698. *
  17699. * dword2 - b'31:27 - reserved for future use
  17700. *
  17701. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  17702. *
  17703. * dword3 - b'5:1 - number of bits in seq_cmd_type
  17704. *
  17705. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  17706. *
  17707. * dword3 - b'15:11 - reserved for future use
  17708. *
  17709. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  17710. *
  17711. * dword3 - b'21:17 - number of bits in tqm_cmd
  17712. *
  17713. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  17714. *
  17715. * dword3 - b'31:27 - reserved for future use
  17716. *
  17717. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  17718. *
  17719. * dword4 - b'5:1 - number of bits in mac_id
  17720. *
  17721. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  17722. *
  17723. * dword4 - b'15:11 - reserved for future use
  17724. *
  17725. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  17726. *
  17727. * dword4 - b'21:17 - number of bits in crc
  17728. *
  17729. * dword4 - b'26:22 - offset of crc (in number of bits)
  17730. *
  17731. * dword4 - b'31:27 - reserved for future use
  17732. *
  17733. */
  17734. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  17735. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  17736. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  17737. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  17738. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  17739. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  17740. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  17741. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  17742. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  17743. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  17744. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  17745. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  17746. /* macros for accessing lower 16 bits in dword */
  17747. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  17748. do { \
  17749. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  17750. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  17751. } while (0)
  17752. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  17753. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  17754. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  17755. do { \
  17756. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  17757. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  17758. } while (0)
  17759. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  17760. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  17761. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  17762. do { \
  17763. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  17764. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  17765. } while (0)
  17766. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  17767. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  17768. /* macros for accessing upper 16 bits in dword */
  17769. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  17770. do { \
  17771. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  17772. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  17773. } while (0)
  17774. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  17775. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  17776. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  17777. do { \
  17778. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  17779. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  17780. } while (0)
  17781. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  17782. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  17783. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  17784. do { \
  17785. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  17786. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  17787. } while (0)
  17788. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  17789. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  17790. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  17791. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17792. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  17793. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17794. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  17795. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17796. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  17797. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17798. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  17799. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17800. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  17801. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17802. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  17803. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17804. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  17805. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17806. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  17807. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17808. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  17809. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17810. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  17811. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17812. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  17813. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17814. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  17815. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17816. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  17817. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17818. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  17819. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17820. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  17821. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17822. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  17823. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17824. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  17825. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17826. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  17827. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17828. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  17829. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17830. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  17831. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17832. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  17833. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17834. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  17835. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17836. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  17837. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17838. /* offsets in number dwords */
  17839. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  17840. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  17841. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  17842. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  17843. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  17844. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  17845. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  17846. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  17847. typedef struct {
  17848. A_UINT32 msg_type: 8, /* bits 7:0 */
  17849. rsvd0: 24;/* bits 31:8 */
  17850. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  17851. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  17852. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  17853. rsvd1: 5, /* bits 15:11 */
  17854. ring_id_valid: 1, /* bits 16:16 */
  17855. ring_id_bits: 5, /* bits 21:17 */
  17856. ring_id_offset: 5, /* bits 26:22 */
  17857. rsvd2: 5; /* bits 31:27 */
  17858. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  17859. seq_idx_bits: 5, /* bits 5:1 */
  17860. seq_idx_offset: 5, /* bits 10:6 */
  17861. rsvd3: 5, /* bits 15:11 */
  17862. link_id_valid: 1, /* bits 16:16 */
  17863. link_id_bits: 5, /* bits 21:17 */
  17864. link_id_offset: 5, /* bits 26:22 */
  17865. rsvd4: 5; /* bits 31:27 */
  17866. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  17867. seq_cmd_type_bits: 5, /* bits 5:1 */
  17868. seq_cmd_type_offset: 5, /* bits 10:6 */
  17869. rsvd5: 5, /* bits 15:11 */
  17870. tqm_cmd_valid: 1, /* bits 16:16 */
  17871. tqm_cmd_bits: 5, /* bits 21:17 */
  17872. tqm_cmd_offset: 5, /* bits 26:12 */
  17873. rsvd6: 5; /* bits 31:27 */
  17874. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  17875. mac_id_bits: 5, /* bits 5:1 */
  17876. mac_id_offset: 5, /* bits 10:6 */
  17877. rsvd8: 5, /* bits 15:11 */
  17878. crc_valid: 1, /* bits 16:16 */
  17879. crc_bits: 5, /* bits 21:17 */
  17880. crc_offset: 5, /* bits 26:12 */
  17881. rsvd9: 5; /* bits 31:27 */
  17882. } htt_t2h_ppdu_id_fmt_ind_t;
  17883. /**
  17884. * @brief target -> host RX_CCE_SUPER_RULE setup done message
  17885. *
  17886. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE
  17887. *
  17888. * @details
  17889. * HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE message is sent by the target
  17890. * when RX_CCE_SUPER_RULE setup is done
  17891. *
  17892. * This message shows the configuration results after the setup operation.
  17893. * It will always be sent to host.
  17894. * The message would appear as follows:
  17895. *
  17896. * |31 24|23 16|15 8|7 0|
  17897. * |-----------------+-----------------+----------------+----------------|
  17898. * | result | response_type | vdev_id | msg_type |
  17899. * |---------------------------------------------------------------------|
  17900. *
  17901. * The message is interpreted as follows:
  17902. * dword0 - b'0:7 - msg_type: This will be set to 0x33
  17903. * (HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE)
  17904. * b'8:15 - vdev_id: Identify which vdev RX_CCE_SUPER_RULE is setup on
  17905. * b'16:23 - response_type: Indicate the response type of this setup
  17906. * done msg
  17907. * 0: HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE,
  17908. * response to HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST
  17909. * 1: HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE,
  17910. * response to HTT_RX_CCE_SUPER_RULE_INSTALL
  17911. * 2: HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE,
  17912. * response to HTT_RX_CCE_SUPER_RULE_RELEASE
  17913. * b'24:31 - result: Indicate result of setup operation
  17914. * For HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE:
  17915. * b'24 - is_rule_enough: indicate if there are
  17916. * enough free cce rule slots
  17917. * 0: not enough
  17918. * 1: enough
  17919. * b'25:31 - avail_rule_num: indicate the number of
  17920. * remaining free cce rule slots, only makes sense
  17921. * when is_rule_enough = 0
  17922. * For HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE:
  17923. * b'24 - cfg_result_0: indicate the config result
  17924. * of RX_CCE_SUPER_RULE_0
  17925. * 0: Install/Uninstall fails
  17926. * 1: Install/Uninstall succeeds
  17927. * b'25 - cfg_result_1: indicate the config result
  17928. * of RX_CCE_SUPER_RULE_1
  17929. * 0: Install/Uninstall fails
  17930. * 1: Install/Uninstall succeeds
  17931. * b'26:31 - reserved
  17932. * For HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE:
  17933. * b'24 - cfg_result_0: indicate the config result
  17934. * of RX_CCE_SUPER_RULE_0
  17935. * 0: Release fails
  17936. * 1: Release succeeds
  17937. * b'25 - cfg_result_1: indicate the config result
  17938. * of RX_CCE_SUPER_RULE_1
  17939. * 0: Release fails
  17940. * 1: Release succeeds
  17941. * b'26:31 - reserved
  17942. */
  17943. enum htt_rx_cce_super_rule_setup_done_response_type {
  17944. HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE = 0,
  17945. HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE,
  17946. HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE,
  17947. /*All reply type should be before this*/
  17948. HTT_RX_CCE_SUPER_RULE_SETUP_INVALID_RESPONSE,
  17949. };
  17950. PREPACK struct htt_rx_cce_super_rule_setup_done_t {
  17951. A_UINT8 msg_type;
  17952. A_UINT8 vdev_id;
  17953. A_UINT8 response_type;
  17954. union {
  17955. struct {
  17956. /* For HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE */
  17957. A_UINT8 is_rule_enough: 1,
  17958. avail_rule_num: 7;
  17959. };
  17960. struct {
  17961. /*
  17962. * For HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE and
  17963. * HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE
  17964. */
  17965. A_UINT8 cfg_result_0: 1,
  17966. cfg_result_1: 1,
  17967. rsvd: 6;
  17968. };
  17969. } result;
  17970. } POSTPACK;
  17971. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_SZ (sizeof(struct htt_rx_cce_super_rule_setup_done_t))
  17972. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_M 0x0000ff00
  17973. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_S 8
  17974. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_GET(_var) \
  17975. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_M) >> \
  17976. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_S)
  17977. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_SET(_var, _val) \
  17978. do { \
  17979. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID, _val); \
  17980. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_S)); \
  17981. } while (0)
  17982. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_M 0x00ff0000
  17983. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S 16
  17984. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_GET(_var) \
  17985. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_M) >> \
  17986. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S)
  17987. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_SET(_var, _val) \
  17988. do { \
  17989. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE, _val); \
  17990. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S)); \
  17991. } while (0)
  17992. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_M 0xff000000
  17993. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S 24
  17994. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_GET(_var) \
  17995. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_M) >> \
  17996. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S)
  17997. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_SET(_var, _val) \
  17998. do { \
  17999. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT, _val); \
  18000. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S)); \
  18001. } while (0)
  18002. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_M 0x01000000
  18003. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S 24
  18004. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_GET(_var) \
  18005. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_M) >> \
  18006. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S)
  18007. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_SET(_var, _val) \
  18008. do { \
  18009. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH, _val); \
  18010. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S)); \
  18011. } while (0)
  18012. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_M 0xFE000000
  18013. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S 25
  18014. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_GET(_var) \
  18015. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_M) >> \
  18016. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S)
  18017. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_SET(_var, _val) \
  18018. do { \
  18019. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM, _val); \
  18020. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S)); \
  18021. } while (0)
  18022. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_M 0x01000000
  18023. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S 24
  18024. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_GET(_var) \
  18025. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_M) >> \
  18026. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S)
  18027. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_SET(_var, _val) \
  18028. do { \
  18029. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0, _val); \
  18030. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S)); \
  18031. } while (0)
  18032. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_M 0x02000000
  18033. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S 25
  18034. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_GET(_var) \
  18035. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_M) >> \
  18036. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S)
  18037. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_SET(_var, _val) \
  18038. do { \
  18039. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1, _val); \
  18040. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S)); \
  18041. } while (0)
  18042. /**
  18043. * @brief target -> host CoDel MSDU queue latencies array configuration
  18044. *
  18045. * MSG_TYPE => HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND
  18046. *
  18047. * @details
  18048. * The HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND message is used
  18049. * by the target to inform the host of the location and size of the DDR array of
  18050. * per MSDU queue latency metrics. This array is updated by the host and
  18051. * read by the target. The target uses these metric values to determine
  18052. * which MSDU queues have latencies exceeding their CoDel latency target.
  18053. *
  18054. * |31 16|15 8|7 0|
  18055. * |-------------------------------------------+----------|
  18056. * | number of array elements | reserved | MSG_TYPE |
  18057. * |-------------------------------------------+----------|
  18058. * | array physical address, low bits |
  18059. * |------------------------------------------------------|
  18060. * | array physical address, high bits |
  18061. * |------------------------------------------------------|
  18062. * Header fields:
  18063. * - MSG_TYPE
  18064. * Bits 7:0
  18065. * Purpose: Identifies this as a CoDel MSDU queue latencies
  18066. * array configuration message.
  18067. * Value: (HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND)
  18068. * - NUM_ELEM
  18069. * Bits 31:16
  18070. * Purpose: Inform the host of the length of the MSDU queue latencies array.
  18071. * Value: Specifies the number of elements in the MSDU queue latency
  18072. * metrics array. This value is the same as the maximum number of
  18073. * MSDU queues supported by the target.
  18074. * Since each array element is 16 bits, the size in bytes of the
  18075. * MSDU queue latency metrics array is twice the number of elements.
  18076. * - PADDR_LOW
  18077. * Bits 31:0
  18078. * Purpose: Inform the host of the MSDU queue latencies array's location.
  18079. * Value: Lower 32 bits of the physical address of the MSDU queue latency
  18080. * metrics array.
  18081. * - PADDR_HIGH
  18082. * Bits 31:0
  18083. * Purpose: Inform the host of the MSDU queue latencies array's location.
  18084. * Value: Upper 32 bits of the physical address of the MSDU queue latency
  18085. * metrics array.
  18086. */
  18087. typedef struct {
  18088. A_UINT32 msg_type: 8, /* bits 7:0 */
  18089. reserved: 8, /* bits 15:8 */
  18090. num_elem: 16; /* bits 31:16 */
  18091. A_UINT32 paddr_low;
  18092. A_UINT32 paddr_high;
  18093. } htt_t2h_codel_msduq_latencies_array_cfg_int_t;
  18094. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_SIZE 12 /* bytes */
  18095. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_M 0xffff0000
  18096. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_S 16
  18097. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_GET(_var) \
  18098. (((_var) & HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_M) >> \
  18099. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_S)
  18100. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_SET(_var, _val) \
  18101. do { \
  18102. HTT_CHECK_SET_VAL( \
  18103. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM, _val); \
  18104. ((_var) |= ((_val) << \
  18105. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_S)); \
  18106. } while (0)
  18107. /*
  18108. * This CoDel MSDU queue latencies array whose location and number of
  18109. * elements are specified by this HTT_T2H message consists of 16-bit elements
  18110. * that each specify a statistical summary (min) of a MSDU queue's latency,
  18111. * using microseconds units.
  18112. */
  18113. #define HTT_CODEL_MSDUQ_LATENCIES_ARRAY_ELEM_BYTES 2
  18114. #endif