htt.h 926 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997
  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_UMAC_SSR_TAG = 179, /* htt_umac_ssr_stats_tlv */
  746. HTT_STATS_MAX_TAG,
  747. } htt_stats_tlv_tag_t;
  748. /* retain deprecated enum name as an alias for the current enum name */
  749. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  750. #define HTT_STATS_TLV_TAG_M 0x00000fff
  751. #define HTT_STATS_TLV_TAG_S 0
  752. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  753. #define HTT_STATS_TLV_LENGTH_S 12
  754. #define HTT_STATS_TLV_TAG_GET(_var) \
  755. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  756. HTT_STATS_TLV_TAG_S)
  757. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  758. do { \
  759. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  760. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  761. } while (0)
  762. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  763. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  764. HTT_STATS_TLV_LENGTH_S)
  765. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  766. do { \
  767. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  768. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  769. } while (0)
  770. /*=== host -> target messages ===============================================*/
  771. enum htt_h2t_msg_type {
  772. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  773. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  774. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  775. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  776. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  777. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  778. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  779. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  780. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  781. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  782. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  783. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  784. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  785. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  786. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  787. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  788. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  789. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  790. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  791. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  792. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  793. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  794. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  795. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  796. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  797. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  798. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  799. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  800. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  801. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  802. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  803. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  804. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  805. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP = 0x21,
  806. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET = 0x22,
  807. HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP = 0x23,
  808. /* keep this last */
  809. HTT_H2T_NUM_MSGS
  810. };
  811. /*
  812. * HTT host to target message type -
  813. * stored in bits 7:0 of the first word of the message
  814. */
  815. #define HTT_H2T_MSG_TYPE_M 0xff
  816. #define HTT_H2T_MSG_TYPE_S 0
  817. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  818. do { \
  819. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  820. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  821. } while (0)
  822. #define HTT_H2T_MSG_TYPE_GET(word) \
  823. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  824. /**
  825. * @brief host -> target version number request message definition
  826. *
  827. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  828. *
  829. *
  830. * |31 24|23 16|15 8|7 0|
  831. * |----------------+----------------+----------------+----------------|
  832. * | reserved | msg type |
  833. * |-------------------------------------------------------------------|
  834. * : option request TLV (optional) |
  835. * :...................................................................:
  836. *
  837. * The VER_REQ message may consist of a single 4-byte word, or may be
  838. * extended with TLVs that specify which HTT options the host is requesting
  839. * from the target.
  840. * The following option TLVs may be appended to the VER_REQ message:
  841. * - HL_SUPPRESS_TX_COMPL_IND
  842. * - HL_MAX_TX_QUEUE_GROUPS
  843. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  844. * may be appended to the VER_REQ message (but only one TLV of each type).
  845. *
  846. * Header fields:
  847. * - MSG_TYPE
  848. * Bits 7:0
  849. * Purpose: identifies this as a version number request message
  850. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  851. */
  852. #define HTT_VER_REQ_BYTES 4
  853. /* TBDXXX: figure out a reasonable number */
  854. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  855. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  856. /**
  857. * @brief HTT tx MSDU descriptor
  858. *
  859. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  860. *
  861. * @details
  862. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  863. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  864. * the target firmware needs for the FW's tx processing, particularly
  865. * for creating the HW msdu descriptor.
  866. * The same HTT tx descriptor is used for HL and LL systems, though
  867. * a few fields within the tx descriptor are used only by LL or
  868. * only by HL.
  869. * The HTT tx descriptor is defined in two manners: by a struct with
  870. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  871. * definitions.
  872. * The target should use the struct def, for simplicitly and clarity,
  873. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  874. * neutral. Specifically, the host shall use the get/set macros built
  875. * around the mask + shift defs.
  876. */
  877. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  878. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  879. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  880. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  881. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  882. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  883. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  884. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  885. #define HTT_TX_VDEV_ID_WORD 0
  886. #define HTT_TX_VDEV_ID_MASK 0x3f
  887. #define HTT_TX_VDEV_ID_SHIFT 16
  888. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  889. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  890. #define HTT_TX_MSDU_LEN_DWORD 1
  891. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  892. /*
  893. * HTT_VAR_PADDR macros
  894. * Allow physical / bus addresses to be either a single 32-bit value,
  895. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  896. */
  897. #define HTT_VAR_PADDR32(var_name) \
  898. A_UINT32 var_name
  899. #define HTT_VAR_PADDR64_LE(var_name) \
  900. struct { \
  901. /* little-endian: lo precedes hi */ \
  902. A_UINT32 lo; \
  903. A_UINT32 hi; \
  904. } var_name
  905. /*
  906. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  907. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  908. * addresses are stored in a XXX-bit field.
  909. * This macro is used to define both htt_tx_msdu_desc32_t and
  910. * htt_tx_msdu_desc64_t structs.
  911. */
  912. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  913. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  914. { \
  915. /* DWORD 0: flags and meta-data */ \
  916. A_UINT32 \
  917. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  918. \
  919. /* pkt_subtype - \
  920. * Detailed specification of the tx frame contents, extending the \
  921. * general specification provided by pkt_type. \
  922. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  923. * pkt_type | pkt_subtype \
  924. * ============================================================== \
  925. * 802.3 | bit 0:3 - Reserved \
  926. * | bit 4: 0x0 - Copy-Engine Classification Results \
  927. * | not appended to the HTT message \
  928. * | 0x1 - Copy-Engine Classification Results \
  929. * | appended to the HTT message in the \
  930. * | format: \
  931. * | [HTT tx desc, frame header, \
  932. * | CE classification results] \
  933. * | The CE classification results begin \
  934. * | at the next 4-byte boundary after \
  935. * | the frame header. \
  936. * ------------+------------------------------------------------- \
  937. * Eth2 | bit 0:3 - Reserved \
  938. * | bit 4: 0x0 - Copy-Engine Classification Results \
  939. * | not appended to the HTT message \
  940. * | 0x1 - Copy-Engine Classification Results \
  941. * | appended to the HTT message. \
  942. * | See the above specification of the \
  943. * | CE classification results location. \
  944. * ------------+------------------------------------------------- \
  945. * native WiFi | bit 0:3 - Reserved \
  946. * | bit 4: 0x0 - Copy-Engine Classification Results \
  947. * | not appended to the HTT message \
  948. * | 0x1 - Copy-Engine Classification Results \
  949. * | appended to the HTT message. \
  950. * | See the above specification of the \
  951. * | CE classification results location. \
  952. * ------------+------------------------------------------------- \
  953. * mgmt | 0x0 - 802.11 MAC header absent \
  954. * | 0x1 - 802.11 MAC header present \
  955. * ------------+------------------------------------------------- \
  956. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  957. * | 0x1 - 802.11 MAC header present \
  958. * | bit 1: 0x0 - allow aggregation \
  959. * | 0x1 - don't allow aggregation \
  960. * | bit 2: 0x0 - perform encryption \
  961. * | 0x1 - don't perform encryption \
  962. * | bit 3: 0x0 - perform tx classification / queuing \
  963. * | 0x1 - don't perform tx classification; \
  964. * | insert the frame into the "misc" \
  965. * | tx queue \
  966. * | bit 4: 0x0 - Copy-Engine Classification Results \
  967. * | not appended to the HTT message \
  968. * | 0x1 - Copy-Engine Classification Results \
  969. * | appended to the HTT message. \
  970. * | See the above specification of the \
  971. * | CE classification results location. \
  972. */ \
  973. pkt_subtype: 5, \
  974. \
  975. /* pkt_type - \
  976. * General specification of the tx frame contents. \
  977. * The htt_pkt_type enum should be used to specify and check the \
  978. * value of this field. \
  979. */ \
  980. pkt_type: 3, \
  981. \
  982. /* vdev_id - \
  983. * ID for the vdev that is sending this tx frame. \
  984. * For certain non-standard packet types, e.g. pkt_type == raw \
  985. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  986. * This field is used primarily for determining where to queue \
  987. * broadcast and multicast frames. \
  988. */ \
  989. vdev_id: 6, \
  990. /* ext_tid - \
  991. * The extended traffic ID. \
  992. * If the TID is unknown, the extended TID is set to \
  993. * HTT_TX_EXT_TID_INVALID. \
  994. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  995. * value of the QoS TID. \
  996. * If the tx frame is non-QoS data, then the extended TID is set to \
  997. * HTT_TX_EXT_TID_NON_QOS. \
  998. * If the tx frame is multicast or broadcast, then the extended TID \
  999. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  1000. */ \
  1001. ext_tid: 5, \
  1002. \
  1003. /* postponed - \
  1004. * This flag indicates whether the tx frame has been downloaded to \
  1005. * the target before but discarded by the target, and now is being \
  1006. * downloaded again; or if this is a new frame that is being \
  1007. * downloaded for the first time. \
  1008. * This flag allows the target to determine the correct order for \
  1009. * transmitting new vs. old frames. \
  1010. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  1011. * This flag only applies to HL systems, since in LL systems, \
  1012. * the tx flow control is handled entirely within the target. \
  1013. */ \
  1014. postponed: 1, \
  1015. \
  1016. /* extension - \
  1017. * This flag indicates whether a HTT tx MSDU extension descriptor \
  1018. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  1019. * \
  1020. * 0x0 - no extension MSDU descriptor is present \
  1021. * 0x1 - an extension MSDU descriptor immediately follows the \
  1022. * regular MSDU descriptor \
  1023. */ \
  1024. extension: 1, \
  1025. \
  1026. /* cksum_offload - \
  1027. * This flag indicates whether checksum offload is enabled or not \
  1028. * for this frame. Target FW use this flag to turn on HW checksumming \
  1029. * 0x0 - No checksum offload \
  1030. * 0x1 - L3 header checksum only \
  1031. * 0x2 - L4 checksum only \
  1032. * 0x3 - L3 header checksum + L4 checksum \
  1033. */ \
  1034. cksum_offload: 2, \
  1035. \
  1036. /* tx_comp_req - \
  1037. * This flag indicates whether Tx Completion \
  1038. * from fw is required or not. \
  1039. * This flag is only relevant if tx completion is not \
  1040. * universally enabled. \
  1041. * For all LL systems, tx completion is mandatory, \
  1042. * so this flag will be irrelevant. \
  1043. * For HL systems tx completion is optional, but HL systems in which \
  1044. * the bus throughput exceeds the WLAN throughput will \
  1045. * probably want to always use tx completion, and thus \
  1046. * would not check this flag. \
  1047. * This flag is required when tx completions are not used universally, \
  1048. * but are still required for certain tx frames for which \
  1049. * an OTA delivery acknowledgment is needed by the host. \
  1050. * In practice, this would be for HL systems in which the \
  1051. * bus throughput is less than the WLAN throughput. \
  1052. * \
  1053. * 0x0 - Tx Completion Indication from Fw not required \
  1054. * 0x1 - Tx Completion Indication from Fw is required \
  1055. */ \
  1056. tx_compl_req: 1; \
  1057. \
  1058. \
  1059. /* DWORD 1: MSDU length and ID */ \
  1060. A_UINT32 \
  1061. len: 16, /* MSDU length, in bytes */ \
  1062. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1063. * and this id is used to calculate fragmentation \
  1064. * descriptor pointer inside the target based on \
  1065. * the base address, configured inside the target. \
  1066. */ \
  1067. \
  1068. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1069. /* frags_desc_ptr - \
  1070. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1071. * where the tx frame's fragments reside in memory. \
  1072. * This field only applies to LL systems, since in HL systems the \
  1073. * (degenerate single-fragment) fragmentation descriptor is created \
  1074. * within the target. \
  1075. */ \
  1076. _paddr__frags_desc_ptr_; \
  1077. \
  1078. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1079. /* \
  1080. * Peer ID : Target can use this value to know which peer-id packet \
  1081. * destined to. \
  1082. * It's intended to be specified by host in case of NAWDS. \
  1083. */ \
  1084. A_UINT16 peerid; \
  1085. \
  1086. /* \
  1087. * Channel frequency: This identifies the desired channel \
  1088. * frequency (in mhz) for tx frames. This is used by FW to help \
  1089. * determine when it is safe to transmit or drop frames for \
  1090. * off-channel operation. \
  1091. * The default value of zero indicates to FW that the corresponding \
  1092. * VDEV's home channel (if there is one) is the desired channel \
  1093. * frequency. \
  1094. */ \
  1095. A_UINT16 chanfreq; \
  1096. \
  1097. /* Reason reserved is commented is increasing the htt structure size \
  1098. * leads to some weird issues. \
  1099. * A_UINT32 reserved_dword3_bits0_31; \
  1100. */ \
  1101. } POSTPACK
  1102. /* define a htt_tx_msdu_desc32_t type */
  1103. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1104. /* define a htt_tx_msdu_desc64_t type */
  1105. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1106. /*
  1107. * Make htt_tx_msdu_desc_t be an alias for either
  1108. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1109. */
  1110. #if HTT_PADDR64
  1111. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1112. #else
  1113. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1114. #endif
  1115. /* decriptor information for Management frame*/
  1116. /*
  1117. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1118. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1119. */
  1120. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1121. extern A_UINT32 mgmt_hdr_len;
  1122. PREPACK struct htt_mgmt_tx_desc_t {
  1123. A_UINT32 msg_type;
  1124. #if HTT_PADDR64
  1125. A_UINT64 frag_paddr; /* DMAble address of the data */
  1126. #else
  1127. A_UINT32 frag_paddr; /* DMAble address of the data */
  1128. #endif
  1129. A_UINT32 desc_id; /* returned to host during completion
  1130. * to free the meory*/
  1131. A_UINT32 len; /* Fragment length */
  1132. A_UINT32 vdev_id; /* virtual device ID*/
  1133. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1134. } POSTPACK;
  1135. PREPACK struct htt_mgmt_tx_compl_ind {
  1136. A_UINT32 desc_id;
  1137. A_UINT32 status;
  1138. } POSTPACK;
  1139. /*
  1140. * This SDU header size comes from the summation of the following:
  1141. * 1. Max of:
  1142. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1143. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1144. * b. 802.11 header, for raw frames: 36 bytes
  1145. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1146. * QoS header, HT header)
  1147. * c. 802.3 header, for ethernet frames: 14 bytes
  1148. * (destination address, source address, ethertype / length)
  1149. * 2. Max of:
  1150. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1151. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1152. * 3. 802.1Q VLAN header: 4 bytes
  1153. * 4. LLC/SNAP header: 8 bytes
  1154. */
  1155. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1156. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1157. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1158. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1159. A_COMPILE_TIME_ASSERT(
  1160. htt_encap_hdr_size_max_check_nwifi,
  1161. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1162. A_COMPILE_TIME_ASSERT(
  1163. htt_encap_hdr_size_max_check_enet,
  1164. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1165. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1166. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1167. #define HTT_TX_HDR_SIZE_802_1Q 4
  1168. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1169. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1170. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1171. HTT_TX_HDR_SIZE_802_1Q + \
  1172. HTT_TX_HDR_SIZE_LLC_SNAP)
  1173. #define HTT_HL_TX_FRM_HDR_LEN \
  1174. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1175. #define HTT_LL_TX_FRM_HDR_LEN \
  1176. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1177. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1178. /* dword 0 */
  1179. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1180. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1181. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1182. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1183. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1184. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1185. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1186. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1187. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1188. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1189. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1190. #define HTT_TX_DESC_PKT_TYPE_S 13
  1191. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1192. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1193. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1194. #define HTT_TX_DESC_VDEV_ID_S 16
  1195. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1196. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1197. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1198. #define HTT_TX_DESC_EXT_TID_S 22
  1199. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1200. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1201. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1202. #define HTT_TX_DESC_POSTPONED_S 27
  1203. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1204. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1205. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1206. #define HTT_TX_DESC_EXTENSION_S 28
  1207. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1208. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1209. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1210. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1211. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1212. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1213. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1214. #define HTT_TX_DESC_TX_COMP_S 31
  1215. /* dword 1 */
  1216. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1217. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1218. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1219. #define HTT_TX_DESC_FRM_LEN_S 0
  1220. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1221. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1222. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1223. #define HTT_TX_DESC_FRM_ID_S 16
  1224. /* dword 2 */
  1225. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1226. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1227. /* for systems using 64-bit format for bus addresses */
  1228. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1229. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1230. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1231. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1232. /* for systems using 32-bit format for bus addresses */
  1233. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1234. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1235. /* dword 3 */
  1236. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1237. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1238. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1239. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1240. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1241. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1242. #if HTT_PADDR64
  1243. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1244. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1245. #else
  1246. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1247. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1248. #endif
  1249. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1250. #define HTT_TX_DESC_PEER_ID_S 0
  1251. /*
  1252. * TEMPORARY:
  1253. * The original definitions for the PEER_ID fields contained typos
  1254. * (with _DESC_PADDR appended to this PEER_ID field name).
  1255. * Retain deprecated original names for PEER_ID fields until all code that
  1256. * refers to them has been updated.
  1257. */
  1258. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1259. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1260. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1261. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1262. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1263. HTT_TX_DESC_PEER_ID_M
  1264. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1265. HTT_TX_DESC_PEER_ID_S
  1266. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1267. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1268. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1269. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1270. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1271. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1272. #if HTT_PADDR64
  1273. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1274. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1275. #else
  1276. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1277. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1278. #endif
  1279. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1280. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1281. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1282. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1283. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1284. do { \
  1285. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1286. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1287. } while (0)
  1288. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1289. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1290. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1291. do { \
  1292. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1293. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1294. } while (0)
  1295. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1296. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1297. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1298. do { \
  1299. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1300. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1301. } while (0)
  1302. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1303. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1304. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1305. do { \
  1306. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1307. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1308. } while (0)
  1309. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1310. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1311. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1312. do { \
  1313. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1314. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1315. } while (0)
  1316. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1317. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1318. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1319. do { \
  1320. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1321. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1322. } while (0)
  1323. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1324. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1325. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1326. do { \
  1327. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1328. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1329. } while (0)
  1330. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1331. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1332. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1333. do { \
  1334. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1335. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1336. } while (0)
  1337. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1338. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1339. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1340. do { \
  1341. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1342. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1343. } while (0)
  1344. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1345. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1346. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1347. do { \
  1348. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1349. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1350. } while (0)
  1351. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1352. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1353. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1354. do { \
  1355. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1356. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1357. } while (0)
  1358. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1359. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1360. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1361. do { \
  1362. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1363. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1364. } while (0)
  1365. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1366. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1367. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1368. do { \
  1369. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1370. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1371. } while (0)
  1372. /* enums used in the HTT tx MSDU extension descriptor */
  1373. enum {
  1374. htt_tx_guard_interval_regular = 0,
  1375. htt_tx_guard_interval_short = 1,
  1376. };
  1377. enum {
  1378. htt_tx_preamble_type_ofdm = 0,
  1379. htt_tx_preamble_type_cck = 1,
  1380. htt_tx_preamble_type_ht = 2,
  1381. htt_tx_preamble_type_vht = 3,
  1382. };
  1383. enum {
  1384. htt_tx_bandwidth_5MHz = 0,
  1385. htt_tx_bandwidth_10MHz = 1,
  1386. htt_tx_bandwidth_20MHz = 2,
  1387. htt_tx_bandwidth_40MHz = 3,
  1388. htt_tx_bandwidth_80MHz = 4,
  1389. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1390. };
  1391. /**
  1392. * @brief HTT tx MSDU extension descriptor
  1393. * @details
  1394. * If the target supports HTT tx MSDU extension descriptors, the host has
  1395. * the option of appending the following struct following the regular
  1396. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1397. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1398. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1399. * tx specs for each frame.
  1400. */
  1401. PREPACK struct htt_tx_msdu_desc_ext_t {
  1402. /* DWORD 0: flags */
  1403. A_UINT32
  1404. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1405. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1406. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1407. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1408. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1409. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1410. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1411. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1412. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1413. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1414. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1415. /* DWORD 1: tx power, tx rate, tx BW */
  1416. A_UINT32
  1417. /* pwr -
  1418. * Specify what power the tx frame needs to be transmitted at.
  1419. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1420. * The value needs to be appropriately sign-extended when extracting
  1421. * the value from the message and storing it in a variable that is
  1422. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1423. * automatically handles this sign-extension.)
  1424. * If the transmission uses multiple tx chains, this power spec is
  1425. * the total transmit power, assuming incoherent combination of
  1426. * per-chain power to produce the total power.
  1427. */
  1428. pwr: 8,
  1429. /* mcs_mask -
  1430. * Specify the allowable values for MCS index (modulation and coding)
  1431. * to use for transmitting the frame.
  1432. *
  1433. * For HT / VHT preamble types, this mask directly corresponds to
  1434. * the HT or VHT MCS indices that are allowed. For each bit N set
  1435. * within the mask, MCS index N is allowed for transmitting the frame.
  1436. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1437. * rates versus OFDM rates, so the host has the option of specifying
  1438. * that the target must transmit the frame with CCK or OFDM rates
  1439. * (not HT or VHT), but leaving the decision to the target whether
  1440. * to use CCK or OFDM.
  1441. *
  1442. * For CCK and OFDM, the bits within this mask are interpreted as
  1443. * follows:
  1444. * bit 0 -> CCK 1 Mbps rate is allowed
  1445. * bit 1 -> CCK 2 Mbps rate is allowed
  1446. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1447. * bit 3 -> CCK 11 Mbps rate is allowed
  1448. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1449. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1450. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1451. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1452. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1453. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1454. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1455. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1456. *
  1457. * The MCS index specification needs to be compatible with the
  1458. * bandwidth mask specification. For example, a MCS index == 9
  1459. * specification is inconsistent with a preamble type == VHT,
  1460. * Nss == 1, and channel bandwidth == 20 MHz.
  1461. *
  1462. * Furthermore, the host has only a limited ability to specify to
  1463. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1464. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1465. */
  1466. mcs_mask: 12,
  1467. /* nss_mask -
  1468. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1469. * Each bit in this mask corresponds to a Nss value:
  1470. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1471. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1472. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1473. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1474. * The values in the Nss mask must be suitable for the recipient, e.g.
  1475. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1476. * recipient which only supports 2x2 MIMO.
  1477. */
  1478. nss_mask: 4,
  1479. /* guard_interval -
  1480. * Specify a htt_tx_guard_interval enum value to indicate whether
  1481. * the transmission should use a regular guard interval or a
  1482. * short guard interval.
  1483. */
  1484. guard_interval: 1,
  1485. /* preamble_type_mask -
  1486. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1487. * may choose from for transmitting this frame.
  1488. * The bits in this mask correspond to the values in the
  1489. * htt_tx_preamble_type enum. For example, to allow the target
  1490. * to transmit the frame as either CCK or OFDM, this field would
  1491. * be set to
  1492. * (1 << htt_tx_preamble_type_ofdm) |
  1493. * (1 << htt_tx_preamble_type_cck)
  1494. */
  1495. preamble_type_mask: 4,
  1496. reserved1_31_29: 3; /* unused, set to 0x0 */
  1497. /* DWORD 2: tx chain mask, tx retries */
  1498. A_UINT32
  1499. /* chain_mask - specify which chains to transmit from */
  1500. chain_mask: 4,
  1501. /* retry_limit -
  1502. * Specify the maximum number of transmissions, including the
  1503. * initial transmission, to attempt before giving up if no ack
  1504. * is received.
  1505. * If the tx rate is specified, then all retries shall use the
  1506. * same rate as the initial transmission.
  1507. * If no tx rate is specified, the target can choose whether to
  1508. * retain the original rate during the retransmissions, or to
  1509. * fall back to a more robust rate.
  1510. */
  1511. retry_limit: 4,
  1512. /* bandwidth_mask -
  1513. * Specify what channel widths may be used for the transmission.
  1514. * A value of zero indicates "don't care" - the target may choose
  1515. * the transmission bandwidth.
  1516. * The bits within this mask correspond to the htt_tx_bandwidth
  1517. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1518. * The bandwidth_mask must be consistent with the preamble_type_mask
  1519. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1520. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1521. */
  1522. bandwidth_mask: 6,
  1523. reserved2_31_14: 18; /* unused, set to 0x0 */
  1524. /* DWORD 3: tx expiry time (TSF) LSBs */
  1525. A_UINT32 expire_tsf_lo;
  1526. /* DWORD 4: tx expiry time (TSF) MSBs */
  1527. A_UINT32 expire_tsf_hi;
  1528. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1529. } POSTPACK;
  1530. /* DWORD 0 */
  1531. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1532. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1533. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1534. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1535. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1536. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1537. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1538. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1539. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1540. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1541. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1542. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1543. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1544. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1545. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1546. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1547. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1548. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1549. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1550. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1551. /* DWORD 1 */
  1552. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1553. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1554. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1555. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1556. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1557. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1558. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1559. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1560. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1561. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1562. /* DWORD 2 */
  1563. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1564. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1565. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1566. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1567. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1568. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1569. /* DWORD 0 */
  1570. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1571. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1572. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1573. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1574. do { \
  1575. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1576. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1577. } while (0)
  1578. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1579. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1580. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1581. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1582. do { \
  1583. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1584. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1585. } while (0)
  1586. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1587. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1588. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1589. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1590. do { \
  1591. HTT_CHECK_SET_VAL( \
  1592. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1593. ((_var) |= ((_val) \
  1594. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1595. } while (0)
  1596. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1597. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1598. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1599. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1600. do { \
  1601. HTT_CHECK_SET_VAL( \
  1602. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1603. ((_var) |= ((_val) \
  1604. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1605. } while (0)
  1606. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1607. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1608. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1609. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1610. do { \
  1611. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1612. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1613. } while (0)
  1614. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1615. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1616. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1617. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1618. do { \
  1619. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1620. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1621. } while (0)
  1622. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1623. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1624. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1625. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1626. do { \
  1627. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1628. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1629. } while (0)
  1630. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1631. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1632. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1633. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1634. do { \
  1635. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1636. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1637. } while (0)
  1638. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1639. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1640. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1641. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1642. do { \
  1643. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1644. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1645. } while (0)
  1646. /* DWORD 1 */
  1647. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1648. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1649. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1650. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1651. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1652. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1653. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1654. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1655. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1656. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1657. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1658. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1659. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1660. do { \
  1661. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1662. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1663. } while (0)
  1664. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1665. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1666. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1667. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1668. do { \
  1669. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1670. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1671. } while (0)
  1672. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1673. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1674. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1675. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1676. do { \
  1677. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1678. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1679. } while (0)
  1680. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1681. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1682. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1683. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1684. do { \
  1685. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1686. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1687. } while (0)
  1688. /* DWORD 2 */
  1689. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1690. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1691. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1692. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1693. do { \
  1694. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1695. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1696. } while (0)
  1697. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1698. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1699. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1700. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1701. do { \
  1702. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1703. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1704. } while (0)
  1705. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1706. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1707. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1708. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1709. do { \
  1710. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1711. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1712. } while (0)
  1713. typedef enum {
  1714. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1715. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1716. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1717. } htt_11ax_ltf_subtype_t;
  1718. typedef enum {
  1719. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1720. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1721. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1722. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1723. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1724. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1725. } htt_tx_ext2_preamble_type_t;
  1726. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1727. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1728. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1729. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1730. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1731. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1732. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1733. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1734. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1735. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1736. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1737. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1738. /**
  1739. * @brief HTT tx MSDU extension descriptor v2
  1740. * @details
  1741. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1742. * is received as tcl_exit_base->host_meta_info in firmware.
  1743. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1744. * are already part of tcl_exit_base.
  1745. */
  1746. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1747. /* DWORD 0: flags */
  1748. A_UINT32
  1749. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1750. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1751. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1752. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1753. valid_retries : 1, /* if set, tx retries spec is valid */
  1754. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1755. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1756. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1757. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1758. valid_key_flags : 1, /* if set, key flags is valid */
  1759. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1760. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1761. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1762. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1763. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1764. 1 = ENCRYPT,
  1765. 2 ~ 3 - Reserved */
  1766. /* retry_limit -
  1767. * Specify the maximum number of transmissions, including the
  1768. * initial transmission, to attempt before giving up if no ack
  1769. * is received.
  1770. * If the tx rate is specified, then all retries shall use the
  1771. * same rate as the initial transmission.
  1772. * If no tx rate is specified, the target can choose whether to
  1773. * retain the original rate during the retransmissions, or to
  1774. * fall back to a more robust rate.
  1775. */
  1776. retry_limit : 4,
  1777. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1778. * Valid only for 11ax preamble types HE_SU
  1779. * and HE_EXT_SU
  1780. */
  1781. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1782. * Valid only for 11ax preamble types HE_SU
  1783. * and HE_EXT_SU
  1784. */
  1785. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1786. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1787. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1788. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1789. */
  1790. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1791. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1792. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1793. * Use cases:
  1794. * Any time firmware uses TQM-BYPASS for Data
  1795. * TID, firmware expect host to set this bit.
  1796. */
  1797. /* DWORD 1: tx power, tx rate */
  1798. A_UINT32
  1799. power : 8, /* unit of the power field is 0.5 dbm
  1800. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1801. * signed value ranging from -64dbm to 63.5 dbm
  1802. */
  1803. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1804. * Setting more than one MCS isn't currently
  1805. * supported by the target (but is supported
  1806. * in the interface in case in the future
  1807. * the target supports specifications of
  1808. * a limited set of MCS values.
  1809. */
  1810. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1811. * Setting more than one Nss isn't currently
  1812. * supported by the target (but is supported
  1813. * in the interface in case in the future
  1814. * the target supports specifications of
  1815. * a limited set of Nss values.
  1816. */
  1817. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1818. update_peer_cache : 1; /* When set these custom values will be
  1819. * used for all packets, until the next
  1820. * update via this ext header.
  1821. * This is to make sure not all packets
  1822. * need to include this header.
  1823. */
  1824. /* DWORD 2: tx chain mask, tx retries */
  1825. A_UINT32
  1826. /* chain_mask - specify which chains to transmit from */
  1827. chain_mask : 8,
  1828. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1829. * TODO: Update Enum values for key_flags
  1830. */
  1831. /*
  1832. * Channel frequency: This identifies the desired channel
  1833. * frequency (in MHz) for tx frames. This is used by FW to help
  1834. * determine when it is safe to transmit or drop frames for
  1835. * off-channel operation.
  1836. * The default value of zero indicates to FW that the corresponding
  1837. * VDEV's home channel (if there is one) is the desired channel
  1838. * frequency.
  1839. */
  1840. chanfreq : 16;
  1841. /* DWORD 3: tx expiry time (TSF) LSBs */
  1842. A_UINT32 expire_tsf_lo;
  1843. /* DWORD 4: tx expiry time (TSF) MSBs */
  1844. A_UINT32 expire_tsf_hi;
  1845. /* DWORD 5: flags to control routing / processing of the MSDU */
  1846. A_UINT32
  1847. /* learning_frame
  1848. * When this flag is set, this frame will be dropped by FW
  1849. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1850. */
  1851. learning_frame : 1,
  1852. /* send_as_standalone
  1853. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1854. * i.e. with no A-MSDU or A-MPDU aggregation.
  1855. * The scope is extended to other use-cases.
  1856. */
  1857. send_as_standalone : 1,
  1858. /* is_host_opaque_valid
  1859. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1860. * with valid information.
  1861. */
  1862. is_host_opaque_valid : 1,
  1863. traffic_end_indication: 1,
  1864. rsvd0 : 28;
  1865. /* DWORD 6 : Host opaque cookie for special frames */
  1866. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1867. rsvd1 : 16;
  1868. /*
  1869. * This structure can be expanded further up to 40 bytes
  1870. * by adding further DWORDs as needed.
  1871. */
  1872. } POSTPACK;
  1873. /* DWORD 0 */
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1880. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1881. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1882. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1883. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1884. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1885. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1886. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1887. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1888. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1889. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1890. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1891. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1892. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1893. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1894. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1895. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1896. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1897. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1898. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1899. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1900. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1901. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1902. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1903. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1904. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1905. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1906. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1907. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1908. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1909. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1910. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1911. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1912. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1913. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1914. /* DWORD 1 */
  1915. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1916. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1917. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1918. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1919. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1920. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1921. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1922. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1923. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1924. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1925. /* DWORD 2 */
  1926. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1927. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1928. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1929. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1930. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1931. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1932. /* DWORD 5 */
  1933. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1934. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1935. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1936. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1937. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1938. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1939. /* DWORD 6 */
  1940. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1941. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1942. /* DWORD 0 */
  1943. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1944. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1945. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1946. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1947. do { \
  1948. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1949. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1950. } while (0)
  1951. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1952. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1953. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1954. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1955. do { \
  1956. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1957. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1958. } while (0)
  1959. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1960. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1961. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1962. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1963. do { \
  1964. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1965. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1966. } while (0)
  1967. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1968. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1969. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1970. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1971. do { \
  1972. HTT_CHECK_SET_VAL( \
  1973. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1974. ((_var) |= ((_val) \
  1975. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1976. } while (0)
  1977. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1978. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1979. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1980. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1981. do { \
  1982. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1983. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1984. } while (0)
  1985. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1986. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1987. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1988. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1989. do { \
  1990. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1991. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1992. } while (0)
  1993. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1994. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1995. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1996. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1997. do { \
  1998. HTT_CHECK_SET_VAL( \
  1999. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  2000. ((_var) |= ((_val) \
  2001. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  2002. } while (0)
  2003. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  2004. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  2005. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  2006. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  2007. do { \
  2008. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  2009. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  2010. } while (0)
  2011. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  2012. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  2013. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  2014. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  2015. do { \
  2016. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  2017. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  2018. } while (0)
  2019. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  2020. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  2021. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  2022. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  2023. do { \
  2024. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  2025. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  2026. } while (0)
  2027. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  2028. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  2029. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  2030. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  2031. do { \
  2032. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  2033. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  2034. } while (0)
  2035. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2036. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2037. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2038. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2039. do { \
  2040. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2041. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2042. } while (0)
  2043. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2044. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2045. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2046. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2047. do { \
  2048. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2049. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2050. } while (0)
  2051. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2052. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2053. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2054. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2055. do { \
  2056. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2057. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2058. } while (0)
  2059. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2060. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2061. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2062. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2063. do { \
  2064. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2065. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2066. } while (0)
  2067. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2068. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2069. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2070. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2071. do { \
  2072. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2073. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2074. } while (0)
  2075. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2076. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2077. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2078. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2079. do { \
  2080. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2081. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2082. } while (0)
  2083. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2084. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2085. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2086. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2087. do { \
  2088. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2089. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2090. } while (0)
  2091. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2092. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2093. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2094. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2095. do { \
  2096. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2097. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2098. } while (0)
  2099. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2100. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2101. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2102. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2103. do { \
  2104. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2105. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2106. } while (0)
  2107. /* DWORD 1 */
  2108. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2109. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2110. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2111. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2112. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2113. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2114. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2115. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2116. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2117. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2118. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2119. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2120. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2121. do { \
  2122. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2123. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2124. } while (0)
  2125. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2126. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2127. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2128. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2129. do { \
  2130. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2131. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2132. } while (0)
  2133. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2134. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2135. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2136. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2137. do { \
  2138. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2139. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2140. } while (0)
  2141. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2142. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2143. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2144. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2145. do { \
  2146. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2147. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2148. } while (0)
  2149. /* DWORD 2 */
  2150. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2151. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2152. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2153. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2154. do { \
  2155. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2156. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2157. } while (0)
  2158. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2159. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2160. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2161. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2162. do { \
  2163. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2164. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2165. } while (0)
  2166. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2167. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2168. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2169. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2170. do { \
  2171. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2172. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2173. } while (0)
  2174. /* DWORD 5 */
  2175. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2176. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2177. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2178. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2179. do { \
  2180. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2181. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2182. } while (0)
  2183. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2184. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2185. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2186. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2187. do { \
  2188. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2189. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2190. } while (0)
  2191. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2192. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2193. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2194. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2195. do { \
  2196. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2197. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2198. } while (0)
  2199. /* DWORD 6 */
  2200. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2201. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2202. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2203. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2204. do { \
  2205. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2206. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2207. } while (0)
  2208. typedef enum {
  2209. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2210. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2211. } htt_tcl_metadata_type;
  2212. /**
  2213. * @brief HTT TCL command number format
  2214. * @details
  2215. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2216. * available to firmware as tcl_exit_base->tcl_status_number.
  2217. * For regular / multicast packets host will send vdev and mac id and for
  2218. * NAWDS packets, host will send peer id.
  2219. * A_UINT32 is used to avoid endianness conversion problems.
  2220. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2221. */
  2222. typedef struct {
  2223. A_UINT32
  2224. type: 1, /* vdev_id based or peer_id based */
  2225. rsvd: 31;
  2226. } htt_tx_tcl_vdev_or_peer_t;
  2227. typedef struct {
  2228. A_UINT32
  2229. type: 1, /* vdev_id based or peer_id based */
  2230. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2231. vdev_id: 8,
  2232. pdev_id: 2,
  2233. host_inspected:1,
  2234. rsvd: 19;
  2235. } htt_tx_tcl_vdev_metadata;
  2236. typedef struct {
  2237. A_UINT32
  2238. type: 1, /* vdev_id based or peer_id based */
  2239. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2240. peer_id: 14,
  2241. rsvd: 16;
  2242. } htt_tx_tcl_peer_metadata;
  2243. PREPACK struct htt_tx_tcl_metadata {
  2244. union {
  2245. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2246. htt_tx_tcl_vdev_metadata vdev_meta;
  2247. htt_tx_tcl_peer_metadata peer_meta;
  2248. };
  2249. } POSTPACK;
  2250. /* DWORD 0 */
  2251. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2252. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2253. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2254. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2255. /* VDEV metadata */
  2256. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2257. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2258. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2259. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2260. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2261. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2262. /* PEER metadata */
  2263. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2264. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2265. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2266. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2267. HTT_TX_TCL_METADATA_TYPE_S)
  2268. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2269. do { \
  2270. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2271. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2272. } while (0)
  2273. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2274. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2275. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2276. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2277. do { \
  2278. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2279. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2280. } while (0)
  2281. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2282. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2283. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2284. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2285. do { \
  2286. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2287. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2288. } while (0)
  2289. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2290. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2291. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2292. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2293. do { \
  2294. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2295. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2296. } while (0)
  2297. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2298. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2299. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2300. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2301. do { \
  2302. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2303. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2304. } while (0)
  2305. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2306. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2307. HTT_TX_TCL_METADATA_PEER_ID_S)
  2308. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2309. do { \
  2310. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2311. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2312. } while (0)
  2313. /*------------------------------------------------------------------
  2314. * V2 Version of TCL Data Command
  2315. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2316. * MLO global_seq all flavours of TCL Data Cmd.
  2317. *-----------------------------------------------------------------*/
  2318. typedef enum {
  2319. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2320. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2321. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2322. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2323. } htt_tcl_metadata_type_v2;
  2324. /**
  2325. * @brief HTT TCL command number format
  2326. * @details
  2327. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2328. * available to firmware as tcl_exit_base->tcl_status_number.
  2329. * A_UINT32 is used to avoid endianness conversion problems.
  2330. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2331. */
  2332. typedef struct {
  2333. A_UINT32
  2334. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2335. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2336. vdev_id: 8,
  2337. pdev_id: 2,
  2338. host_inspected:1,
  2339. rsvd: 2,
  2340. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2341. } htt_tx_tcl_vdev_metadata_v2;
  2342. typedef struct {
  2343. A_UINT32
  2344. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2345. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2346. peer_id: 13,
  2347. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2348. } htt_tx_tcl_peer_metadata_v2;
  2349. typedef struct {
  2350. A_UINT32
  2351. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2352. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2353. svc_class_id: 8,
  2354. rsvd: 5,
  2355. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2356. } htt_tx_tcl_svc_class_id_metadata;
  2357. typedef struct {
  2358. A_UINT32
  2359. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2360. host_inspected: 1,
  2361. global_seq_no: 12,
  2362. rsvd: 1,
  2363. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2364. } htt_tx_tcl_global_seq_metadata;
  2365. PREPACK struct htt_tx_tcl_metadata_v2 {
  2366. union {
  2367. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2368. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2369. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2370. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2371. };
  2372. } POSTPACK;
  2373. /* DWORD 0 */
  2374. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2375. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2376. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2377. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2378. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2379. /* VDEV V2 metadata */
  2380. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2381. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2382. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2383. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2384. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2385. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2386. /* PEER V2 metadata */
  2387. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2388. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2389. /* SVC_CLASS_ID metadata */
  2390. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2391. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2392. /* Global Seq no metadata */
  2393. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2394. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2395. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2396. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2397. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2398. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2399. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2400. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2401. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2402. do { \
  2403. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2404. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2405. } while (0)
  2406. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2407. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2408. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2409. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2410. do { \
  2411. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2412. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2413. } while (0)
  2414. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2415. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2416. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2417. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2418. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2419. do { \
  2420. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2421. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2422. } while (0)
  2423. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2424. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2425. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2426. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2427. do { \
  2428. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2429. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2430. } while (0)
  2431. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2432. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2433. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2434. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2435. do { \
  2436. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2437. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2438. } while (0)
  2439. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2440. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2441. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2442. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2443. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2444. do { \
  2445. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2446. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2447. } while (0)
  2448. /*----- Get and Set V2 type field in Service Class fields ----*/
  2449. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2450. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2451. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2452. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2453. do { \
  2454. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2455. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2456. } while (0)
  2457. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2458. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2459. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2460. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2461. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2462. do { \
  2463. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2464. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2465. } while (0)
  2466. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2467. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2468. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2469. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2470. do { \
  2471. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2472. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2473. } while (0)
  2474. /*------------------------------------------------------------------
  2475. * End V2 Version of TCL Data Command
  2476. *-----------------------------------------------------------------*/
  2477. typedef enum {
  2478. HTT_TX_FW2WBM_TX_STATUS_OK,
  2479. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2480. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2481. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2482. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2483. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2484. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2485. HTT_TX_FW2WBM_TX_STATUS_MAX
  2486. } htt_tx_fw2wbm_tx_status_t;
  2487. typedef enum {
  2488. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2489. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2490. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2491. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2492. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2493. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2494. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2495. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2496. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2497. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2498. } htt_tx_fw2wbm_reinject_reason_t;
  2499. /**
  2500. * @brief HTT TX WBM Completion from firmware to host
  2501. * @details
  2502. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2503. * DWORD 3 and 4 for software based completions (Exception frames and
  2504. * TQM bypass frames)
  2505. * For software based completions, wbm_release_ring->release_source_module will
  2506. * be set to release_source_fw
  2507. */
  2508. PREPACK struct htt_tx_wbm_completion {
  2509. A_UINT32
  2510. sch_cmd_id: 24,
  2511. exception_frame: 1, /* If set, this packet was queued via exception path */
  2512. rsvd0_31_25: 7;
  2513. A_UINT32
  2514. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2515. * reception of an ACK or BA, this field indicates
  2516. * the RSSI of the received ACK or BA frame.
  2517. * When the frame is removed as result of a direct
  2518. * remove command from the SW, this field is set
  2519. * to 0x0 (which is never a valid value when real
  2520. * RSSI is available).
  2521. * Units: dB w.r.t noise floor
  2522. */
  2523. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2524. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2525. rsvd1_31_16: 16;
  2526. } POSTPACK;
  2527. /* DWORD 0 */
  2528. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2529. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2530. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2531. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2532. /* DWORD 1 */
  2533. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2534. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2535. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2536. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2537. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2538. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2539. /* DWORD 0 */
  2540. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2541. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2542. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2543. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2544. do { \
  2545. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2546. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2547. } while (0)
  2548. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2549. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2550. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2551. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2552. do { \
  2553. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2554. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2555. } while (0)
  2556. /* DWORD 1 */
  2557. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2558. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2559. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2560. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2561. do { \
  2562. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2563. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2564. } while (0)
  2565. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2566. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2567. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2568. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2569. do { \
  2570. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2571. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2572. } while (0)
  2573. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2574. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2575. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2576. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2577. do { \
  2578. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2579. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2580. } while (0)
  2581. /**
  2582. * @brief HTT TX WBM Completion from firmware to host
  2583. * @details
  2584. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2585. * (WBM) offload HW.
  2586. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2587. * For software based completions, release_source_module will
  2588. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2589. * struct wbm_release_ring and then switch to this after looking at
  2590. * release_source_module.
  2591. */
  2592. PREPACK struct htt_tx_wbm_completion_v2 {
  2593. A_UINT32
  2594. used_by_hw0; /* Refer to struct wbm_release_ring */
  2595. A_UINT32
  2596. used_by_hw1; /* Refer to struct wbm_release_ring */
  2597. A_UINT32
  2598. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2599. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2600. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2601. exception_frame: 1,
  2602. rsvd0: 12, /* For future use */
  2603. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2604. rsvd1: 1; /* For future use */
  2605. A_UINT32
  2606. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2607. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2608. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2609. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2610. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2611. */
  2612. A_UINT32
  2613. data1: 32;
  2614. A_UINT32
  2615. data2: 32;
  2616. A_UINT32
  2617. used_by_hw3; /* Refer to struct wbm_release_ring */
  2618. } POSTPACK;
  2619. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2620. /* DWORD 3 */
  2621. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2622. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2623. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2624. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2625. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2626. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2627. /* DWORD 3 */
  2628. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2629. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2630. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2631. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2632. do { \
  2633. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2634. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2635. } while (0)
  2636. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2637. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2638. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2639. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2640. do { \
  2641. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2642. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2643. } while (0)
  2644. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2645. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2646. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2647. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2648. do { \
  2649. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2650. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2651. } while (0)
  2652. /**
  2653. * @brief HTT TX WBM Completion from firmware to host (V3)
  2654. * @details
  2655. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2656. * (WBM) offload HW.
  2657. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2658. * For software based completions, release_source_module will
  2659. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2660. * struct wbm_release_ring and then switch to this after looking at
  2661. * release_source_module.
  2662. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2663. * by new generations of targets.
  2664. */
  2665. PREPACK struct htt_tx_wbm_completion_v3 {
  2666. A_UINT32
  2667. used_by_hw0; /* Refer to struct wbm_release_ring */
  2668. A_UINT32
  2669. used_by_hw1; /* Refer to struct wbm_release_ring */
  2670. A_UINT32
  2671. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2672. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2673. used_by_hw3: 15;
  2674. A_UINT32
  2675. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2676. exception_frame: 1,
  2677. rsvd0: 27; /* For future use */
  2678. A_UINT32
  2679. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2680. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2681. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2682. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2683. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2684. */
  2685. A_UINT32
  2686. data1: 32;
  2687. A_UINT32
  2688. data2: 32;
  2689. A_UINT32
  2690. rsvd1: 20,
  2691. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2692. } POSTPACK;
  2693. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2694. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2695. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2696. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2697. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2698. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2699. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2700. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2701. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2702. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2703. do { \
  2704. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2705. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2706. } while (0)
  2707. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2708. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2709. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2710. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2711. do { \
  2712. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2713. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2714. } while (0)
  2715. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2716. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2717. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2718. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2719. do { \
  2720. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2721. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2722. } while (0)
  2723. typedef enum {
  2724. TX_FRAME_TYPE_UNDEFINED = 0,
  2725. TX_FRAME_TYPE_EAPOL = 1,
  2726. } htt_tx_wbm_status_frame_type;
  2727. /**
  2728. * @brief HTT TX WBM transmit status from firmware to host
  2729. * @details
  2730. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2731. * (WBM) offload HW.
  2732. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2733. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2734. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2735. */
  2736. PREPACK struct htt_tx_wbm_transmit_status {
  2737. A_UINT32
  2738. sch_cmd_id: 24,
  2739. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2740. * reception of an ACK or BA, this field indicates
  2741. * the RSSI of the received ACK or BA frame.
  2742. * When the frame is removed as result of a direct
  2743. * remove command from the SW, this field is set
  2744. * to 0x0 (which is never a valid value when real
  2745. * RSSI is available).
  2746. * Units: dB w.r.t noise floor
  2747. */
  2748. A_UINT32
  2749. sw_peer_id: 16,
  2750. tid_num: 5,
  2751. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2752. * and tid_num fields contain valid data.
  2753. * If this "valid" flag is not set, the
  2754. * sw_peer_id and tid_num fields must be ignored.
  2755. */
  2756. mcast: 1,
  2757. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2758. * contains valid data.
  2759. */
  2760. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2761. reserved: 4;
  2762. A_UINT32
  2763. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2764. * packets in the wbm completion path
  2765. */
  2766. } POSTPACK;
  2767. /* DWORD 4 */
  2768. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2769. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2770. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2771. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2772. /* DWORD 5 */
  2773. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2774. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2775. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2776. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2777. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2778. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2779. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2780. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2781. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2782. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2783. /* DWORD 4 */
  2784. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2785. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2786. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2787. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2788. do { \
  2789. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2790. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2791. } while (0)
  2792. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2793. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2794. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2795. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2796. do { \
  2797. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2798. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2799. } while (0)
  2800. /* DWORD 5 */
  2801. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2802. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2803. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2804. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2805. do { \
  2806. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2807. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2808. } while (0)
  2809. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2810. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2811. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2812. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2813. do { \
  2814. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2815. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2816. } while (0)
  2817. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2818. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2819. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2820. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2821. do { \
  2822. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2823. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2824. } while (0)
  2825. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2826. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2827. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2828. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2829. do { \
  2830. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2831. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2832. } while (0)
  2833. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2834. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2835. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2836. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2837. do { \
  2838. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2839. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2840. } while (0)
  2841. /**
  2842. * @brief HTT TX WBM reinject status from firmware to host
  2843. * @details
  2844. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2845. * (WBM) offload HW.
  2846. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2847. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2848. */
  2849. PREPACK struct htt_tx_wbm_reinject_status {
  2850. A_UINT32
  2851. reserved0: 32;
  2852. A_UINT32
  2853. reserved1: 32;
  2854. A_UINT32
  2855. reserved2: 32;
  2856. } POSTPACK;
  2857. /**
  2858. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2859. * @details
  2860. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2861. * (WBM) offload HW.
  2862. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2863. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2864. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2865. * STA side.
  2866. */
  2867. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2868. A_UINT32
  2869. mec_sa_addr_31_0;
  2870. A_UINT32
  2871. mec_sa_addr_47_32: 16,
  2872. sa_ast_index: 16;
  2873. A_UINT32
  2874. vdev_id: 8,
  2875. reserved0: 24;
  2876. } POSTPACK;
  2877. /* DWORD 4 - mec_sa_addr_31_0 */
  2878. /* DWORD 5 */
  2879. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2880. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2881. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2882. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2883. /* DWORD 6 */
  2884. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2885. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2886. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2887. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2888. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2889. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2890. do { \
  2891. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2892. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2893. } while (0)
  2894. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2895. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2896. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2897. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2898. do { \
  2899. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2900. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2901. } while (0)
  2902. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2903. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2904. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2905. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2906. do { \
  2907. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2908. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2909. } while (0)
  2910. typedef enum {
  2911. TX_FLOW_PRIORITY_BE,
  2912. TX_FLOW_PRIORITY_HIGH,
  2913. TX_FLOW_PRIORITY_LOW,
  2914. } htt_tx_flow_priority_t;
  2915. typedef enum {
  2916. TX_FLOW_LATENCY_SENSITIVE,
  2917. TX_FLOW_LATENCY_INSENSITIVE,
  2918. } htt_tx_flow_latency_t;
  2919. typedef enum {
  2920. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2921. TX_FLOW_INTERACTIVE_TRAFFIC,
  2922. TX_FLOW_PERIODIC_TRAFFIC,
  2923. TX_FLOW_BURSTY_TRAFFIC,
  2924. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2925. } htt_tx_flow_traffic_pattern_t;
  2926. /**
  2927. * @brief HTT TX Flow search metadata format
  2928. * @details
  2929. * Host will set this metadata in flow table's flow search entry along with
  2930. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2931. * firmware and TQM ring if the flow search entry wins.
  2932. * This metadata is available to firmware in that first MSDU's
  2933. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2934. * to one of the available flows for specific tid and returns the tqm flow
  2935. * pointer as part of htt_tx_map_flow_info message.
  2936. */
  2937. PREPACK struct htt_tx_flow_metadata {
  2938. A_UINT32
  2939. rsvd0_1_0: 2,
  2940. tid: 4,
  2941. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2942. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2943. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2944. * Else choose final tid based on latency, priority.
  2945. */
  2946. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2947. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2948. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2949. } POSTPACK;
  2950. /* DWORD 0 */
  2951. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2952. #define HTT_TX_FLOW_METADATA_TID_S 2
  2953. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2954. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2955. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2956. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2957. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2958. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2959. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2960. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2961. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2962. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2963. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2964. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2965. /* DWORD 0 */
  2966. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2967. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2968. HTT_TX_FLOW_METADATA_TID_S)
  2969. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2970. do { \
  2971. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2972. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2973. } while (0)
  2974. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2975. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2976. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2977. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2978. do { \
  2979. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2980. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2981. } while (0)
  2982. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2983. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2984. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2985. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2986. do { \
  2987. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2988. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2989. } while (0)
  2990. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2991. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2992. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2993. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2994. do { \
  2995. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2996. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2997. } while (0)
  2998. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2999. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  3000. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  3001. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  3002. do { \
  3003. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  3004. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  3005. } while (0)
  3006. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  3007. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  3008. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  3009. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  3010. do { \
  3011. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  3012. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  3013. } while (0)
  3014. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  3015. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  3016. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  3017. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  3018. do { \
  3019. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  3020. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  3021. } while (0)
  3022. /**
  3023. * @brief host -> target ADD WDS Entry
  3024. *
  3025. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  3026. *
  3027. * @brief host -> target DELETE WDS Entry
  3028. *
  3029. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  3030. *
  3031. * @details
  3032. * HTT wds entry from source port learning
  3033. * Host will learn wds entries from rx and send this message to firmware
  3034. * to enable firmware to configure/delete AST entries for wds clients.
  3035. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3036. * and when SA's entry is deleted, firmware removes this AST entry
  3037. *
  3038. * The message would appear as follows:
  3039. *
  3040. * |31 30|29 |17 16|15 8|7 0|
  3041. * |----------------+----------------+----------------+----------------|
  3042. * | rsvd0 |PDVID| vdev_id | msg_type |
  3043. * |-------------------------------------------------------------------|
  3044. * | sa_addr_31_0 |
  3045. * |-------------------------------------------------------------------|
  3046. * | | ta_peer_id | sa_addr_47_32 |
  3047. * |-------------------------------------------------------------------|
  3048. * Where PDVID = pdev_id
  3049. *
  3050. * The message is interpreted as follows:
  3051. *
  3052. * dword0 - b'0:7 - msg_type: This will be set to
  3053. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3054. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3055. *
  3056. * dword0 - b'8:15 - vdev_id
  3057. *
  3058. * dword0 - b'16:17 - pdev_id
  3059. *
  3060. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3061. *
  3062. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3063. *
  3064. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3065. *
  3066. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3067. */
  3068. PREPACK struct htt_wds_entry {
  3069. A_UINT32
  3070. msg_type: 8,
  3071. vdev_id: 8,
  3072. pdev_id: 2,
  3073. rsvd0: 14;
  3074. A_UINT32 sa_addr_31_0;
  3075. A_UINT32
  3076. sa_addr_47_32: 16,
  3077. ta_peer_id: 14,
  3078. rsvd2: 2;
  3079. } POSTPACK;
  3080. /* DWORD 0 */
  3081. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3082. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3083. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3084. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3085. /* DWORD 2 */
  3086. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3087. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3088. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3089. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3090. /* DWORD 0 */
  3091. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3092. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3093. HTT_WDS_ENTRY_VDEV_ID_S)
  3094. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3095. do { \
  3096. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3097. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3098. } while (0)
  3099. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3100. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3101. HTT_WDS_ENTRY_PDEV_ID_S)
  3102. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3103. do { \
  3104. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3105. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3106. } while (0)
  3107. /* DWORD 2 */
  3108. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3109. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3110. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3111. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3112. do { \
  3113. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3114. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3115. } while (0)
  3116. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3117. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3118. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3119. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3120. do { \
  3121. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3122. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3123. } while (0)
  3124. /**
  3125. * @brief MAC DMA rx ring setup specification
  3126. *
  3127. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3128. *
  3129. * @details
  3130. * To allow for dynamic rx ring reconfiguration and to avoid race
  3131. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3132. * it uses. Instead, it sends this message to the target, indicating how
  3133. * the rx ring used by the host should be set up and maintained.
  3134. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3135. * specifications.
  3136. *
  3137. * |31 16|15 8|7 0|
  3138. * |---------------------------------------------------------------|
  3139. * header: | reserved | num rings | msg type |
  3140. * |---------------------------------------------------------------|
  3141. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3142. #if HTT_PADDR64
  3143. * | FW_IDX shadow register physical address (bits 63:32) |
  3144. #endif
  3145. * |---------------------------------------------------------------|
  3146. * | rx ring base physical address (bits 31:0) |
  3147. #if HTT_PADDR64
  3148. * | rx ring base physical address (bits 63:32) |
  3149. #endif
  3150. * |---------------------------------------------------------------|
  3151. * | rx ring buffer size | rx ring length |
  3152. * |---------------------------------------------------------------|
  3153. * | FW_IDX initial value | enabled flags |
  3154. * |---------------------------------------------------------------|
  3155. * | MSDU payload offset | 802.11 header offset |
  3156. * |---------------------------------------------------------------|
  3157. * | PPDU end offset | PPDU start offset |
  3158. * |---------------------------------------------------------------|
  3159. * | MPDU end offset | MPDU start offset |
  3160. * |---------------------------------------------------------------|
  3161. * | MSDU end offset | MSDU start offset |
  3162. * |---------------------------------------------------------------|
  3163. * | frag info offset | rx attention offset |
  3164. * |---------------------------------------------------------------|
  3165. * payload 2, if present, has the same format as payload 1
  3166. * Header fields:
  3167. * - MSG_TYPE
  3168. * Bits 7:0
  3169. * Purpose: identifies this as an rx ring configuration message
  3170. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3171. * - NUM_RINGS
  3172. * Bits 15:8
  3173. * Purpose: indicates whether the host is setting up one rx ring or two
  3174. * Value: 1 or 2
  3175. * Payload:
  3176. * for systems using 64-bit format for bus addresses:
  3177. * - IDX_SHADOW_REG_PADDR_LO
  3178. * Bits 31:0
  3179. * Value: lower 4 bytes of physical address of the host's
  3180. * FW_IDX shadow register
  3181. * - IDX_SHADOW_REG_PADDR_HI
  3182. * Bits 31:0
  3183. * Value: upper 4 bytes of physical address of the host's
  3184. * FW_IDX shadow register
  3185. * - RING_BASE_PADDR_LO
  3186. * Bits 31:0
  3187. * Value: lower 4 bytes of physical address of the host's rx ring
  3188. * - RING_BASE_PADDR_HI
  3189. * Bits 31:0
  3190. * Value: uppper 4 bytes of physical address of the host's rx ring
  3191. * for systems using 32-bit format for bus addresses:
  3192. * - IDX_SHADOW_REG_PADDR
  3193. * Bits 31:0
  3194. * Value: physical address of the host's FW_IDX shadow register
  3195. * - RING_BASE_PADDR
  3196. * Bits 31:0
  3197. * Value: physical address of the host's rx ring
  3198. * - RING_LEN
  3199. * Bits 15:0
  3200. * Value: number of elements in the rx ring
  3201. * - RING_BUF_SZ
  3202. * Bits 31:16
  3203. * Value: size of the buffers referenced by the rx ring, in byte units
  3204. * - ENABLED_FLAGS
  3205. * Bits 15:0
  3206. * Value: 1-bit flags to show whether different rx fields are enabled
  3207. * bit 0: 802.11 header enabled (1) or disabled (0)
  3208. * bit 1: MSDU payload enabled (1) or disabled (0)
  3209. * bit 2: PPDU start enabled (1) or disabled (0)
  3210. * bit 3: PPDU end enabled (1) or disabled (0)
  3211. * bit 4: MPDU start enabled (1) or disabled (0)
  3212. * bit 5: MPDU end enabled (1) or disabled (0)
  3213. * bit 6: MSDU start enabled (1) or disabled (0)
  3214. * bit 7: MSDU end enabled (1) or disabled (0)
  3215. * bit 8: rx attention enabled (1) or disabled (0)
  3216. * bit 9: frag info enabled (1) or disabled (0)
  3217. * bit 10: unicast rx enabled (1) or disabled (0)
  3218. * bit 11: multicast rx enabled (1) or disabled (0)
  3219. * bit 12: ctrl rx enabled (1) or disabled (0)
  3220. * bit 13: mgmt rx enabled (1) or disabled (0)
  3221. * bit 14: null rx enabled (1) or disabled (0)
  3222. * bit 15: phy data rx enabled (1) or disabled (0)
  3223. * - IDX_INIT_VAL
  3224. * Bits 31:16
  3225. * Purpose: Specify the initial value for the FW_IDX.
  3226. * Value: the number of buffers initially present in the host's rx ring
  3227. * - OFFSET_802_11_HDR
  3228. * Bits 15:0
  3229. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3230. * - OFFSET_MSDU_PAYLOAD
  3231. * Bits 31:16
  3232. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3233. * - OFFSET_PPDU_START
  3234. * Bits 15:0
  3235. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3236. * - OFFSET_PPDU_END
  3237. * Bits 31:16
  3238. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3239. * - OFFSET_MPDU_START
  3240. * Bits 15:0
  3241. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3242. * - OFFSET_MPDU_END
  3243. * Bits 31:16
  3244. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3245. * - OFFSET_MSDU_START
  3246. * Bits 15:0
  3247. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3248. * - OFFSET_MSDU_END
  3249. * Bits 31:16
  3250. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3251. * - OFFSET_RX_ATTN
  3252. * Bits 15:0
  3253. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3254. * - OFFSET_FRAG_INFO
  3255. * Bits 31:16
  3256. * Value: offset in QUAD-bytes of frag info table
  3257. */
  3258. /* header fields */
  3259. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3260. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3261. /* payload fields */
  3262. /* for systems using a 64-bit format for bus addresses */
  3263. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3264. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3265. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3266. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3267. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3268. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3269. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3270. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3271. /* for systems using a 32-bit format for bus addresses */
  3272. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3273. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3274. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3275. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3276. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3277. #define HTT_RX_RING_CFG_LEN_S 0
  3278. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3279. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3280. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3281. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3282. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3283. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3284. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3285. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3286. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3287. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3288. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3289. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3290. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3291. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3292. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3293. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3294. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3295. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3296. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3297. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3298. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3299. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3300. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3301. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3302. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3303. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3304. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3305. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3306. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3307. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3308. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3309. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3310. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3311. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3312. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3313. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3314. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3315. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3316. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3317. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3318. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3319. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3320. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3321. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3322. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3323. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3324. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3325. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3326. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3327. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3328. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3329. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3330. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3331. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3332. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3333. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3334. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3335. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3336. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3337. #if HTT_PADDR64
  3338. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3339. #else
  3340. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3341. #endif
  3342. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3343. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3344. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3345. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3346. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3347. do { \
  3348. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3349. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3350. } while (0)
  3351. /* degenerate case for 32-bit fields */
  3352. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3353. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3354. ((_var) = (_val))
  3355. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3356. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3357. ((_var) = (_val))
  3358. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3359. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3360. ((_var) = (_val))
  3361. /* degenerate case for 32-bit fields */
  3362. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3363. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3364. ((_var) = (_val))
  3365. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3366. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3367. ((_var) = (_val))
  3368. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3369. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3370. ((_var) = (_val))
  3371. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3372. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3373. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3374. do { \
  3375. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3376. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3377. } while (0)
  3378. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3379. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3380. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3381. do { \
  3382. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3383. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3384. } while (0)
  3385. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3386. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3387. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3388. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3389. do { \
  3390. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3391. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3392. } while (0)
  3393. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3394. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3395. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3396. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3397. do { \
  3398. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3399. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3400. } while (0)
  3401. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3402. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3403. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3404. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3405. do { \
  3406. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3407. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3408. } while (0)
  3409. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3410. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3411. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3412. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3413. do { \
  3414. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3415. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3416. } while (0)
  3417. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3418. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3419. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3420. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3421. do { \
  3422. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3423. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3424. } while (0)
  3425. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3426. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3427. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3428. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3429. do { \
  3430. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3431. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3432. } while (0)
  3433. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3434. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3435. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3436. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3437. do { \
  3438. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3439. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3440. } while (0)
  3441. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3442. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3443. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3444. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3445. do { \
  3446. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3447. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3448. } while (0)
  3449. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3450. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3451. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3452. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3453. do { \
  3454. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3455. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3456. } while (0)
  3457. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3458. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3459. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3460. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3461. do { \
  3462. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3463. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3464. } while (0)
  3465. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3466. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3467. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3468. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3469. do { \
  3470. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3471. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3472. } while (0)
  3473. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3474. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3475. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3476. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3477. do { \
  3478. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3479. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3480. } while (0)
  3481. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3482. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3483. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3484. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3485. do { \
  3486. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3487. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3488. } while (0)
  3489. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3490. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3491. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3492. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3493. do { \
  3494. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3495. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3496. } while (0)
  3497. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3498. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3499. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3500. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3501. do { \
  3502. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3503. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3504. } while (0)
  3505. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3506. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3507. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3508. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3509. do { \
  3510. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3511. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3512. } while (0)
  3513. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3514. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3515. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3516. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3517. do { \
  3518. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3519. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3520. } while (0)
  3521. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3522. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3523. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3524. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3525. do { \
  3526. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3527. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3528. } while (0)
  3529. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3530. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3531. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3532. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3533. do { \
  3534. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3535. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3536. } while (0)
  3537. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3538. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3539. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3540. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3541. do { \
  3542. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3543. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3544. } while (0)
  3545. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3546. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3547. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3548. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3549. do { \
  3550. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3551. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3552. } while (0)
  3553. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3554. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3555. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3556. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3557. do { \
  3558. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3559. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3560. } while (0)
  3561. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3562. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3563. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3564. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3565. do { \
  3566. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3567. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3568. } while (0)
  3569. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3570. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3571. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3572. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3573. do { \
  3574. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3575. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3576. } while (0)
  3577. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3578. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3579. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3580. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3581. do { \
  3582. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3583. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3584. } while (0)
  3585. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3586. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3587. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3588. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3589. do { \
  3590. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3591. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3592. } while (0)
  3593. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3594. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3595. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3596. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3597. do { \
  3598. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3599. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3600. } while (0)
  3601. /**
  3602. * @brief host -> target FW statistics retrieve
  3603. *
  3604. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3605. *
  3606. * @details
  3607. * The following field definitions describe the format of the HTT host
  3608. * to target FW stats retrieve message. The message specifies the type of
  3609. * stats host wants to retrieve.
  3610. *
  3611. * |31 24|23 16|15 8|7 0|
  3612. * |-----------------------------------------------------------|
  3613. * | stats types request bitmask | msg type |
  3614. * |-----------------------------------------------------------|
  3615. * | stats types reset bitmask | reserved |
  3616. * |-----------------------------------------------------------|
  3617. * | stats type | config value |
  3618. * |-----------------------------------------------------------|
  3619. * | cookie LSBs |
  3620. * |-----------------------------------------------------------|
  3621. * | cookie MSBs |
  3622. * |-----------------------------------------------------------|
  3623. * Header fields:
  3624. * - MSG_TYPE
  3625. * Bits 7:0
  3626. * Purpose: identifies this is a stats upload request message
  3627. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3628. * - UPLOAD_TYPES
  3629. * Bits 31:8
  3630. * Purpose: identifies which types of FW statistics to upload
  3631. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3632. * - RESET_TYPES
  3633. * Bits 31:8
  3634. * Purpose: identifies which types of FW statistics to reset
  3635. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3636. * - CFG_VAL
  3637. * Bits 23:0
  3638. * Purpose: give an opaque configuration value to the specified stats type
  3639. * Value: stats-type specific configuration value
  3640. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3641. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3642. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3643. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3644. * - CFG_STAT_TYPE
  3645. * Bits 31:24
  3646. * Purpose: specify which stats type (if any) the config value applies to
  3647. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3648. * a valid configuration specification
  3649. * - COOKIE_LSBS
  3650. * Bits 31:0
  3651. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3652. * message with its preceding host->target stats request message.
  3653. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3654. * - COOKIE_MSBS
  3655. * Bits 31:0
  3656. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3657. * message with its preceding host->target stats request message.
  3658. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3659. */
  3660. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3661. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3662. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3663. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3664. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3665. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3666. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3667. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3668. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3669. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3670. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3671. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3672. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3673. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3674. do { \
  3675. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3676. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3677. } while (0)
  3678. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3679. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3680. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3681. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3682. do { \
  3683. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3684. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3685. } while (0)
  3686. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3687. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3688. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3689. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3690. do { \
  3691. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3692. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3693. } while (0)
  3694. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3695. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3696. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3697. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3698. do { \
  3699. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3700. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3701. } while (0)
  3702. /**
  3703. * @brief host -> target HTT out-of-band sync request
  3704. *
  3705. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3706. *
  3707. * @details
  3708. * The HTT SYNC tells the target to suspend processing of subsequent
  3709. * HTT host-to-target messages until some other target agent locally
  3710. * informs the target HTT FW that the current sync counter is equal to
  3711. * or greater than (in a modulo sense) the sync counter specified in
  3712. * the SYNC message.
  3713. * This allows other host-target components to synchronize their operation
  3714. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3715. * security key has been downloaded to and activated by the target.
  3716. * In the absence of any explicit synchronization counter value
  3717. * specification, the target HTT FW will use zero as the default current
  3718. * sync value.
  3719. *
  3720. * |31 24|23 16|15 8|7 0|
  3721. * |-----------------------------------------------------------|
  3722. * | reserved | sync count | msg type |
  3723. * |-----------------------------------------------------------|
  3724. * Header fields:
  3725. * - MSG_TYPE
  3726. * Bits 7:0
  3727. * Purpose: identifies this as a sync message
  3728. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3729. * - SYNC_COUNT
  3730. * Bits 15:8
  3731. * Purpose: specifies what sync value the HTT FW will wait for from
  3732. * an out-of-band specification to resume its operation
  3733. * Value: in-band sync counter value to compare against the out-of-band
  3734. * counter spec.
  3735. * The HTT target FW will suspend its host->target message processing
  3736. * as long as
  3737. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3738. */
  3739. #define HTT_H2T_SYNC_MSG_SZ 4
  3740. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3741. #define HTT_H2T_SYNC_COUNT_S 8
  3742. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3743. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3744. HTT_H2T_SYNC_COUNT_S)
  3745. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3746. do { \
  3747. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3748. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3749. } while (0)
  3750. /**
  3751. * @brief host -> target HTT aggregation configuration
  3752. *
  3753. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3754. */
  3755. #define HTT_AGGR_CFG_MSG_SZ 4
  3756. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3757. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3758. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3759. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3760. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3761. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3762. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3763. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3764. do { \
  3765. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3766. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3767. } while (0)
  3768. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3769. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3770. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3771. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3772. do { \
  3773. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3774. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3775. } while (0)
  3776. /**
  3777. * @brief host -> target HTT configure max amsdu info per vdev
  3778. *
  3779. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3780. *
  3781. * @details
  3782. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3783. *
  3784. * |31 21|20 16|15 8|7 0|
  3785. * |-----------------------------------------------------------|
  3786. * | reserved | vdev id | max amsdu | msg type |
  3787. * |-----------------------------------------------------------|
  3788. * Header fields:
  3789. * - MSG_TYPE
  3790. * Bits 7:0
  3791. * Purpose: identifies this as a aggr cfg ex message
  3792. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3793. * - MAX_NUM_AMSDU_SUBFRM
  3794. * Bits 15:8
  3795. * Purpose: max MSDUs per A-MSDU
  3796. * - VDEV_ID
  3797. * Bits 20:16
  3798. * Purpose: ID of the vdev to which this limit is applied
  3799. */
  3800. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3801. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3802. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3803. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3804. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3805. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3806. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3807. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3808. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3809. do { \
  3810. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3811. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3812. } while (0)
  3813. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3814. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3815. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3816. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3817. do { \
  3818. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3819. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3820. } while (0)
  3821. /**
  3822. * @brief HTT WDI_IPA Config Message
  3823. *
  3824. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3825. *
  3826. * @details
  3827. * The HTT WDI_IPA config message is created/sent by host at driver
  3828. * init time. It contains information about data structures used on
  3829. * WDI_IPA TX and RX path.
  3830. * TX CE ring is used for pushing packet metadata from IPA uC
  3831. * to WLAN FW
  3832. * TX Completion ring is used for generating TX completions from
  3833. * WLAN FW to IPA uC
  3834. * RX Indication ring is used for indicating RX packets from FW
  3835. * to IPA uC
  3836. * RX Ring2 is used as either completion ring or as second
  3837. * indication ring. when Ring2 is used as completion ring, IPA uC
  3838. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3839. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3840. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3841. * indicated in RX Indication ring. Please see WDI_IPA specification
  3842. * for more details.
  3843. * |31 24|23 16|15 8|7 0|
  3844. * |----------------+----------------+----------------+----------------|
  3845. * | tx pkt pool size | Rsvd | msg_type |
  3846. * |-------------------------------------------------------------------|
  3847. * | tx comp ring base (bits 31:0) |
  3848. #if HTT_PADDR64
  3849. * | tx comp ring base (bits 63:32) |
  3850. #endif
  3851. * |-------------------------------------------------------------------|
  3852. * | tx comp ring size |
  3853. * |-------------------------------------------------------------------|
  3854. * | tx comp WR_IDX physical address (bits 31:0) |
  3855. #if HTT_PADDR64
  3856. * | tx comp WR_IDX physical address (bits 63:32) |
  3857. #endif
  3858. * |-------------------------------------------------------------------|
  3859. * | tx CE WR_IDX physical address (bits 31:0) |
  3860. #if HTT_PADDR64
  3861. * | tx CE WR_IDX physical address (bits 63:32) |
  3862. #endif
  3863. * |-------------------------------------------------------------------|
  3864. * | rx indication ring base (bits 31:0) |
  3865. #if HTT_PADDR64
  3866. * | rx indication ring base (bits 63:32) |
  3867. #endif
  3868. * |-------------------------------------------------------------------|
  3869. * | rx indication ring size |
  3870. * |-------------------------------------------------------------------|
  3871. * | rx ind RD_IDX physical address (bits 31:0) |
  3872. #if HTT_PADDR64
  3873. * | rx ind RD_IDX physical address (bits 63:32) |
  3874. #endif
  3875. * |-------------------------------------------------------------------|
  3876. * | rx ind WR_IDX physical address (bits 31:0) |
  3877. #if HTT_PADDR64
  3878. * | rx ind WR_IDX physical address (bits 63:32) |
  3879. #endif
  3880. * |-------------------------------------------------------------------|
  3881. * |-------------------------------------------------------------------|
  3882. * | rx ring2 base (bits 31:0) |
  3883. #if HTT_PADDR64
  3884. * | rx ring2 base (bits 63:32) |
  3885. #endif
  3886. * |-------------------------------------------------------------------|
  3887. * | rx ring2 size |
  3888. * |-------------------------------------------------------------------|
  3889. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3890. #if HTT_PADDR64
  3891. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3892. #endif
  3893. * |-------------------------------------------------------------------|
  3894. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3895. #if HTT_PADDR64
  3896. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3897. #endif
  3898. * |-------------------------------------------------------------------|
  3899. *
  3900. * Header fields:
  3901. * Header fields:
  3902. * - MSG_TYPE
  3903. * Bits 7:0
  3904. * Purpose: Identifies this as WDI_IPA config message
  3905. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3906. * - TX_PKT_POOL_SIZE
  3907. * Bits 15:0
  3908. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3909. * WDI_IPA TX path
  3910. * For systems using 32-bit format for bus addresses:
  3911. * - TX_COMP_RING_BASE_ADDR
  3912. * Bits 31:0
  3913. * Purpose: TX Completion Ring base address in DDR
  3914. * - TX_COMP_RING_SIZE
  3915. * Bits 31:0
  3916. * Purpose: TX Completion Ring size (must be power of 2)
  3917. * - TX_COMP_WR_IDX_ADDR
  3918. * Bits 31:0
  3919. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3920. * updates the Write Index for WDI_IPA TX completion ring
  3921. * - TX_CE_WR_IDX_ADDR
  3922. * Bits 31:0
  3923. * Purpose: DDR address where IPA uC
  3924. * updates the WR Index for TX CE ring
  3925. * (needed for fusion platforms)
  3926. * - RX_IND_RING_BASE_ADDR
  3927. * Bits 31:0
  3928. * Purpose: RX Indication Ring base address in DDR
  3929. * - RX_IND_RING_SIZE
  3930. * Bits 31:0
  3931. * Purpose: RX Indication Ring size
  3932. * - RX_IND_RD_IDX_ADDR
  3933. * Bits 31:0
  3934. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3935. * RX indication ring
  3936. * - RX_IND_WR_IDX_ADDR
  3937. * Bits 31:0
  3938. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3939. * updates the Write Index for WDI_IPA RX indication ring
  3940. * - RX_RING2_BASE_ADDR
  3941. * Bits 31:0
  3942. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3943. * - RX_RING2_SIZE
  3944. * Bits 31:0
  3945. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3946. * - RX_RING2_RD_IDX_ADDR
  3947. * Bits 31:0
  3948. * Purpose: If Second RX ring is Indication ring, DDR address where
  3949. * IPA uC updates the Read Index for Ring2.
  3950. * If Second RX ring is completion ring, this is NOT used
  3951. * - RX_RING2_WR_IDX_ADDR
  3952. * Bits 31:0
  3953. * Purpose: If Second RX ring is Indication ring, DDR address where
  3954. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3955. * If second RX ring is completion ring, DDR address where
  3956. * IPA uC updates the Write Index for Ring 2.
  3957. * For systems using 64-bit format for bus addresses:
  3958. * - TX_COMP_RING_BASE_ADDR_LO
  3959. * Bits 31:0
  3960. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3961. * - TX_COMP_RING_BASE_ADDR_HI
  3962. * Bits 31:0
  3963. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3964. * - TX_COMP_RING_SIZE
  3965. * Bits 31:0
  3966. * Purpose: TX Completion Ring size (must be power of 2)
  3967. * - TX_COMP_WR_IDX_ADDR_LO
  3968. * Bits 31:0
  3969. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3970. * Lower 4 bytes of DDR address where WIFI FW
  3971. * updates the Write Index for WDI_IPA TX completion ring
  3972. * - TX_COMP_WR_IDX_ADDR_HI
  3973. * Bits 31:0
  3974. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3975. * Higher 4 bytes of DDR address where WIFI FW
  3976. * updates the Write Index for WDI_IPA TX completion ring
  3977. * - TX_CE_WR_IDX_ADDR_LO
  3978. * Bits 31:0
  3979. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3980. * updates the WR Index for TX CE ring
  3981. * (needed for fusion platforms)
  3982. * - TX_CE_WR_IDX_ADDR_HI
  3983. * Bits 31:0
  3984. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3985. * updates the WR Index for TX CE ring
  3986. * (needed for fusion platforms)
  3987. * - RX_IND_RING_BASE_ADDR_LO
  3988. * Bits 31:0
  3989. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3990. * - RX_IND_RING_BASE_ADDR_HI
  3991. * Bits 31:0
  3992. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3993. * - RX_IND_RING_SIZE
  3994. * Bits 31:0
  3995. * Purpose: RX Indication Ring size
  3996. * - RX_IND_RD_IDX_ADDR_LO
  3997. * Bits 31:0
  3998. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3999. * for WDI_IPA RX indication ring
  4000. * - RX_IND_RD_IDX_ADDR_HI
  4001. * Bits 31:0
  4002. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  4003. * for WDI_IPA RX indication ring
  4004. * - RX_IND_WR_IDX_ADDR_LO
  4005. * Bits 31:0
  4006. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  4007. * Lower 4 bytes of DDR address where WIFI FW
  4008. * updates the Write Index for WDI_IPA RX indication ring
  4009. * - RX_IND_WR_IDX_ADDR_HI
  4010. * Bits 31:0
  4011. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  4012. * Higher 4 bytes of DDR address where WIFI FW
  4013. * updates the Write Index for WDI_IPA RX indication ring
  4014. * - RX_RING2_BASE_ADDR_LO
  4015. * Bits 31:0
  4016. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4017. * - RX_RING2_BASE_ADDR_HI
  4018. * Bits 31:0
  4019. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4020. * - RX_RING2_SIZE
  4021. * Bits 31:0
  4022. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  4023. * - RX_RING2_RD_IDX_ADDR_LO
  4024. * Bits 31:0
  4025. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4026. * DDR address where IPA uC updates the Read Index for Ring2.
  4027. * If Second RX ring is completion ring, this is NOT used
  4028. * - RX_RING2_RD_IDX_ADDR_HI
  4029. * Bits 31:0
  4030. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4031. * DDR address where IPA uC updates the Read Index for Ring2.
  4032. * If Second RX ring is completion ring, this is NOT used
  4033. * - RX_RING2_WR_IDX_ADDR_LO
  4034. * Bits 31:0
  4035. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4036. * DDR address where WIFI FW updates the Write Index
  4037. * for WDI_IPA RX ring2
  4038. * If second RX ring is completion ring, lower 4 bytes of
  4039. * DDR address where IPA uC updates the Write Index for Ring 2.
  4040. * - RX_RING2_WR_IDX_ADDR_HI
  4041. * Bits 31:0
  4042. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4043. * DDR address where WIFI FW updates the Write Index
  4044. * for WDI_IPA RX ring2
  4045. * If second RX ring is completion ring, higher 4 bytes of
  4046. * DDR address where IPA uC updates the Write Index for Ring 2.
  4047. */
  4048. #if HTT_PADDR64
  4049. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4050. #else
  4051. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4052. #endif
  4053. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4054. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4055. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4056. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4057. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4058. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4059. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4060. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4061. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4062. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4063. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4064. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4065. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4066. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4067. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4068. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4069. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4070. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4071. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4072. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4073. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4074. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4075. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4076. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4077. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4078. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4079. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4080. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4081. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4082. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4083. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4084. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4085. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4086. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4087. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4088. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4089. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4090. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4091. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4092. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4093. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4094. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4095. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4096. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4097. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4098. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4099. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4100. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4101. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4102. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4103. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4104. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4105. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4106. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4107. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4108. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4109. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4110. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4111. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4112. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4113. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4114. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4115. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4116. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4117. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4118. do { \
  4119. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4120. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4121. } while (0)
  4122. /* for systems using 32-bit format for bus addr */
  4123. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4124. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4125. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4126. do { \
  4127. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4128. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4129. } while (0)
  4130. /* for systems using 64-bit format for bus addr */
  4131. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4132. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4133. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4134. do { \
  4135. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4136. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4137. } while (0)
  4138. /* for systems using 64-bit format for bus addr */
  4139. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4140. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4141. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4142. do { \
  4143. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4144. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4145. } while (0)
  4146. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4147. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4148. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4149. do { \
  4150. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4151. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4152. } while (0)
  4153. /* for systems using 32-bit format for bus addr */
  4154. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4155. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4156. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4157. do { \
  4158. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4159. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4160. } while (0)
  4161. /* for systems using 64-bit format for bus addr */
  4162. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4163. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4164. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4165. do { \
  4166. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4167. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4168. } while (0)
  4169. /* for systems using 64-bit format for bus addr */
  4170. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4171. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4172. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4173. do { \
  4174. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4175. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4176. } while (0)
  4177. /* for systems using 32-bit format for bus addr */
  4178. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4179. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4180. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4181. do { \
  4182. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4183. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4184. } while (0)
  4185. /* for systems using 64-bit format for bus addr */
  4186. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4187. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4188. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4189. do { \
  4190. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4191. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4192. } while (0)
  4193. /* for systems using 64-bit format for bus addr */
  4194. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4195. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4196. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4197. do { \
  4198. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4199. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4200. } while (0)
  4201. /* for systems using 32-bit format for bus addr */
  4202. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4203. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4204. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4205. do { \
  4206. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4207. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4208. } while (0)
  4209. /* for systems using 64-bit format for bus addr */
  4210. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4211. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4212. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4213. do { \
  4214. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4215. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4216. } while (0)
  4217. /* for systems using 64-bit format for bus addr */
  4218. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4219. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4220. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4221. do { \
  4222. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4223. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4224. } while (0)
  4225. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4226. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4227. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4228. do { \
  4229. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4230. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4231. } while (0)
  4232. /* for systems using 32-bit format for bus addr */
  4233. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4234. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4235. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4236. do { \
  4237. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4238. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4239. } while (0)
  4240. /* for systems using 64-bit format for bus addr */
  4241. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4242. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4243. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4244. do { \
  4245. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4246. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4247. } while (0)
  4248. /* for systems using 64-bit format for bus addr */
  4249. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4250. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4251. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4252. do { \
  4253. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4254. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4255. } while (0)
  4256. /* for systems using 32-bit format for bus addr */
  4257. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4258. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4259. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4260. do { \
  4261. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4262. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4263. } while (0)
  4264. /* for systems using 64-bit format for bus addr */
  4265. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4266. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4267. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4268. do { \
  4269. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4270. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4271. } while (0)
  4272. /* for systems using 64-bit format for bus addr */
  4273. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4274. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4275. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4276. do { \
  4277. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4278. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4279. } while (0)
  4280. /* for systems using 32-bit format for bus addr */
  4281. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4282. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4283. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4284. do { \
  4285. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4286. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4287. } while (0)
  4288. /* for systems using 64-bit format for bus addr */
  4289. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4290. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4291. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4292. do { \
  4293. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4294. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4295. } while (0)
  4296. /* for systems using 64-bit format for bus addr */
  4297. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4298. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4299. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4300. do { \
  4301. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4302. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4303. } while (0)
  4304. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4305. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4306. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4307. do { \
  4308. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4309. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4310. } while (0)
  4311. /* for systems using 32-bit format for bus addr */
  4312. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4313. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4314. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4315. do { \
  4316. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4317. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4318. } while (0)
  4319. /* for systems using 64-bit format for bus addr */
  4320. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4321. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4322. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4323. do { \
  4324. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4325. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4326. } while (0)
  4327. /* for systems using 64-bit format for bus addr */
  4328. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4329. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4330. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4331. do { \
  4332. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4333. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4334. } while (0)
  4335. /* for systems using 32-bit format for bus addr */
  4336. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4337. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4338. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4339. do { \
  4340. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4341. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4342. } while (0)
  4343. /* for systems using 64-bit format for bus addr */
  4344. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4345. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4346. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4347. do { \
  4348. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4349. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4350. } while (0)
  4351. /* for systems using 64-bit format for bus addr */
  4352. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4353. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4354. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4355. do { \
  4356. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4357. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4358. } while (0)
  4359. /*
  4360. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4361. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4362. * addresses are stored in a XXX-bit field.
  4363. * This macro is used to define both htt_wdi_ipa_config32_t and
  4364. * htt_wdi_ipa_config64_t structs.
  4365. */
  4366. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4367. _paddr__tx_comp_ring_base_addr_, \
  4368. _paddr__tx_comp_wr_idx_addr_, \
  4369. _paddr__tx_ce_wr_idx_addr_, \
  4370. _paddr__rx_ind_ring_base_addr_, \
  4371. _paddr__rx_ind_rd_idx_addr_, \
  4372. _paddr__rx_ind_wr_idx_addr_, \
  4373. _paddr__rx_ring2_base_addr_,\
  4374. _paddr__rx_ring2_rd_idx_addr_,\
  4375. _paddr__rx_ring2_wr_idx_addr_) \
  4376. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4377. { \
  4378. /* DWORD 0: flags and meta-data */ \
  4379. A_UINT32 \
  4380. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4381. reserved: 8, \
  4382. tx_pkt_pool_size: 16;\
  4383. /* DWORD 1 */\
  4384. _paddr__tx_comp_ring_base_addr_;\
  4385. /* DWORD 2 (or 3)*/\
  4386. A_UINT32 tx_comp_ring_size;\
  4387. /* DWORD 3 (or 4)*/\
  4388. _paddr__tx_comp_wr_idx_addr_;\
  4389. /* DWORD 4 (or 6)*/\
  4390. _paddr__tx_ce_wr_idx_addr_;\
  4391. /* DWORD 5 (or 8)*/\
  4392. _paddr__rx_ind_ring_base_addr_;\
  4393. /* DWORD 6 (or 10)*/\
  4394. A_UINT32 rx_ind_ring_size;\
  4395. /* DWORD 7 (or 11)*/\
  4396. _paddr__rx_ind_rd_idx_addr_;\
  4397. /* DWORD 8 (or 13)*/\
  4398. _paddr__rx_ind_wr_idx_addr_;\
  4399. /* DWORD 9 (or 15)*/\
  4400. _paddr__rx_ring2_base_addr_;\
  4401. /* DWORD 10 (or 17) */\
  4402. A_UINT32 rx_ring2_size;\
  4403. /* DWORD 11 (or 18) */\
  4404. _paddr__rx_ring2_rd_idx_addr_;\
  4405. /* DWORD 12 (or 20) */\
  4406. _paddr__rx_ring2_wr_idx_addr_;\
  4407. } POSTPACK
  4408. /* define a htt_wdi_ipa_config32_t type */
  4409. 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));
  4410. /* define a htt_wdi_ipa_config64_t type */
  4411. 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));
  4412. #if HTT_PADDR64
  4413. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4414. #else
  4415. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4416. #endif
  4417. enum htt_wdi_ipa_op_code {
  4418. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4419. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4420. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4421. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4422. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4423. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4424. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4425. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4426. /* keep this last */
  4427. HTT_WDI_IPA_OPCODE_MAX
  4428. };
  4429. /**
  4430. * @brief HTT WDI_IPA Operation Request Message
  4431. *
  4432. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4433. *
  4434. * @details
  4435. * HTT WDI_IPA Operation Request message is sent by host
  4436. * to either suspend or resume WDI_IPA TX or RX path.
  4437. * |31 24|23 16|15 8|7 0|
  4438. * |----------------+----------------+----------------+----------------|
  4439. * | op_code | Rsvd | msg_type |
  4440. * |-------------------------------------------------------------------|
  4441. *
  4442. * Header fields:
  4443. * - MSG_TYPE
  4444. * Bits 7:0
  4445. * Purpose: Identifies this as WDI_IPA Operation Request message
  4446. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4447. * - OP_CODE
  4448. * Bits 31:16
  4449. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4450. * value: = enum htt_wdi_ipa_op_code
  4451. */
  4452. PREPACK struct htt_wdi_ipa_op_request_t
  4453. {
  4454. /* DWORD 0: flags and meta-data */
  4455. A_UINT32
  4456. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4457. reserved: 8,
  4458. op_code: 16;
  4459. } POSTPACK;
  4460. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4461. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4462. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4463. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4464. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4465. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4466. do { \
  4467. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4468. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4469. } while (0)
  4470. /*
  4471. * @brief host -> target HTT_MSI_SETUP message
  4472. *
  4473. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4474. *
  4475. * @details
  4476. * After target is booted up, host can send MSI setup message so that
  4477. * target sets up HW registers based on setup message.
  4478. *
  4479. * The message would appear as follows:
  4480. * |31 24|23 16|15|14 8|7 0|
  4481. * |---------------+-----------------+-----------------+-----------------|
  4482. * | reserved | msi_type | pdev_id | msg_type |
  4483. * |---------------------------------------------------------------------|
  4484. * | msi_addr_lo |
  4485. * |---------------------------------------------------------------------|
  4486. * | msi_addr_hi |
  4487. * |---------------------------------------------------------------------|
  4488. * | msi_data |
  4489. * |---------------------------------------------------------------------|
  4490. *
  4491. * The message is interpreted as follows:
  4492. * dword0 - b'0:7 - msg_type: This will be set to
  4493. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4494. * b'8:15 - pdev_id:
  4495. * 0 (for rings at SOC/UMAC level),
  4496. * 1/2/3 mac id (for rings at LMAC level)
  4497. * b'16:23 - msi_type: identify which msi registers need to be setup
  4498. * more details can be got from enum htt_msi_setup_type
  4499. * b'24:31 - reserved
  4500. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4501. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4502. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4503. */
  4504. PREPACK struct htt_msi_setup_t {
  4505. A_UINT32 msg_type: 8,
  4506. pdev_id: 8,
  4507. msi_type: 8,
  4508. reserved: 8;
  4509. A_UINT32 msi_addr_lo;
  4510. A_UINT32 msi_addr_hi;
  4511. A_UINT32 msi_data;
  4512. } POSTPACK;
  4513. enum htt_msi_setup_type {
  4514. HTT_PPDU_END_MSI_SETUP_TYPE,
  4515. /* Insert new types here*/
  4516. };
  4517. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4518. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4519. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4520. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4521. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4522. HTT_MSI_SETUP_PDEV_ID_S)
  4523. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4524. do { \
  4525. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4526. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4527. } while (0)
  4528. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4529. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4530. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4531. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4532. HTT_MSI_SETUP_MSI_TYPE_S)
  4533. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4534. do { \
  4535. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4536. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4537. } while (0)
  4538. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4539. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4540. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4541. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4542. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4543. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4544. do { \
  4545. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4546. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4547. } while (0)
  4548. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4549. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4550. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4551. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4552. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4553. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4554. do { \
  4555. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4556. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4557. } while (0)
  4558. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4559. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4560. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4561. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4562. HTT_MSI_SETUP_MSI_DATA_S)
  4563. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4564. do { \
  4565. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4566. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4567. } while (0)
  4568. /*
  4569. * @brief host -> target HTT_SRING_SETUP message
  4570. *
  4571. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4572. *
  4573. * @details
  4574. * After target is booted up, Host can send SRING setup message for
  4575. * each host facing LMAC SRING. Target setups up HW registers based
  4576. * on setup message and confirms back to Host if response_required is set.
  4577. * Host should wait for confirmation message before sending new SRING
  4578. * setup message
  4579. *
  4580. * The message would appear as follows:
  4581. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4582. * |--------------- +-----------------+-----------------+-----------------|
  4583. * | ring_type | ring_id | pdev_id | msg_type |
  4584. * |----------------------------------------------------------------------|
  4585. * | ring_base_addr_lo |
  4586. * |----------------------------------------------------------------------|
  4587. * | ring_base_addr_hi |
  4588. * |----------------------------------------------------------------------|
  4589. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4590. * |----------------------------------------------------------------------|
  4591. * | ring_head_offset32_remote_addr_lo |
  4592. * |----------------------------------------------------------------------|
  4593. * | ring_head_offset32_remote_addr_hi |
  4594. * |----------------------------------------------------------------------|
  4595. * | ring_tail_offset32_remote_addr_lo |
  4596. * |----------------------------------------------------------------------|
  4597. * | ring_tail_offset32_remote_addr_hi |
  4598. * |----------------------------------------------------------------------|
  4599. * | ring_msi_addr_lo |
  4600. * |----------------------------------------------------------------------|
  4601. * | ring_msi_addr_hi |
  4602. * |----------------------------------------------------------------------|
  4603. * | ring_msi_data |
  4604. * |----------------------------------------------------------------------|
  4605. * | intr_timer_th |IM| intr_batch_counter_th |
  4606. * |----------------------------------------------------------------------|
  4607. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4608. * |----------------------------------------------------------------------|
  4609. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4610. * |----------------------------------------------------------------------|
  4611. * Where
  4612. * IM = sw_intr_mode
  4613. * RR = response_required
  4614. * PTCF = prefetch_timer_cfg
  4615. * IP = IPA drop flag
  4616. *
  4617. * The message is interpreted as follows:
  4618. * dword0 - b'0:7 - msg_type: This will be set to
  4619. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4620. * b'8:15 - pdev_id:
  4621. * 0 (for rings at SOC/UMAC level),
  4622. * 1/2/3 mac id (for rings at LMAC level)
  4623. * b'16:23 - ring_id: identify which ring is to setup,
  4624. * more details can be got from enum htt_srng_ring_id
  4625. * b'24:31 - ring_type: identify type of host rings,
  4626. * more details can be got from enum htt_srng_ring_type
  4627. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4628. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4629. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4630. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4631. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4632. * SW_TO_HW_RING.
  4633. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4634. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4635. * Lower 32 bits of memory address of the remote variable
  4636. * storing the 4-byte word offset that identifies the head
  4637. * element within the ring.
  4638. * (The head offset variable has type A_UINT32.)
  4639. * Valid for HW_TO_SW and SW_TO_SW rings.
  4640. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4641. * Upper 32 bits of memory address of the remote variable
  4642. * storing the 4-byte word offset that identifies the head
  4643. * element within the ring.
  4644. * (The head offset variable has type A_UINT32.)
  4645. * Valid for HW_TO_SW and SW_TO_SW rings.
  4646. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4647. * Lower 32 bits of memory address of the remote variable
  4648. * storing the 4-byte word offset that identifies the tail
  4649. * element within the ring.
  4650. * (The tail offset variable has type A_UINT32.)
  4651. * Valid for HW_TO_SW and SW_TO_SW rings.
  4652. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4653. * Upper 32 bits of memory address of the remote variable
  4654. * storing the 4-byte word offset that identifies the tail
  4655. * element within the ring.
  4656. * (The tail offset variable has type A_UINT32.)
  4657. * Valid for HW_TO_SW and SW_TO_SW rings.
  4658. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4659. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4660. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4661. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4662. * dword10 - b'0:31 - ring_msi_data: MSI data
  4663. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4664. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4665. * dword11 - b'0:14 - intr_batch_counter_th:
  4666. * batch counter threshold is in units of 4-byte words.
  4667. * HW internally maintains and increments batch count.
  4668. * (see SRING spec for detail description).
  4669. * When batch count reaches threshold value, an interrupt
  4670. * is generated by HW.
  4671. * b'15 - sw_intr_mode:
  4672. * This configuration shall be static.
  4673. * Only programmed at power up.
  4674. * 0: generate pulse style sw interrupts
  4675. * 1: generate level style sw interrupts
  4676. * b'16:31 - intr_timer_th:
  4677. * The timer init value when timer is idle or is
  4678. * initialized to start downcounting.
  4679. * In 8us units (to cover a range of 0 to 524 ms)
  4680. * dword12 - b'0:15 - intr_low_threshold:
  4681. * Used only by Consumer ring to generate ring_sw_int_p.
  4682. * Ring entries low threshold water mark, that is used
  4683. * in combination with the interrupt timer as well as
  4684. * the the clearing of the level interrupt.
  4685. * b'16:18 - prefetch_timer_cfg:
  4686. * Used only by Consumer ring to set timer mode to
  4687. * support Application prefetch handling.
  4688. * The external tail offset/pointer will be updated
  4689. * at following intervals:
  4690. * 3'b000: (Prefetch feature disabled; used only for debug)
  4691. * 3'b001: 1 usec
  4692. * 3'b010: 4 usec
  4693. * 3'b011: 8 usec (default)
  4694. * 3'b100: 16 usec
  4695. * Others: Reserved
  4696. * b'19 - response_required:
  4697. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4698. * b'20 - ipa_drop_flag:
  4699. Indicates that host will config ipa drop threshold percentage
  4700. * b'21:31 - reserved: reserved for future use
  4701. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4702. * b'8:15 - ipa drop high threshold percentage:
  4703. * b'16:31 - Reserved
  4704. */
  4705. PREPACK struct htt_sring_setup_t {
  4706. A_UINT32 msg_type: 8,
  4707. pdev_id: 8,
  4708. ring_id: 8,
  4709. ring_type: 8;
  4710. A_UINT32 ring_base_addr_lo;
  4711. A_UINT32 ring_base_addr_hi;
  4712. A_UINT32 ring_size: 16,
  4713. ring_entry_size: 8,
  4714. ring_misc_cfg_flag: 8;
  4715. A_UINT32 ring_head_offset32_remote_addr_lo;
  4716. A_UINT32 ring_head_offset32_remote_addr_hi;
  4717. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4718. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4719. A_UINT32 ring_msi_addr_lo;
  4720. A_UINT32 ring_msi_addr_hi;
  4721. A_UINT32 ring_msi_data;
  4722. A_UINT32 intr_batch_counter_th: 15,
  4723. sw_intr_mode: 1,
  4724. intr_timer_th: 16;
  4725. A_UINT32 intr_low_threshold: 16,
  4726. prefetch_timer_cfg: 3,
  4727. response_required: 1,
  4728. ipa_drop_flag: 1,
  4729. reserved1: 11;
  4730. A_UINT32 ipa_drop_low_threshold: 8,
  4731. ipa_drop_high_threshold: 8,
  4732. reserved: 16;
  4733. } POSTPACK;
  4734. enum htt_srng_ring_type {
  4735. HTT_HW_TO_SW_RING = 0,
  4736. HTT_SW_TO_HW_RING,
  4737. HTT_SW_TO_SW_RING,
  4738. /* Insert new ring types above this line */
  4739. };
  4740. enum htt_srng_ring_id {
  4741. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4742. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4743. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4744. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4745. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4746. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4747. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4748. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4749. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4750. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4751. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4752. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4753. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4754. HTT_LPASS_TO_FW_RXBUF_RING, /* new LPASS to FW refill ring to recycle rx buffers */
  4755. HTT_HOST3_TO_FW_RXBUF_RING, /* used by host for EasyMesh feature */
  4756. /* Add Other SRING which can't be directly configured by host software above this line */
  4757. };
  4758. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4759. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4760. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4761. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4762. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4763. HTT_SRING_SETUP_PDEV_ID_S)
  4764. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4765. do { \
  4766. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4767. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4768. } while (0)
  4769. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4770. #define HTT_SRING_SETUP_RING_ID_S 16
  4771. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4772. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4773. HTT_SRING_SETUP_RING_ID_S)
  4774. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4775. do { \
  4776. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4777. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4778. } while (0)
  4779. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4780. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4781. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4782. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4783. HTT_SRING_SETUP_RING_TYPE_S)
  4784. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4785. do { \
  4786. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4787. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4788. } while (0)
  4789. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4790. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4791. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4792. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4793. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4794. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4795. do { \
  4796. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4797. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4798. } while (0)
  4799. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4800. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4801. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4802. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4803. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4804. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4805. do { \
  4806. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4807. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4808. } while (0)
  4809. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4810. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4811. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4812. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4813. HTT_SRING_SETUP_RING_SIZE_S)
  4814. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4815. do { \
  4816. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4817. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4818. } while (0)
  4819. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4820. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4821. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4822. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4823. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4824. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4825. do { \
  4826. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4827. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4828. } while (0)
  4829. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4830. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4831. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4832. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4833. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4834. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4835. do { \
  4836. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4837. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4838. } while (0)
  4839. /* This control bit is applicable to only Producer, which updates Ring ID field
  4840. * of each descriptor before pushing into the ring.
  4841. * 0: updates ring_id(default)
  4842. * 1: ring_id updating disabled */
  4843. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4844. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4845. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4846. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4847. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4848. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4849. do { \
  4850. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4851. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4852. } while (0)
  4853. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4854. * of each descriptor before pushing into the ring.
  4855. * 0: updates Loopcnt(default)
  4856. * 1: Loopcnt updating disabled */
  4857. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4858. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4859. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4860. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4861. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4862. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4863. do { \
  4864. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4865. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4866. } while (0)
  4867. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4868. * into security_id port of GXI/AXI. */
  4869. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4870. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4871. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4872. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4873. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4874. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4875. do { \
  4876. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4877. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4878. } while (0)
  4879. /* During MSI write operation, SRNG drives value of this register bit into
  4880. * swap bit of GXI/AXI. */
  4881. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4882. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4883. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4884. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4885. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4886. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4887. do { \
  4888. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4889. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4890. } while (0)
  4891. /* During Pointer write operation, SRNG drives value of this register bit into
  4892. * swap bit of GXI/AXI. */
  4893. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4894. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4895. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4896. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4897. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4898. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4899. do { \
  4900. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4901. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4902. } while (0)
  4903. /* During any data or TLV write operation, SRNG drives value of this register
  4904. * bit into swap bit of GXI/AXI. */
  4905. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4906. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4907. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4908. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4909. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4910. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4911. do { \
  4912. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4913. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4914. } while (0)
  4915. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4916. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4917. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4918. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4919. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4920. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4921. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4922. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4923. do { \
  4924. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4925. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4926. } while (0)
  4927. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4928. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4929. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4930. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4931. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4932. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4933. do { \
  4934. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4935. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4936. } while (0)
  4937. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4938. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4939. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4940. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4941. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4942. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4943. do { \
  4944. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4945. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4946. } while (0)
  4947. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4948. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4949. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4950. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4951. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4952. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4953. do { \
  4954. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4955. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4956. } while (0)
  4957. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4958. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4959. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4960. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4961. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4962. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4963. do { \
  4964. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4965. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4966. } while (0)
  4967. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4968. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4969. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4970. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4971. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4972. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4973. do { \
  4974. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4975. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4976. } while (0)
  4977. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4978. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4979. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4980. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4981. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4982. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4983. do { \
  4984. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4985. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4986. } while (0)
  4987. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4988. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4989. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4990. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4991. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4992. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4993. do { \
  4994. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4995. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4996. } while (0)
  4997. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4998. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4999. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  5000. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  5001. HTT_SRING_SETUP_SW_INTR_MODE_S)
  5002. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  5003. do { \
  5004. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  5005. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  5006. } while (0)
  5007. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  5008. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  5009. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  5010. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  5011. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  5012. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  5013. do { \
  5014. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  5015. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  5016. } while (0)
  5017. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  5018. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  5019. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  5020. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  5021. HTT_SRING_SETUP_INTR_LOW_TH_S)
  5022. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  5023. do { \
  5024. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  5025. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  5026. } while (0)
  5027. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  5028. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  5029. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  5030. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  5031. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  5032. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  5033. do { \
  5034. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  5035. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  5036. } while (0)
  5037. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5038. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5039. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5040. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5041. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5042. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5043. do { \
  5044. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5045. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5046. } while (0)
  5047. /**
  5048. * @brief host -> target RX ring selection config message
  5049. *
  5050. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5051. *
  5052. * @details
  5053. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5054. * configure RXDMA rings.
  5055. * The configuration is per ring based and includes both packet subtypes
  5056. * and PPDU/MPDU TLVs.
  5057. *
  5058. * The message would appear as follows:
  5059. *
  5060. * |31 28|27|26|25|24|23|22|21 19|18 16|15 | 11| 10|9 8|7 0|
  5061. * |-----+--+--+--+--+-----------------+----+---+---+---+---------------|
  5062. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5063. * |-----------------------+-----+-----+--------------------------------|
  5064. * |rsvd2|RX|RXHDL| CLD | CLC | CLM | ring_buffer_size |
  5065. * |--------------------------------------------------------------------|
  5066. * | packet_type_enable_flags_0 |
  5067. * |--------------------------------------------------------------------|
  5068. * | packet_type_enable_flags_1 |
  5069. * |--------------------------------------------------------------------|
  5070. * | packet_type_enable_flags_2 |
  5071. * |--------------------------------------------------------------------|
  5072. * | packet_type_enable_flags_3 |
  5073. * |--------------------------------------------------------------------|
  5074. * | tlv_filter_in_flags |
  5075. * |-----------------------------------+--------------------------------|
  5076. * | rx_header_offset | rx_packet_offset |
  5077. * |-----------------------------------+--------------------------------|
  5078. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5079. * |-----------------------------------+--------------------------------|
  5080. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5081. * |-----------------------------------+--------------------------------|
  5082. * | rsvd3 | rx_attention_offset |
  5083. * |--------------------------------------------------------------------|
  5084. * | rsvd4 | mo| fp| rx_drop_threshold |
  5085. * | |ndp|ndp| |
  5086. * |--------------------------------------------------------------------|
  5087. * Where:
  5088. * PS = pkt_swap
  5089. * SS = status_swap
  5090. * OV = rx_offsets_valid
  5091. * DT = drop_thresh_valid
  5092. * CLM = config_length_mgmt
  5093. * CLC = config_length_ctrl
  5094. * CLD = config_length_data
  5095. * RXHDL = rx_hdr_len
  5096. * RX = rxpcu_filter_enable_flag
  5097. * The message is interpreted as follows:
  5098. * dword0 - b'0:7 - msg_type: This will be set to
  5099. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5100. * b'8:15 - pdev_id:
  5101. * 0 (for rings at SOC/UMAC level),
  5102. * 1/2/3 mac id (for rings at LMAC level)
  5103. * b'16:23 - ring_id : Identify the ring to configure.
  5104. * More details can be got from enum htt_srng_ring_id
  5105. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5106. * BUF_RING_CFG_0 defs within HW .h files,
  5107. * e.g. wmac_top_reg_seq_hwioreg.h
  5108. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5109. * BUF_RING_CFG_0 defs within HW .h files,
  5110. * e.g. wmac_top_reg_seq_hwioreg.h
  5111. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5112. * configuration fields are valid
  5113. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5114. * rx_drop_threshold field is valid
  5115. * b'28 - rx_mon_global_en: Enable/Disable global register
  5116. 8 configuration in Rx monitor module.
  5117. * b'29:31 - rsvd1: reserved for future use
  5118. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5119. * in byte units.
  5120. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5121. * b'16:18 - config_length_mgmt (MGMT):
  5122. * Represents the length of mpdu bytes for mgmt pkt.
  5123. * valid values:
  5124. * 001 - 64bytes
  5125. * 010 - 128bytes
  5126. * 100 - 256bytes
  5127. * 111 - Full mpdu bytes
  5128. * b'19:21 - config_length_ctrl (CTRL):
  5129. * Represents the length of mpdu bytes for ctrl pkt.
  5130. * valid values:
  5131. * 001 - 64bytes
  5132. * 010 - 128bytes
  5133. * 100 - 256bytes
  5134. * 111 - Full mpdu bytes
  5135. * b'22:24 - config_length_data (DATA):
  5136. * Represents the length of mpdu bytes for data pkt.
  5137. * valid values:
  5138. * 001 - 64bytes
  5139. * 010 - 128bytes
  5140. * 100 - 256bytes
  5141. * 111 - Full mpdu bytes
  5142. * b'25:26 - rx_hdr_len:
  5143. * Specifies the number of bytes of recvd packet to copy
  5144. * into the rx_hdr tlv.
  5145. * supported values for now by host:
  5146. * 01 - 64bytes
  5147. * 10 - 128bytes
  5148. * 11 - 256bytes
  5149. * default - 128 bytes
  5150. * b'27 - rxpcu_filter_enable_flag
  5151. * For Scan Radio Host CPU utilization is very high.
  5152. * In order to reduce CPU utilization we need to filter out
  5153. * certain configured MAC frames.
  5154. * To filter out configured MAC address frames, RxPCU should
  5155. * be zero which means allow all frames for MD at RxOLE
  5156. * host wil fiter out frames.
  5157. * RxPCU (Filter IN) -> RxOLE (Filter In/Filter Out)
  5158. * b'28:31 - rsvd2: Reserved for future use
  5159. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5160. * Enable MGMT packet from 0b0000 to 0b1001
  5161. * bits from low to high: FP, MD, MO - 3 bits
  5162. * FP: Filter_Pass
  5163. * MD: Monitor_Direct
  5164. * MO: Monitor_Other
  5165. * 10 mgmt subtypes * 3 bits -> 30 bits
  5166. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5167. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5168. * Enable MGMT packet from 0b1010 to 0b1111
  5169. * bits from low to high: FP, MD, MO - 3 bits
  5170. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5171. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5172. * Enable CTRL packet from 0b0000 to 0b1001
  5173. * bits from low to high: FP, MD, MO - 3 bits
  5174. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5175. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5176. * Enable CTRL packet from 0b1010 to 0b1111,
  5177. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5178. * bits from low to high: FP, MD, MO - 3 bits
  5179. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5180. * dword6 - b'0:31 - tlv_filter_in_flags:
  5181. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5182. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5183. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5184. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5185. * A value of 0 will be considered as ignore this config.
  5186. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5187. * e.g. wmac_top_reg_seq_hwioreg.h
  5188. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5189. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5190. * A value of 0 will be considered as ignore this config.
  5191. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5192. * e.g. wmac_top_reg_seq_hwioreg.h
  5193. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5194. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5195. * A value of 0 will be considered as ignore this config.
  5196. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5197. * e.g. wmac_top_reg_seq_hwioreg.h
  5198. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5199. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5200. * A value of 0 will be considered as ignore this config.
  5201. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5202. * e.g. wmac_top_reg_seq_hwioreg.h
  5203. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5204. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5205. * A value of 0 will be considered as ignore this config.
  5206. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5207. * e.g. wmac_top_reg_seq_hwioreg.h
  5208. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5209. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5210. * A value of 0 will be considered as ignore this config.
  5211. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5212. * e.g. wmac_top_reg_seq_hwioreg.h
  5213. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5214. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5215. * A value of 0 will be considered as ignore this config.
  5216. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5217. * e.g. wmac_top_reg_seq_hwioreg.h
  5218. * - b'16:31 - rsvd3 for future use
  5219. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5220. * to source rings. Consumer drops packets if the available
  5221. * words in the ring falls below the configured threshold
  5222. * value.
  5223. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5224. * by host. 1 -> subscribed
  5225. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5226. * by host. 1 -> subscribed
  5227. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5228. * subscribed by host. 1 -> subscribed
  5229. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5230. * selection for the FP PHY ERR status tlv.
  5231. * 0 - wbm2rxdma_buf_source_ring
  5232. * 1 - fw2rxdma_buf_source_ring
  5233. * 2 - sw2rxdma_buf_source_ring
  5234. * 3 - no_buffer_ring
  5235. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5236. * selection for the FP PHY ERR status tlv.
  5237. * 0 - rxdma_release_ring
  5238. * 1 - rxdma2fw_ring
  5239. * 2 - rxdma2sw_ring
  5240. * 3 - rxdma2reo_ring
  5241. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5242. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5243. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5244. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5245. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5246. * 0: MSDU level logging
  5247. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5248. * 0: MSDU level logging
  5249. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5250. * 0: MSDU level logging
  5251. * - b'23 - word_mask_compaction: enable/disable word mask for
  5252. * mpdu/msdu start/end tlvs
  5253. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5254. * manager override
  5255. * - b'25:28 - rbm_override_val: return buffer manager override value
  5256. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5257. * which have to be posted to host from phy.
  5258. * Corresponding to errors defined in
  5259. * phyrx_abort_request_reason enums 0 to 31.
  5260. * Refer to RXPCU register definition header files for the
  5261. * phyrx_abort_request_reason enum definition.
  5262. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5263. * errors which have to be posted to host from phy.
  5264. * Corresponding to errors defined in
  5265. * phyrx_abort_request_reason enums 32 to 63.
  5266. * Refer to RXPCU register definition header files for the
  5267. * phyrx_abort_request_reason enum definition.
  5268. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5269. * applicable if word mask enabled
  5270. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5271. * applicable if word mask enabled
  5272. * - b'19:31 - rsvd7
  5273. * dword15- b'0:16 - rx_msdu_end_word_mask
  5274. * - b'17:31 - rsvd5
  5275. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5276. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5277. * buffer
  5278. * 1: RX_PKT TLV logging at specified offset for the
  5279. * subsequent buffer
  5280. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5281. */
  5282. PREPACK struct htt_rx_ring_selection_cfg_t {
  5283. A_UINT32 msg_type: 8,
  5284. pdev_id: 8,
  5285. ring_id: 8,
  5286. status_swap: 1,
  5287. pkt_swap: 1,
  5288. rx_offsets_valid: 1,
  5289. drop_thresh_valid: 1,
  5290. rx_mon_global_en: 1,
  5291. rsvd1: 3;
  5292. A_UINT32 ring_buffer_size: 16,
  5293. config_length_mgmt:3,
  5294. config_length_ctrl:3,
  5295. config_length_data:3,
  5296. rx_hdr_len: 2,
  5297. rxpcu_filter_enable_flag:1,
  5298. rsvd2: 4;
  5299. A_UINT32 packet_type_enable_flags_0;
  5300. A_UINT32 packet_type_enable_flags_1;
  5301. A_UINT32 packet_type_enable_flags_2;
  5302. A_UINT32 packet_type_enable_flags_3;
  5303. A_UINT32 tlv_filter_in_flags;
  5304. A_UINT32 rx_packet_offset: 16,
  5305. rx_header_offset: 16;
  5306. A_UINT32 rx_mpdu_end_offset: 16,
  5307. rx_mpdu_start_offset: 16;
  5308. A_UINT32 rx_msdu_end_offset: 16,
  5309. rx_msdu_start_offset: 16;
  5310. A_UINT32 rx_attn_offset: 16,
  5311. rsvd3: 16;
  5312. A_UINT32 rx_drop_threshold: 10,
  5313. fp_ndp: 1,
  5314. mo_ndp: 1,
  5315. fp_phy_err: 1,
  5316. fp_phy_err_buf_src: 2,
  5317. fp_phy_err_buf_dest: 2,
  5318. pkt_type_enable_msdu_or_mpdu_logging:3,
  5319. dma_mpdu_mgmt: 1,
  5320. dma_mpdu_ctrl: 1,
  5321. dma_mpdu_data: 1,
  5322. word_mask_compaction_enable:1,
  5323. rbm_override_enable: 1,
  5324. rbm_override_val: 4,
  5325. rsvd4: 3;
  5326. A_UINT32 phy_err_mask;
  5327. A_UINT32 phy_err_mask_cont;
  5328. A_UINT32 rx_mpdu_start_word_mask:16,
  5329. rx_mpdu_end_word_mask: 3,
  5330. rsvd7: 13;
  5331. A_UINT32 rx_msdu_end_word_mask: 17,
  5332. rsvd5: 15;
  5333. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5334. rx_pkt_tlv_offset: 15,
  5335. rsvd6: 16;
  5336. A_UINT32 rx_mpdu_start_word_mask_v2: 20,
  5337. rx_mpdu_end_word_mask_v2: 8,
  5338. rsvd8: 4;
  5339. A_UINT32 rx_msdu_end_word_mask_v2: 20,
  5340. rsvd9: 12;
  5341. A_UINT32 rx_ppdu_end_usr_stats_word_mask_v2: 20,
  5342. rsvd10: 12;
  5343. A_UINT32 packet_type_enable_fpmo_flags0;
  5344. A_UINT32 packet_type_enable_fpmo_flags1;
  5345. } POSTPACK;
  5346. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5347. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5348. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5349. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5350. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5351. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5352. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5353. do { \
  5354. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5355. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5356. } while (0)
  5357. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5358. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5359. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5360. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5361. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5362. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5363. do { \
  5364. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5365. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5366. } while (0)
  5367. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5368. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5369. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5370. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5371. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5372. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5373. do { \
  5374. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5375. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5376. } while (0)
  5377. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5378. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5379. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5380. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5381. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5382. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5383. do { \
  5384. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5385. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5386. } while (0)
  5387. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5388. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5389. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5390. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5391. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5392. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5393. do { \
  5394. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5395. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5396. } while (0)
  5397. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5398. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5399. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5400. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5401. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5402. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5403. do { \
  5404. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5405. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5406. } while (0)
  5407. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5408. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5409. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5410. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5411. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5412. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5413. do { \
  5414. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5415. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5416. } while (0)
  5417. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5418. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5419. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5420. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5421. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5422. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5423. do { \
  5424. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5425. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5426. } while (0)
  5427. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5428. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5429. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5430. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5431. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5432. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5433. do { \
  5434. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5435. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5436. } while (0)
  5437. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5438. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5439. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5440. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5441. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5442. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5443. do { \
  5444. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5445. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5446. } while (0)
  5447. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5448. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5449. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5450. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5451. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5452. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5453. do { \
  5454. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5455. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5456. } while (0)
  5457. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5458. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5459. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5460. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5461. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5462. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5463. do { \
  5464. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5465. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5466. } while(0)
  5467. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M 0x08000000
  5468. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S 27
  5469. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_GET(_var) \
  5470. (((_var) & HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M) >> \
  5471. HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S)
  5472. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_SET(_var, _val) \
  5473. do { \
  5474. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER, _val); \
  5475. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S));\
  5476. } while(0)
  5477. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5479. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5480. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5481. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5482. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5483. do { \
  5484. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5485. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5486. } while (0)
  5487. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5488. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5489. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5490. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5491. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5492. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5493. do { \
  5494. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5495. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5496. } while (0)
  5497. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5498. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5499. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5500. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5501. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5502. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5503. do { \
  5504. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5505. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5506. } while (0)
  5507. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5509. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5510. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5511. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5512. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5513. do { \
  5514. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5515. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5516. } while (0)
  5517. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5518. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5519. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5520. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5521. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5522. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5523. do { \
  5524. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5525. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5526. } while (0)
  5527. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5528. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5529. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5530. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5531. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5532. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5533. do { \
  5534. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5535. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5536. } while (0)
  5537. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5538. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5539. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5540. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5541. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5542. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5543. do { \
  5544. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5545. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5546. } while (0)
  5547. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5548. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5549. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5550. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5551. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5552. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5553. do { \
  5554. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5555. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5556. } while (0)
  5557. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5558. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5559. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5560. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5561. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5562. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5563. do { \
  5564. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5565. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5566. } while (0)
  5567. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5568. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5569. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5570. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5571. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5572. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5573. do { \
  5574. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5575. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5576. } while (0)
  5577. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5578. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5579. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5580. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5581. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5582. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5583. do { \
  5584. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5585. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5586. } while (0)
  5587. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5588. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5589. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5590. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5591. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5592. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5593. do { \
  5594. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5595. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5596. } while (0)
  5597. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5598. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5599. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5600. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5601. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5602. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5603. do { \
  5604. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5605. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5606. } while (0)
  5607. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5608. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5609. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5610. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5611. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5612. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5613. do { \
  5614. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5615. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5616. } while (0)
  5617. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5618. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5619. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5620. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5621. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5622. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5623. do { \
  5624. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5625. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5626. } while (0)
  5627. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5628. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5629. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5630. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5631. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5632. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5633. do { \
  5634. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5635. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5636. } while (0)
  5637. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5638. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5639. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5640. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5641. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5642. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5643. do { \
  5644. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5645. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5646. } while (0)
  5647. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5648. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5649. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5650. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5651. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5652. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5653. do { \
  5654. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5655. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5656. } while (0)
  5657. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5658. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5659. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5660. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5661. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5662. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5663. do { \
  5664. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5665. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5666. } while (0)
  5667. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5668. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5669. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5670. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5671. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5672. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5673. do { \
  5674. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5675. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5676. } while (0)
  5677. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5678. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5679. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5680. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5681. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5682. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5683. do { \
  5684. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5685. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5686. } while (0)
  5687. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5688. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5689. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5690. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5691. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5692. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5693. do { \
  5694. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5695. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5696. } while (0)
  5697. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5698. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5699. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5700. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5701. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5702. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5703. do { \
  5704. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5705. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5706. } while (0)
  5707. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5708. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5709. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5710. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5711. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5712. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5713. do { \
  5714. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5715. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5716. } while (0)
  5717. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5718. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5719. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5720. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5721. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5722. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5723. do { \
  5724. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5725. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5726. } while (0)
  5727. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5728. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5729. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5730. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5731. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5732. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5733. do { \
  5734. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5735. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5736. } while (0)
  5737. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5738. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5739. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5740. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5741. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5742. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5743. do { \
  5744. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5745. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5746. } while (0)
  5747. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5748. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5749. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5750. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5751. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5752. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5753. do { \
  5754. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5755. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5756. } while (0)
  5757. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5758. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5759. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5760. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5761. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5762. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5763. do { \
  5764. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5765. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5766. } while (0)
  5767. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5768. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5769. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5770. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5771. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5772. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5773. do { \
  5774. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5775. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5776. } while (0)
  5777. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5778. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5779. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5780. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5781. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5782. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5783. do { \
  5784. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5785. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5786. } while (0)
  5787. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5788. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5789. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5790. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5791. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5792. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5793. do { \
  5794. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5795. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5796. } while (0)
  5797. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M 0x000FFFFF
  5798. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S 0
  5799. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_GET(_var) \
  5800. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M)>> \
  5801. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)
  5802. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_SET(_var, _val) \
  5803. do { \
  5804. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2, _val);\
  5805. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)); \
  5806. } while (0)
  5807. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M 0x0FF00000
  5808. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S 20
  5809. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_GET(_var) \
  5810. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M)>> \
  5811. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)
  5812. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_SET(_var, _val) \
  5813. do { \
  5814. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2, _val);\
  5815. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)); \
  5816. } while (0)
  5817. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M 0x000FFFFF
  5818. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S 0
  5819. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_GET(_var) \
  5820. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M)>> \
  5821. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)
  5822. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_SET(_var, _val) \
  5823. do { \
  5824. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2, _val);\
  5825. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)); \
  5826. } while (0)
  5827. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M 0x000FFFFF
  5828. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S 0
  5829. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_GET(_var) \
  5830. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M)>> \
  5831. HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)
  5832. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_SET(_var, _val) \
  5833. do { \
  5834. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2, _val);\
  5835. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)); \
  5836. } while (0)
  5837. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M 0xFFFFFFFF
  5838. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S 0
  5839. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_GET(_var) \
  5840. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M)>> \
  5841. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)
  5842. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_SET(_var, _val) \
  5843. do { \
  5844. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0, _val); \
  5845. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)); \
  5846. } while (0)
  5847. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M 0xFFFFFFFF
  5848. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S 0
  5849. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_GET(_var) \
  5850. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M)>> \
  5851. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)
  5852. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_SET(_var, _val) \
  5853. do { \
  5854. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1, _val); \
  5855. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)); \
  5856. } while (0)
  5857. /*
  5858. * Subtype based MGMT frames enable bits.
  5859. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5860. */
  5861. /* association request */
  5862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5868. /* association response */
  5869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5875. /* Reassociation request */
  5876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5882. /* Reassociation response */
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5889. /* Probe request */
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5896. /* Probe response */
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5903. /* Timing Advertisement */
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5910. /* Reserved */
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5917. /* Beacon */
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5924. /* ATIM */
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5931. /* Disassociation */
  5932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5938. /* Authentication */
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5945. /* Deauthentication */
  5946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5952. /* Action */
  5953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5959. /* Action No Ack */
  5960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5966. /* Reserved */
  5967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5973. /*
  5974. * Subtype based CTRL frames enable bits.
  5975. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5976. */
  5977. /* Reserved */
  5978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5984. /* Reserved */
  5985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5991. /* Reserved */
  5992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5998. /* Reserved */
  5999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  6000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  6001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  6002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  6003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  6004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  6005. /* Reserved */
  6006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  6007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  6008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  6009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  6010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  6011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  6012. /* Reserved */
  6013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  6014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  6015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  6016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  6017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  6018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  6019. /* Reserved */
  6020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  6021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  6022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  6023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  6024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  6025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  6026. /* Control Wrapper */
  6027. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  6028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  6029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  6030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  6031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  6032. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  6033. /* Block Ack Request */
  6034. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  6035. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  6036. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  6037. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  6038. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  6039. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  6040. /* Block Ack*/
  6041. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  6042. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  6043. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  6044. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  6045. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  6046. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  6047. /* PS-POLL */
  6048. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  6049. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  6050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  6051. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  6052. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  6053. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  6054. /* RTS */
  6055. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  6056. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  6057. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  6058. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  6059. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  6060. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  6061. /* CTS */
  6062. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  6063. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  6064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  6065. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  6066. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  6067. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  6068. /* ACK */
  6069. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  6070. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  6071. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  6072. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  6073. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  6074. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  6075. /* CF-END */
  6076. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  6077. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  6078. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  6079. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  6080. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  6081. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  6082. /* CF-END + CF-ACK */
  6083. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  6084. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  6085. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  6086. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  6087. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  6088. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  6089. /* Multicast data */
  6090. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  6091. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  6092. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  6093. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  6094. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  6095. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  6096. /* Unicast data */
  6097. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  6098. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  6099. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  6100. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  6101. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  6102. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  6103. /* NULL data */
  6104. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  6105. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  6106. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  6107. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  6108. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  6109. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  6110. /* FPMO mode flags */
  6111. /* MGMT */
  6112. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_M 0x00000001
  6113. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_S 0
  6114. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_M 0x00000002
  6115. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_S 1
  6116. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_M 0x00000004
  6117. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_S 2
  6118. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_M 0x00000008
  6119. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_S 3
  6120. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_M 0x00000010
  6121. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_S 4
  6122. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_M 0x00000020
  6123. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_S 5
  6124. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_M 0x00000040
  6125. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_S 6
  6126. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_M 0x00000080
  6127. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_S 7
  6128. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_M 0x00000100
  6129. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_S 8
  6130. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_M 0x00000200
  6131. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_S 9
  6132. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_M 0x00000400
  6133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_S 10
  6134. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_M 0x00000800
  6135. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_S 11
  6136. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_M 0x00001000
  6137. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_S 12
  6138. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_M 0x00002000
  6139. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_S 13
  6140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_M 0x00004000
  6141. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_S 14
  6142. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_M 0x00008000
  6143. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_S 15
  6144. /* CTRL */
  6145. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_M 0x00010000
  6146. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_S 16
  6147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_M 0x00020000
  6148. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_S 17
  6149. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_M 0x00040000
  6150. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_S 18
  6151. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_M 0x00080000
  6152. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_S 19
  6153. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_M 0x00100000
  6154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_S 20
  6155. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_M 0x00200000
  6156. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_S 21
  6157. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_M 0x00400000
  6158. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_S 22
  6159. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_M 0x00800000
  6160. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_S 23
  6161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_M 0x01000000
  6162. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_S 24
  6163. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_M 0x02000000
  6164. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_S 25
  6165. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_M 0x04000000
  6166. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_S 26
  6167. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_M 0x08000000
  6168. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_S 27
  6169. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_M 0x10000000
  6170. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_S 28
  6171. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_M 0x20000000
  6172. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_S 29
  6173. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_M 0x40000000
  6174. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_S 30
  6175. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_M 0x80000000
  6176. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_S 31
  6177. /* DATA */
  6178. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_M 0x00000001
  6179. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_S 0
  6180. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_M 0x00000002
  6181. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_S 1
  6182. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_M 0x00000004
  6183. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_S 2
  6184. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_M 0x00000008
  6185. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_S 3
  6186. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_M 0x00000010
  6187. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_S 4
  6188. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  6189. do { \
  6190. HTT_CHECK_SET_VAL(httsym, value); \
  6191. (word) |= (value) << httsym##_S; \
  6192. } while (0)
  6193. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  6194. (((word) & httsym##_M) >> httsym##_S)
  6195. #define htt_rx_ring_pkt_enable_subtype_set( \
  6196. word, flag, mode, type, subtype, val) \
  6197. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  6198. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  6199. #define htt_rx_ring_pkt_enable_subtype_get( \
  6200. word, flag, mode, type, subtype) \
  6201. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  6202. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  6203. /* Definition to filter in TLVs */
  6204. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  6205. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  6206. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  6207. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  6208. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6209. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6210. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6211. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6212. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6213. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6214. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6215. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6216. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6217. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6218. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6219. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6220. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6221. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6222. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6223. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6224. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6225. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6226. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6227. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6228. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6229. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6230. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6231. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6232. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6233. do { \
  6234. HTT_CHECK_SET_VAL(httsym, enable); \
  6235. (word) |= (enable) << httsym##_S; \
  6236. } while (0)
  6237. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6238. (((word) & httsym##_M) >> httsym##_S)
  6239. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6240. HTT_RX_RING_TLV_ENABLE_SET( \
  6241. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6242. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6243. HTT_RX_RING_TLV_ENABLE_GET( \
  6244. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6245. /**
  6246. * @brief host -> target TX monitor config message
  6247. *
  6248. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6249. *
  6250. * @details
  6251. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6252. * configure RXDMA rings.
  6253. * The configuration is per ring based and includes both packet types
  6254. * and PPDU/MPDU TLVs.
  6255. *
  6256. * The message would appear as follows:
  6257. *
  6258. * |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|
  6259. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6260. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6261. * |-----------+--------+--------+-----+------------------------------------|
  6262. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6263. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6264. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6265. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6266. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6267. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6268. * |------------------------------------------------------------------------|
  6269. * | tlv_filter_mask_in0 |
  6270. * |------------------------------------------------------------------------|
  6271. * | tlv_filter_mask_in1 |
  6272. * |------------------------------------------------------------------------|
  6273. * | tlv_filter_mask_in2 |
  6274. * |------------------------------------------------------------------------|
  6275. * | tlv_filter_mask_in3 |
  6276. * |-----------------+-----------------+---------------------+--------------|
  6277. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6278. * |------------------------------------------------------------------------|
  6279. * | pcu_ppdu_setup_word_mask |
  6280. * |--------------------+--+--+--+-----+---------------------+--------------|
  6281. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6282. * |------------------------------------------------------------------------|
  6283. *
  6284. * Where:
  6285. * PS = pkt_swap
  6286. * SS = status_swap
  6287. * The message is interpreted as follows:
  6288. * dword0 - b'0:7 - msg_type: This will be set to
  6289. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6290. * b'8:15 - pdev_id:
  6291. * 0 (for rings at SOC level),
  6292. * 1/2/3 mac id (for rings at LMAC level)
  6293. * b'16:23 - ring_id : Identify the ring to configure.
  6294. * More details can be got from enum htt_srng_ring_id
  6295. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6296. * BUF_RING_CFG_0 defs within HW .h files,
  6297. * e.g. wmac_top_reg_seq_hwioreg.h
  6298. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6299. * BUF_RING_CFG_0 defs within HW .h files,
  6300. * e.g. wmac_top_reg_seq_hwioreg.h
  6301. * b'26 - tx_mon_global_en: Enable/Disable global register
  6302. * configuration in Tx monitor module.
  6303. * b'27:31 - rsvd1: reserved for future use
  6304. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6305. * in byte units.
  6306. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6307. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6308. * 64, 128, 256.
  6309. * If all 3 bits are set config length is > 256.
  6310. * if val is '0', then ignore this field.
  6311. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6312. * 64, 128, 256.
  6313. * If all 3 bits are set config length is > 256.
  6314. * if val is '0', then ignore this field.
  6315. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6316. * 64, 128, 256.
  6317. * If all 3 bits are set config length is > 256.
  6318. * If val is '0', then ignore this field.
  6319. * - b'25:31 - rsvd2: Reserved for future use
  6320. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6321. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6322. * If packet_type_enable_flags is '1' for MGMT type,
  6323. * monitor will ignore this bit and allow this TLV.
  6324. * If packet_type_enable_flags is '0' for MGMT type,
  6325. * monitor will use this bit to enable/disable logging
  6326. * of this TLV.
  6327. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6328. * If packet_type_enable_flags is '1' for CTRL type,
  6329. * monitor will ignore this bit and allow this TLV.
  6330. * If packet_type_enable_flags is '0' for CTRL type,
  6331. * monitor will use this bit to enable/disable logging
  6332. * of this TLV.
  6333. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6334. * If packet_type_enable_flags is '1' for DATA type,
  6335. * monitor will ignore this bit and allow this TLV.
  6336. * If packet_type_enable_flags is '0' for DATA type,
  6337. * monitor will use this bit to enable/disable logging
  6338. * of this TLV.
  6339. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6340. * If packet_type_enable_flags is '1' for MGMT type,
  6341. * monitor will ignore this bit and allow this TLV.
  6342. * If packet_type_enable_flags is '0' for MGMT type,
  6343. * monitor will use this bit to enable/disable logging
  6344. * of this TLV.
  6345. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6346. * If packet_type_enable_flags is '1' for CTRL type,
  6347. * monitor will ignore this bit and allow this TLV.
  6348. * If packet_type_enable_flags is '0' for CTRL type,
  6349. * monitor will use this bit to enable/disable logging
  6350. * of this TLV.
  6351. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6352. * If packet_type_enable_flags is '1' for DATA type,
  6353. * monitor will ignore this bit and allow this TLV.
  6354. * If packet_type_enable_flags is '0' for DATA type,
  6355. * monitor will use this bit to enable/disable logging
  6356. * of this TLV.
  6357. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6358. * If packet_type_enable_flags is '1' for MGMT type,
  6359. * monitor will ignore this bit and allow this TLV.
  6360. * If packet_type_enable_flags is '0' for MGMT type,
  6361. * monitor will use this bit to enable/disable logging
  6362. * of this TLV.
  6363. * If filter_in_TX_MPDU_START = 1 it is recommended
  6364. * to set this bit.
  6365. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6366. * If packet_type_enable_flags is '1' for CTRL type,
  6367. * monitor will ignore this bit and allow this TLV.
  6368. * If packet_type_enable_flags is '0' for CTRL type,
  6369. * monitor will use this bit to enable/disable logging
  6370. * of this TLV.
  6371. * If filter_in_TX_MPDU_START = 1 it is recommended
  6372. * to set this bit.
  6373. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6374. * If packet_type_enable_flags is '1' for DATA type,
  6375. * monitor will ignore this bit and allow this TLV.
  6376. * If packet_type_enable_flags is '0' for DATA type,
  6377. * monitor will use this bit to enable/disable logging
  6378. * of this TLV.
  6379. * If filter_in_TX_MPDU_START = 1 it is recommended
  6380. * to set this bit.
  6381. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6382. * If packet_type_enable_flags is '1' for MGMT type,
  6383. * monitor will ignore this bit and allow this TLV.
  6384. * If packet_type_enable_flags is '0' for MGMT type,
  6385. * monitor will use this bit to enable/disable logging
  6386. * of this TLV.
  6387. * If filter_in_TX_MSDU_START = 1 it is recommended
  6388. * to set this bit.
  6389. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6390. * If packet_type_enable_flags is '1' for CTRL type,
  6391. * monitor will ignore this bit and allow this TLV.
  6392. * If packet_type_enable_flags is '0' for CTRL type,
  6393. * monitor will use this bit to enable/disable logging
  6394. * of this TLV.
  6395. * If filter_in_TX_MSDU_START = 1 it is recommended
  6396. * to set this bit.
  6397. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6398. * If packet_type_enable_flags is '1' for DATA type,
  6399. * monitor will ignore this bit and allow this TLV.
  6400. * If packet_type_enable_flags is '0' for DATA type,
  6401. * monitor will use this bit to enable/disable logging
  6402. * of this TLV.
  6403. * If filter_in_TX_MSDU_START = 1 it is recommended
  6404. * to set this bit.
  6405. * b'15:31 - rsvd3: Reserved for future use
  6406. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6407. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6408. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6409. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6410. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6411. * - b'8:15 - tx_peer_entry_word_mask:
  6412. * - b'16:23 - tx_queue_ext_word_mask:
  6413. * - b'24:31 - tx_msdu_start_word_mask:
  6414. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6415. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6416. * - b'8:15 - rxpcu_user_setup_word_mask:
  6417. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6418. * MGMT, CTRL, DATA
  6419. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6420. * 0 -> MSDU level logging is enabled
  6421. * (valid only if bit is set in
  6422. * pkt_type_enable_msdu_or_mpdu_logging)
  6423. * 1 -> MPDU level logging is enabled
  6424. * (valid only if bit is set in
  6425. * pkt_type_enable_msdu_or_mpdu_logging)
  6426. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6427. * 0 -> MSDU level logging is enabled
  6428. * (valid only if bit is set in
  6429. * pkt_type_enable_msdu_or_mpdu_logging)
  6430. * 1 -> MPDU level logging is enabled
  6431. * (valid only if bit is set in
  6432. * pkt_type_enable_msdu_or_mpdu_logging)
  6433. * - b'21 - dma_mpdu_data(D) : For DATA
  6434. * 0 -> MSDU level logging is enabled
  6435. * (valid only if bit is set in
  6436. * pkt_type_enable_msdu_or_mpdu_logging)
  6437. * 1 -> MPDU level logging is enabled
  6438. * (valid only if bit is set in
  6439. * pkt_type_enable_msdu_or_mpdu_logging)
  6440. * - b'22:31 - rsvd4 for future use
  6441. */
  6442. PREPACK struct htt_tx_monitor_cfg_t {
  6443. A_UINT32 msg_type: 8,
  6444. pdev_id: 8,
  6445. ring_id: 8,
  6446. status_swap: 1,
  6447. pkt_swap: 1,
  6448. tx_mon_global_en: 1,
  6449. rsvd1: 5;
  6450. A_UINT32 ring_buffer_size: 16,
  6451. config_length_mgmt: 3,
  6452. config_length_ctrl: 3,
  6453. config_length_data: 3,
  6454. rsvd2: 7;
  6455. A_UINT32 pkt_type_enable_flags: 3,
  6456. filter_in_tx_mpdu_start_mgmt: 1,
  6457. filter_in_tx_mpdu_start_ctrl: 1,
  6458. filter_in_tx_mpdu_start_data: 1,
  6459. filter_in_tx_msdu_start_mgmt: 1,
  6460. filter_in_tx_msdu_start_ctrl: 1,
  6461. filter_in_tx_msdu_start_data: 1,
  6462. filter_in_tx_mpdu_end_mgmt: 1,
  6463. filter_in_tx_mpdu_end_ctrl: 1,
  6464. filter_in_tx_mpdu_end_data: 1,
  6465. filter_in_tx_msdu_end_mgmt: 1,
  6466. filter_in_tx_msdu_end_ctrl: 1,
  6467. filter_in_tx_msdu_end_data: 1,
  6468. word_mask_compaction_enable: 1,
  6469. rsvd3: 16;
  6470. A_UINT32 tlv_filter_mask_in0;
  6471. A_UINT32 tlv_filter_mask_in1;
  6472. A_UINT32 tlv_filter_mask_in2;
  6473. A_UINT32 tlv_filter_mask_in3;
  6474. A_UINT32 tx_fes_setup_word_mask: 8,
  6475. tx_peer_entry_word_mask: 8,
  6476. tx_queue_ext_word_mask: 8,
  6477. tx_msdu_start_word_mask: 8;
  6478. A_UINT32 pcu_ppdu_setup_word_mask;
  6479. A_UINT32 tx_mpdu_start_word_mask: 8,
  6480. rxpcu_user_setup_word_mask: 8,
  6481. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6482. dma_mpdu_mgmt: 1,
  6483. dma_mpdu_ctrl: 1,
  6484. dma_mpdu_data: 1,
  6485. rsvd4: 10;
  6486. A_UINT32 tx_queue_ext_v2_word_mask: 12,
  6487. tx_peer_entry_v2_word_mask: 12,
  6488. rsvd5: 10;
  6489. A_UINT32 fes_status_end_word_mask: 16,
  6490. response_end_status_word_mask: 16;
  6491. A_UINT32 fes_status_prot_word_mask: 11,
  6492. rsvd6: 21;
  6493. } POSTPACK;
  6494. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6495. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6496. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6497. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6498. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6499. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6500. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6501. do { \
  6502. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6503. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6504. } while (0)
  6505. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6506. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6507. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6508. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6509. HTT_TX_MONITOR_CFG_RING_ID_S)
  6510. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6511. do { \
  6512. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6513. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6514. } while (0)
  6515. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6516. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6517. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6518. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6519. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6520. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6521. do { \
  6522. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6523. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6524. } while (0)
  6525. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6526. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6527. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6528. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6529. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6530. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6531. do { \
  6532. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6533. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6534. } while (0)
  6535. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6536. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6537. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6538. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6539. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6540. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6541. do { \
  6542. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6543. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6544. } while (0)
  6545. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6546. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6547. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6548. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6549. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6550. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6551. do { \
  6552. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6553. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6554. } while (0)
  6555. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6556. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6557. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6558. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6559. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6560. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6561. do { \
  6562. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6563. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6564. } while (0)
  6565. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6566. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6567. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6568. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6569. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6570. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6571. do { \
  6572. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6573. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6574. } while (0)
  6575. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6576. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6577. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6578. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6579. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6580. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6581. do { \
  6582. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6583. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6584. } while (0)
  6585. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6586. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6587. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6588. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6589. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6590. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6591. do { \
  6592. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6593. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6594. } while (0)
  6595. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6596. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6597. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6598. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6599. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6600. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6601. do { \
  6602. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6603. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6604. } while (0)
  6605. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6606. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6607. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6608. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6609. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6610. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6611. do { \
  6612. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6613. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6614. } while (0)
  6615. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6616. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6617. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6618. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6619. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6620. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6621. do { \
  6622. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6623. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6624. } while (0)
  6625. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6626. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6627. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6628. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6629. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6630. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6631. do { \
  6632. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6633. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6634. } while (0)
  6635. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6636. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6637. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6638. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6639. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6640. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6641. do { \
  6642. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6643. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6644. } while (0)
  6645. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6646. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6647. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6648. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6649. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6650. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6651. do { \
  6652. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6653. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6654. } while (0)
  6655. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6656. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6657. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6658. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6659. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6660. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6661. do { \
  6662. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6663. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6664. } while (0)
  6665. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6666. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6667. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6668. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6669. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6670. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6671. do { \
  6672. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6673. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6674. } while (0)
  6675. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6676. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6677. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6678. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6679. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6680. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6681. do { \
  6682. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6683. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6684. } while (0)
  6685. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6686. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6687. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6688. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6689. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6690. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6691. do { \
  6692. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6693. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6694. } while (0)
  6695. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6696. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6697. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6698. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6699. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6700. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6701. do { \
  6702. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6703. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6704. } while (0)
  6705. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6706. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6707. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6708. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6709. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6710. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6711. do { \
  6712. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6713. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6714. } while (0)
  6715. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00008000
  6716. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S 15
  6717. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  6718. (((_var) & HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  6719. HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  6720. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  6721. do { \
  6722. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  6723. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  6724. } while (0)
  6725. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6726. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6727. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6728. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6729. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6730. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6731. do { \
  6732. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6733. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6734. } while (0)
  6735. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6736. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6737. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6738. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6739. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6740. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6741. do { \
  6742. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6743. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6744. } while (0)
  6745. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6746. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6747. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6748. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6749. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6750. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6751. do { \
  6752. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6753. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6754. } while (0)
  6755. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6756. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6757. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6758. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6759. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6760. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6761. do { \
  6762. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6763. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6764. } while (0)
  6765. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6766. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6767. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6768. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6769. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6770. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6771. do { \
  6772. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6773. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6774. } while (0)
  6775. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6776. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6777. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6778. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6779. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6780. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6781. do { \
  6782. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6783. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6784. } while (0)
  6785. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6786. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6787. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6788. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6789. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6790. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6791. do { \
  6792. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6793. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6794. } while (0)
  6795. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6796. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6797. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6798. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6799. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6800. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6801. do { \
  6802. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6803. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6804. } while (0)
  6805. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6806. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6807. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6808. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6809. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6810. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6811. do { \
  6812. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6813. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6814. } while (0)
  6815. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6816. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6817. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6818. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6819. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6820. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6821. do { \
  6822. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6823. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6824. } while (0)
  6825. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6826. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6827. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6828. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6829. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6830. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6831. do { \
  6832. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6833. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6834. } while (0)
  6835. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6836. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6837. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6838. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6839. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6840. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6841. do { \
  6842. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6843. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6844. } while (0)
  6845. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M 0x00000fff
  6846. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S 0
  6847. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_GET(_var) \
  6848. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M) >> \
  6849. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)
  6850. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_SET(_var, _val) \
  6851. do { \
  6852. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK, _val); \
  6853. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)); \
  6854. } while (0)
  6855. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M 0x00fff000
  6856. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S 12
  6857. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_GET(_var) \
  6858. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M) >> \
  6859. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)
  6860. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_SET(_var, _val) \
  6861. do { \
  6862. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK, _val); \
  6863. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)); \
  6864. } while (0)
  6865. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M 0x0000ffff
  6866. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S 0
  6867. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_GET(_var) \
  6868. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M) >> \
  6869. HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)
  6870. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_SET(_var, _val) \
  6871. do { \
  6872. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK, _val); \
  6873. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)); \
  6874. } while (0)
  6875. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M 0xffff0000
  6876. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S 16
  6877. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_GET(_var) \
  6878. (((_var) & HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M) >> \
  6879. HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)
  6880. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_SET(_var, _val) \
  6881. do { \
  6882. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK, _val); \
  6883. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)); \
  6884. } while (0)
  6885. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M 0x000007ff
  6886. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S 0
  6887. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_GET(_var) \
  6888. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M) >> \
  6889. HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)
  6890. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_SET(_var, _val) \
  6891. do { \
  6892. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK, _val); \
  6893. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)); \
  6894. } while (0)
  6895. /*
  6896. * pkt_type_enable_flags
  6897. */
  6898. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6899. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6900. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6901. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6902. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6903. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6904. /*
  6905. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6906. */
  6907. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6908. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6909. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6910. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6911. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6912. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6913. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6914. do { \
  6915. HTT_CHECK_SET_VAL(httsym, value); \
  6916. (word) |= (value) << httsym##_S; \
  6917. } while (0)
  6918. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6919. (((word) & httsym##_M) >> httsym##_S)
  6920. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6921. * type -> MGMT, CTRL, DATA*/
  6922. #define htt_tx_ring_pkt_type_set( \
  6923. word, mode, type, val) \
  6924. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6925. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6926. #define htt_tx_ring_pkt_type_get( \
  6927. word, mode, type) \
  6928. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6929. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6930. /* Definition to filter in TLVs */
  6931. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6932. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6933. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6934. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6935. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6936. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6937. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6938. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6939. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6940. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6941. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6942. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6943. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6944. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6945. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6946. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6947. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6948. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6949. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6950. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6951. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6952. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6953. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6954. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6955. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6956. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6957. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6958. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6959. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6960. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6961. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6962. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6963. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6964. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6965. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6966. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6967. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6968. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6969. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6970. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6971. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6972. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6973. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6974. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6975. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6976. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6977. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6978. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6979. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6980. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6981. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6982. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6983. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6984. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6985. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6986. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6987. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6988. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6989. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6990. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6991. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6992. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6993. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6994. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6995. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6996. do { \
  6997. HTT_CHECK_SET_VAL(httsym, enable); \
  6998. (word) |= (enable) << httsym##_S; \
  6999. } while (0)
  7000. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  7001. (((word) & httsym##_M) >> httsym##_S)
  7002. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  7003. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  7004. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  7005. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  7006. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  7007. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  7008. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  7009. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  7010. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  7011. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  7012. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  7013. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  7014. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  7015. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  7016. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  7017. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  7018. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  7019. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  7020. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  7021. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  7022. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  7023. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  7024. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  7025. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  7026. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  7027. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  7028. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  7029. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  7030. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  7031. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  7032. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  7033. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  7034. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  7035. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  7036. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  7037. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  7038. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  7039. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  7040. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  7041. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  7042. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  7043. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  7044. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  7045. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  7046. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  7047. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  7048. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  7049. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  7050. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  7051. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  7052. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  7053. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  7054. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  7055. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  7056. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  7057. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  7058. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  7059. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  7060. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  7061. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  7062. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  7063. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  7064. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  7065. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  7066. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  7067. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  7068. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  7069. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  7070. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  7071. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  7072. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  7073. do { \
  7074. HTT_CHECK_SET_VAL(httsym, enable); \
  7075. (word) |= (enable) << httsym##_S; \
  7076. } while (0)
  7077. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  7078. (((word) & httsym##_M) >> httsym##_S)
  7079. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  7080. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  7081. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  7082. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  7083. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  7084. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  7085. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  7086. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  7087. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  7088. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  7089. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  7090. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  7091. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  7092. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  7093. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  7094. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  7095. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  7096. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  7097. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  7098. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  7099. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  7100. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  7101. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  7102. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  7103. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  7104. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  7105. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  7106. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  7107. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  7108. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  7109. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  7110. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  7111. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  7112. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  7113. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  7114. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  7115. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  7116. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  7117. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  7118. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  7119. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  7120. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  7121. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  7122. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  7123. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  7124. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  7125. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  7126. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  7127. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  7128. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  7129. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  7130. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  7131. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  7132. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  7133. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  7134. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  7135. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  7136. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  7137. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  7138. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  7139. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  7140. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  7141. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  7142. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  7143. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  7144. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  7145. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  7146. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  7147. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  7148. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  7149. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  7150. do { \
  7151. HTT_CHECK_SET_VAL(httsym, enable); \
  7152. (word) |= (enable) << httsym##_S; \
  7153. } while (0)
  7154. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  7155. (((word) & httsym##_M) >> httsym##_S)
  7156. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  7157. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  7158. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  7159. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  7160. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  7161. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  7162. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  7163. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  7164. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  7165. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  7166. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  7167. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  7168. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  7169. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  7170. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  7171. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  7172. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  7173. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  7174. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  7175. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  7176. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  7177. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  7178. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  7179. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  7180. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  7181. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  7182. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  7183. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  7184. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  7185. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  7186. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  7187. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  7188. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  7189. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  7190. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  7191. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  7192. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  7193. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  7194. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  7195. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  7196. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  7197. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  7198. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  7199. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  7200. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  7201. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  7202. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  7203. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  7204. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  7205. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  7206. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  7207. do { \
  7208. HTT_CHECK_SET_VAL(httsym, enable); \
  7209. (word) |= (enable) << httsym##_S; \
  7210. } while (0)
  7211. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  7212. (((word) & httsym##_M) >> httsym##_S)
  7213. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  7214. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  7215. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  7216. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  7217. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  7218. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  7219. /**
  7220. * @brief host --> target Receive Flow Steering configuration message definition
  7221. *
  7222. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  7223. *
  7224. * host --> target Receive Flow Steering configuration message definition.
  7225. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7226. * The reason for this is we want RFS to be configured and ready before MAC
  7227. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7228. *
  7229. * |31 24|23 16|15 9|8|7 0|
  7230. * |----------------+----------------+----------------+----------------|
  7231. * | reserved |E| msg type |
  7232. * |-------------------------------------------------------------------|
  7233. * Where E = RFS enable flag
  7234. *
  7235. * The RFS_CONFIG message consists of a single 4-byte word.
  7236. *
  7237. * Header fields:
  7238. * - MSG_TYPE
  7239. * Bits 7:0
  7240. * Purpose: identifies this as a RFS config msg
  7241. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  7242. * - RFS_CONFIG
  7243. * Bit 8
  7244. * Purpose: Tells target whether to enable (1) or disable (0)
  7245. * flow steering feature when sending rx indication messages to host
  7246. */
  7247. #define HTT_H2T_RFS_CONFIG_M 0x100
  7248. #define HTT_H2T_RFS_CONFIG_S 8
  7249. #define HTT_RX_RFS_CONFIG_GET(_var) \
  7250. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  7251. HTT_H2T_RFS_CONFIG_S)
  7252. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  7253. do { \
  7254. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  7255. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  7256. } while (0)
  7257. #define HTT_RFS_CFG_REQ_BYTES 4
  7258. /**
  7259. * @brief host -> target FW extended statistics request
  7260. *
  7261. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  7262. *
  7263. * @details
  7264. * The following field definitions describe the format of the HTT host
  7265. * to target FW extended stats retrieve message.
  7266. * The message specifies the type of stats the host wants to retrieve.
  7267. *
  7268. * |31 24|23 16|15 8|7 0|
  7269. * |-----------------------------------------------------------|
  7270. * | reserved | stats type | pdev_mask | msg type |
  7271. * |-----------------------------------------------------------|
  7272. * | config param [0] |
  7273. * |-----------------------------------------------------------|
  7274. * | config param [1] |
  7275. * |-----------------------------------------------------------|
  7276. * | config param [2] |
  7277. * |-----------------------------------------------------------|
  7278. * | config param [3] |
  7279. * |-----------------------------------------------------------|
  7280. * | reserved |
  7281. * |-----------------------------------------------------------|
  7282. * | cookie LSBs |
  7283. * |-----------------------------------------------------------|
  7284. * | cookie MSBs |
  7285. * |-----------------------------------------------------------|
  7286. * Header fields:
  7287. * - MSG_TYPE
  7288. * Bits 7:0
  7289. * Purpose: identifies this is a extended stats upload request message
  7290. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7291. * - PDEV_MASK
  7292. * Bits 8:15
  7293. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7294. * Value: This is a overloaded field, refer to usage and interpretation of
  7295. * PDEV in interface document.
  7296. * Bit 8 : Reserved for SOC stats
  7297. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7298. * Indicates MACID_MASK in DBS
  7299. * - STATS_TYPE
  7300. * Bits 23:16
  7301. * Purpose: identifies which FW statistics to upload
  7302. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7303. * - Reserved
  7304. * Bits 31:24
  7305. * - CONFIG_PARAM [0]
  7306. * Bits 31:0
  7307. * Purpose: give an opaque configuration value to the specified stats type
  7308. * Value: stats-type specific configuration value
  7309. * Refer to htt_stats.h for interpretation for each stats sub_type
  7310. * - CONFIG_PARAM [1]
  7311. * Bits 31:0
  7312. * Purpose: give an opaque configuration value to the specified stats type
  7313. * Value: stats-type specific configuration value
  7314. * Refer to htt_stats.h for interpretation for each stats sub_type
  7315. * - CONFIG_PARAM [2]
  7316. * Bits 31:0
  7317. * Purpose: give an opaque configuration value to the specified stats type
  7318. * Value: stats-type specific configuration value
  7319. * Refer to htt_stats.h for interpretation for each stats sub_type
  7320. * - CONFIG_PARAM [3]
  7321. * Bits 31:0
  7322. * Purpose: give an opaque configuration value to the specified stats type
  7323. * Value: stats-type specific configuration value
  7324. * Refer to htt_stats.h for interpretation for each stats sub_type
  7325. * - Reserved [31:0] for future use.
  7326. * - COOKIE_LSBS
  7327. * Bits 31:0
  7328. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7329. * message with its preceding host->target stats request message.
  7330. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7331. * - COOKIE_MSBS
  7332. * Bits 31:0
  7333. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7334. * message with its preceding host->target stats request message.
  7335. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7336. */
  7337. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7338. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7339. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7340. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7341. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7342. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7343. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7344. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7345. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7346. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7347. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7348. do { \
  7349. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7350. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7351. } while (0)
  7352. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7353. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7354. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7355. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7356. do { \
  7357. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7358. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7359. } while (0)
  7360. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7361. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7362. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7363. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7364. do { \
  7365. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7366. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7367. } while (0)
  7368. /**
  7369. * @brief host -> target FW streaming statistics request
  7370. *
  7371. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7372. *
  7373. * @details
  7374. * The following field definitions describe the format of the HTT host
  7375. * to target message that requests the target to start or stop producing
  7376. * ongoing stats of the specified type.
  7377. *
  7378. * |31|30 |23 16|15 8|7 0|
  7379. * |-----------------------------------------------------------|
  7380. * |EN| reserved | stats type | reserved | msg type |
  7381. * |-----------------------------------------------------------|
  7382. * | config param [0] |
  7383. * |-----------------------------------------------------------|
  7384. * | config param [1] |
  7385. * |-----------------------------------------------------------|
  7386. * | config param [2] |
  7387. * |-----------------------------------------------------------|
  7388. * | config param [3] |
  7389. * |-----------------------------------------------------------|
  7390. * Where:
  7391. * - EN is an enable/disable flag
  7392. * Header fields:
  7393. * - MSG_TYPE
  7394. * Bits 7:0
  7395. * Purpose: identifies this is a streaming stats upload request message
  7396. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7397. * - STATS_TYPE
  7398. * Bits 23:16
  7399. * Purpose: identifies which FW statistics to upload
  7400. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7401. * Only the htt_dbg_ext_stats_type values identified as streaming
  7402. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7403. * - ENABLE
  7404. * Bit 31
  7405. * Purpose: enable/disable the target's ongoing stats of the specified type
  7406. * Value:
  7407. * 0 - disable ongoing production of the specified stats type
  7408. * 1 - enable ongoing production of the specified stats type
  7409. * - CONFIG_PARAM [0]
  7410. * Bits 31:0
  7411. * Purpose: give an opaque configuration value to the specified stats type
  7412. * Value: stats-type specific configuration value
  7413. * Refer to htt_stats.h for interpretation for each stats sub_type
  7414. * - CONFIG_PARAM [1]
  7415. * Bits 31:0
  7416. * Purpose: give an opaque configuration value to the specified stats type
  7417. * Value: stats-type specific configuration value
  7418. * Refer to htt_stats.h for interpretation for each stats sub_type
  7419. * - CONFIG_PARAM [2]
  7420. * Bits 31:0
  7421. * Purpose: give an opaque configuration value to the specified stats type
  7422. * Value: stats-type specific configuration value
  7423. * Refer to htt_stats.h for interpretation for each stats sub_type
  7424. * - CONFIG_PARAM [3]
  7425. * Bits 31:0
  7426. * Purpose: give an opaque configuration value to the specified stats type
  7427. * Value: stats-type specific configuration value
  7428. * Refer to htt_stats.h for interpretation for each stats sub_type
  7429. */
  7430. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7431. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7432. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7433. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7434. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7435. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7436. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7437. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7438. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7439. do { \
  7440. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7441. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7442. } while (0)
  7443. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7444. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7445. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7446. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7447. do { \
  7448. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7449. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7450. } while (0)
  7451. /**
  7452. * @brief host -> target FW PPDU_STATS request message
  7453. *
  7454. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7455. *
  7456. * @details
  7457. * The following field definitions describe the format of the HTT host
  7458. * to target FW for PPDU_STATS_CFG msg.
  7459. * The message allows the host to configure the PPDU_STATS_IND messages
  7460. * produced by the target.
  7461. *
  7462. * |31 24|23 16|15 8|7 0|
  7463. * |-----------------------------------------------------------|
  7464. * | REQ bit mask | pdev_mask | msg type |
  7465. * |-----------------------------------------------------------|
  7466. * Header fields:
  7467. * - MSG_TYPE
  7468. * Bits 7:0
  7469. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7470. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7471. * - PDEV_MASK
  7472. * Bits 8:15
  7473. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7474. * Value: This is a overloaded field, refer to usage and interpretation of
  7475. * PDEV in interface document.
  7476. * Bit 8 : Reserved for SOC stats
  7477. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7478. * Indicates MACID_MASK in DBS
  7479. * - REQ_TLV_BIT_MASK
  7480. * Bits 16:31
  7481. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7482. * needs to be included in the target's PPDU_STATS_IND messages.
  7483. * Value: refer htt_ppdu_stats_tlv_tag_t
  7484. *
  7485. */
  7486. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7487. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7488. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7489. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7490. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7491. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7492. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7493. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7494. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7495. do { \
  7496. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7497. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7498. } while (0)
  7499. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7500. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7501. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7502. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7503. do { \
  7504. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7505. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7506. } while (0)
  7507. /**
  7508. * @brief Host-->target HTT RX FSE setup message
  7509. *
  7510. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7511. *
  7512. * @details
  7513. * Through this message, the host will provide details of the flow tables
  7514. * in host DDR along with hash keys.
  7515. * This message can be sent per SOC or per PDEV, which is differentiated
  7516. * by pdev id values.
  7517. * The host will allocate flow search table and sends table size,
  7518. * physical DMA address of flow table, and hash keys to firmware to
  7519. * program into the RXOLE FSE HW block.
  7520. *
  7521. * The following field definitions describe the format of the RX FSE setup
  7522. * message sent from the host to target
  7523. *
  7524. * Header fields:
  7525. * dword0 - b'7:0 - msg_type: This will be set to
  7526. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7527. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7528. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7529. * pdev's LMAC ring.
  7530. * b'31:16 - reserved : Reserved for future use
  7531. * dword1 - b'19:0 - number of records: This field indicates the number of
  7532. * entries in the flow table. For example: 8k number of
  7533. * records is equivalent to
  7534. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7535. * b'27:20 - max search: This field specifies the skid length to FSE
  7536. * parser HW module whenever match is not found at the
  7537. * exact index pointed by hash.
  7538. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7539. * Refer htt_ip_da_sa_prefix below for more details.
  7540. * b'31:30 - reserved: Reserved for future use
  7541. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7542. * table allocated by host in DDR
  7543. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7544. * table allocated by host in DDR
  7545. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7546. * entry hashing
  7547. *
  7548. *
  7549. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7550. * |---------------------------------------------------------------|
  7551. * | reserved | pdev_id | MSG_TYPE |
  7552. * |---------------------------------------------------------------|
  7553. * |resvd|IPDSA| max_search | Number of records |
  7554. * |---------------------------------------------------------------|
  7555. * | base address lo |
  7556. * |---------------------------------------------------------------|
  7557. * | base address high |
  7558. * |---------------------------------------------------------------|
  7559. * | toeplitz key 31_0 |
  7560. * |---------------------------------------------------------------|
  7561. * | toeplitz key 63_32 |
  7562. * |---------------------------------------------------------------|
  7563. * | toeplitz key 95_64 |
  7564. * |---------------------------------------------------------------|
  7565. * | toeplitz key 127_96 |
  7566. * |---------------------------------------------------------------|
  7567. * | toeplitz key 159_128 |
  7568. * |---------------------------------------------------------------|
  7569. * | toeplitz key 191_160 |
  7570. * |---------------------------------------------------------------|
  7571. * | toeplitz key 223_192 |
  7572. * |---------------------------------------------------------------|
  7573. * | toeplitz key 255_224 |
  7574. * |---------------------------------------------------------------|
  7575. * | toeplitz key 287_256 |
  7576. * |---------------------------------------------------------------|
  7577. * | reserved | toeplitz key 314_288(26:0 bits) |
  7578. * |---------------------------------------------------------------|
  7579. * where:
  7580. * IPDSA = ip_da_sa
  7581. */
  7582. /**
  7583. * @brief: htt_ip_da_sa_prefix
  7584. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7585. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7586. * documentation per RFC3849
  7587. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7588. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7589. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7590. */
  7591. enum htt_ip_da_sa_prefix {
  7592. HTT_RX_IPV6_20010db8,
  7593. HTT_RX_IPV4_MAPPED_IPV6,
  7594. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7595. HTT_RX_IPV6_64FF9B,
  7596. };
  7597. /**
  7598. * @brief Host-->target HTT RX FISA configure and enable
  7599. *
  7600. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7601. *
  7602. * @details
  7603. * The host will send this command down to configure and enable the FISA
  7604. * operational params.
  7605. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7606. * register.
  7607. * Should configure both the MACs.
  7608. *
  7609. * dword0 - b'7:0 - msg_type:
  7610. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7611. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7612. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7613. * pdev's LMAC ring.
  7614. * b'31:16 - reserved : Reserved for future use
  7615. *
  7616. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7617. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7618. * packets. 1 flow search will be skipped
  7619. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7620. * tcp,udp packets
  7621. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7622. * calculation
  7623. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7624. * calculation
  7625. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7626. * calculation
  7627. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7628. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7629. * length
  7630. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7631. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7632. * length
  7633. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7634. * num jump
  7635. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7636. * num jump
  7637. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7638. * data type switch has happened for MPDU Sequence num jump
  7639. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7640. * for MPDU Sequence num jump
  7641. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7642. * for decrypt errors
  7643. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7644. * while aggregating a msdu
  7645. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7646. * The aggregation is done until (number of MSDUs aggregated
  7647. * < LIMIT + 1)
  7648. * b'31:18 - Reserved
  7649. *
  7650. * fisa_control_value - 32bit value FW can write to register
  7651. *
  7652. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7653. * Threshold value for FISA timeout (units are microseconds).
  7654. * When the global timestamp exceeds this threshold, FISA
  7655. * aggregation will be restarted.
  7656. * A value of 0 means timeout is disabled.
  7657. * Compare the threshold register with timestamp field in
  7658. * flow entry to generate timeout for the flow.
  7659. *
  7660. * |31 18 |17 16|15 8|7 0|
  7661. * |-------------------------------------------------------------|
  7662. * | reserved | pdev_mask | msg type |
  7663. * |-------------------------------------------------------------|
  7664. * | reserved | FISA_CTRL |
  7665. * |-------------------------------------------------------------|
  7666. * | FISA_TIMEOUT_THRESH |
  7667. * |-------------------------------------------------------------|
  7668. */
  7669. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7670. A_UINT32 msg_type:8,
  7671. pdev_id:8,
  7672. reserved0:16;
  7673. /**
  7674. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7675. * [17:0]
  7676. */
  7677. union {
  7678. /*
  7679. * fisa_control_bits structure is deprecated.
  7680. * Please use fisa_control_bits_v2 going forward.
  7681. */
  7682. struct {
  7683. A_UINT32 fisa_enable: 1,
  7684. ipsec_skip_search: 1,
  7685. nontcp_skip_search: 1,
  7686. add_ipv4_fixed_hdr_len: 1,
  7687. add_ipv6_fixed_hdr_len: 1,
  7688. add_tcp_fixed_hdr_len: 1,
  7689. add_udp_hdr_len: 1,
  7690. chksum_cum_ip_len_en: 1,
  7691. disable_tid_check: 1,
  7692. disable_ta_check: 1,
  7693. disable_qos_check: 1,
  7694. disable_raw_check: 1,
  7695. disable_decrypt_err_check: 1,
  7696. disable_msdu_drop_check: 1,
  7697. fisa_aggr_limit: 4,
  7698. reserved: 14;
  7699. } fisa_control_bits;
  7700. struct {
  7701. A_UINT32 fisa_enable: 1,
  7702. fisa_aggr_limit: 4,
  7703. reserved: 27;
  7704. } fisa_control_bits_v2;
  7705. A_UINT32 fisa_control_value;
  7706. } u_fisa_control;
  7707. /**
  7708. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7709. * timeout threshold for aggregation. Unit in usec.
  7710. * [31:0]
  7711. */
  7712. A_UINT32 fisa_timeout_threshold;
  7713. } POSTPACK;
  7714. /* DWord 0: pdev-ID */
  7715. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7716. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7717. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7718. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7719. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7720. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7721. do { \
  7722. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7723. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7724. } while (0)
  7725. /* Dword 1: fisa_control_value fisa config */
  7726. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7727. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7728. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7729. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7730. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7731. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7732. do { \
  7733. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7734. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7735. } while (0)
  7736. /* Dword 1: fisa_control_value ipsec_skip_search */
  7737. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7738. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7739. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7740. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7741. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7742. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7743. do { \
  7744. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7745. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7746. } while (0)
  7747. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7748. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7749. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7750. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7751. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7752. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7753. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7754. do { \
  7755. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7756. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7757. } while (0)
  7758. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7759. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7760. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7761. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7762. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7763. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7764. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7765. do { \
  7766. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7767. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7768. } while (0)
  7769. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7770. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7771. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7772. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7773. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7774. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7775. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7776. do { \
  7777. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7778. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7779. } while (0)
  7780. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7781. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7782. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7783. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7784. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7785. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7786. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7787. do { \
  7788. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7789. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7790. } while (0)
  7791. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7792. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7793. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7794. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7795. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7796. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7797. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7798. do { \
  7799. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7800. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7801. } while (0)
  7802. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7803. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7804. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7805. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7806. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7807. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7808. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7809. do { \
  7810. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7811. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7812. } while (0)
  7813. /* Dword 1: fisa_control_value disable_tid_check */
  7814. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7815. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7816. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7817. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7818. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7819. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7820. do { \
  7821. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7822. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7823. } while (0)
  7824. /* Dword 1: fisa_control_value disable_ta_check */
  7825. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7826. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7827. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7828. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7829. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7830. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7831. do { \
  7832. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7833. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7834. } while (0)
  7835. /* Dword 1: fisa_control_value disable_qos_check */
  7836. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7837. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7838. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7839. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7840. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7841. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7842. do { \
  7843. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7844. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7845. } while (0)
  7846. /* Dword 1: fisa_control_value disable_raw_check */
  7847. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7848. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7849. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7850. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7851. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7852. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7853. do { \
  7854. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7855. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7856. } while (0)
  7857. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7858. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7859. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7860. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7861. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7862. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7863. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7864. do { \
  7865. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7866. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7867. } while (0)
  7868. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7869. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7870. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7871. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7872. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7873. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7874. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7875. do { \
  7876. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7877. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7878. } while (0)
  7879. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7880. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7881. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7882. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7883. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7884. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7885. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7886. do { \
  7887. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7888. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7889. } while (0)
  7890. /* Dword 1: fisa_control_value fisa config */
  7891. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7892. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7893. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7894. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7895. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7896. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7897. do { \
  7898. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7899. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7900. } while (0)
  7901. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7902. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7903. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7904. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7905. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7906. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7907. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7908. do { \
  7909. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7910. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7911. } while (0)
  7912. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7913. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7914. pdev_id:8,
  7915. reserved0:16;
  7916. A_UINT32 num_records:20,
  7917. max_search:8,
  7918. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7919. reserved1:2;
  7920. A_UINT32 base_addr_lo;
  7921. A_UINT32 base_addr_hi;
  7922. A_UINT32 toeplitz31_0;
  7923. A_UINT32 toeplitz63_32;
  7924. A_UINT32 toeplitz95_64;
  7925. A_UINT32 toeplitz127_96;
  7926. A_UINT32 toeplitz159_128;
  7927. A_UINT32 toeplitz191_160;
  7928. A_UINT32 toeplitz223_192;
  7929. A_UINT32 toeplitz255_224;
  7930. A_UINT32 toeplitz287_256;
  7931. A_UINT32 toeplitz314_288:27,
  7932. reserved2:5;
  7933. } POSTPACK;
  7934. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7935. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7936. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7937. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7938. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7939. /* DWORD 0: Pdev ID */
  7940. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7941. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7942. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7943. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7944. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7945. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7946. do { \
  7947. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7948. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7949. } while (0)
  7950. /* DWORD 1:num of records */
  7951. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7952. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7953. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7954. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7955. HTT_RX_FSE_SETUP_NUM_REC_S)
  7956. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7957. do { \
  7958. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7959. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7960. } while (0)
  7961. /* DWORD 1:max_search */
  7962. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7963. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7964. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7965. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7966. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7967. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7968. do { \
  7969. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7970. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7971. } while (0)
  7972. /* DWORD 1:ip_da_sa prefix */
  7973. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7974. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7975. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7976. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7977. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7978. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7979. do { \
  7980. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7981. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7982. } while (0)
  7983. /* DWORD 2: Base Address LO */
  7984. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7985. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7986. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7987. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7988. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7989. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7990. do { \
  7991. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7992. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7993. } while (0)
  7994. /* DWORD 3: Base Address High */
  7995. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7996. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7997. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7998. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7999. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  8000. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  8001. do { \
  8002. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  8003. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  8004. } while (0)
  8005. /* DWORD 4-12: Hash Value */
  8006. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  8007. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  8008. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  8009. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  8010. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  8011. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  8012. do { \
  8013. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  8014. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  8015. } while (0)
  8016. /* DWORD 13: Hash Value 314:288 bits */
  8017. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  8018. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  8019. HTT_RX_FSE_SETUP_HASH_314_288_S)
  8020. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  8021. do { \
  8022. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  8023. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  8024. } while (0)
  8025. /**
  8026. * @brief Host-->target HTT RX FSE operation message
  8027. *
  8028. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  8029. *
  8030. * @details
  8031. * The host will send this Flow Search Engine (FSE) operation message for
  8032. * every flow add/delete operation.
  8033. * The FSE operation includes FSE full cache invalidation or individual entry
  8034. * invalidation.
  8035. * This message can be sent per SOC or per PDEV which is differentiated
  8036. * by pdev id values.
  8037. *
  8038. * |31 16|15 8|7 1|0|
  8039. * |-------------------------------------------------------------|
  8040. * | reserved | pdev_id | MSG_TYPE |
  8041. * |-------------------------------------------------------------|
  8042. * | reserved | operation |I|
  8043. * |-------------------------------------------------------------|
  8044. * | ip_src_addr_31_0 |
  8045. * |-------------------------------------------------------------|
  8046. * | ip_src_addr_63_32 |
  8047. * |-------------------------------------------------------------|
  8048. * | ip_src_addr_95_64 |
  8049. * |-------------------------------------------------------------|
  8050. * | ip_src_addr_127_96 |
  8051. * |-------------------------------------------------------------|
  8052. * | ip_dst_addr_31_0 |
  8053. * |-------------------------------------------------------------|
  8054. * | ip_dst_addr_63_32 |
  8055. * |-------------------------------------------------------------|
  8056. * | ip_dst_addr_95_64 |
  8057. * |-------------------------------------------------------------|
  8058. * | ip_dst_addr_127_96 |
  8059. * |-------------------------------------------------------------|
  8060. * | l4_dst_port | l4_src_port |
  8061. * | (32-bit SPI incase of IPsec) |
  8062. * |-------------------------------------------------------------|
  8063. * | reserved | l4_proto |
  8064. * |-------------------------------------------------------------|
  8065. *
  8066. * where I is 1-bit ipsec_valid.
  8067. *
  8068. * The following field definitions describe the format of the RX FSE operation
  8069. * message sent from the host to target for every add/delete flow entry to flow
  8070. * table.
  8071. *
  8072. * Header fields:
  8073. * dword0 - b'7:0 - msg_type: This will be set to
  8074. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  8075. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8076. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8077. * specified pdev's LMAC ring.
  8078. * b'31:16 - reserved : Reserved for future use
  8079. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  8080. * (Internet Protocol Security).
  8081. * IPsec describes the framework for providing security at
  8082. * IP layer. IPsec is defined for both versions of IP:
  8083. * IPV4 and IPV6.
  8084. * Please refer to htt_rx_flow_proto enumeration below for
  8085. * more info.
  8086. * ipsec_valid = 1 for IPSEC packets
  8087. * ipsec_valid = 0 for IP Packets
  8088. * b'7:1 - operation: This indicates types of FSE operation.
  8089. * Refer to htt_rx_fse_operation enumeration:
  8090. * 0 - No Cache Invalidation required
  8091. * 1 - Cache invalidate only one entry given by IP
  8092. * src/dest address at DWORD[2:9]
  8093. * 2 - Complete FSE Cache Invalidation
  8094. * 3 - FSE Disable
  8095. * 4 - FSE Enable
  8096. * b'31:8 - reserved: Reserved for future use
  8097. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  8098. * for per flow addition/deletion
  8099. * For IPV4 src/dest addresses, the first A_UINT32 is used
  8100. * and the subsequent 3 A_UINT32 will be padding bytes.
  8101. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  8102. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  8103. * from 0 to 65535 but only 0 to 1023 are designated as
  8104. * well-known ports. Refer to [RFC1700] for more details.
  8105. * This field is valid only if
  8106. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  8107. * - L4 dest port (31:16): 16-bit Destination Port numbers
  8108. * range from 0 to 65535 but only 0 to 1023 are designated
  8109. * as well-known ports. Refer to [RFC1700] for more details.
  8110. * This field is valid only if
  8111. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  8112. * - SPI (31:0): Security Parameters Index is an
  8113. * identification tag added to the header while using IPsec
  8114. * for tunneling the IP traffici.
  8115. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  8116. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  8117. * Assigned Internet Protocol Numbers.
  8118. * l4_proto numbers for standard protocol like UDP/TCP
  8119. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  8120. * l4_proto = 17 for UDP etc.
  8121. * b'31:8 - reserved: Reserved for future use.
  8122. *
  8123. */
  8124. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  8125. A_UINT32 msg_type:8,
  8126. pdev_id:8,
  8127. reserved0:16;
  8128. A_UINT32 ipsec_valid:1,
  8129. operation:7,
  8130. reserved1:24;
  8131. A_UINT32 ip_src_addr_31_0;
  8132. A_UINT32 ip_src_addr_63_32;
  8133. A_UINT32 ip_src_addr_95_64;
  8134. A_UINT32 ip_src_addr_127_96;
  8135. A_UINT32 ip_dest_addr_31_0;
  8136. A_UINT32 ip_dest_addr_63_32;
  8137. A_UINT32 ip_dest_addr_95_64;
  8138. A_UINT32 ip_dest_addr_127_96;
  8139. union {
  8140. A_UINT32 spi;
  8141. struct {
  8142. A_UINT32 l4_src_port:16,
  8143. l4_dest_port:16;
  8144. } ip;
  8145. } u;
  8146. A_UINT32 l4_proto:8,
  8147. reserved:24;
  8148. } POSTPACK;
  8149. /**
  8150. * @brief Host-->target HTT RX Full monitor mode register configuration message
  8151. *
  8152. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  8153. *
  8154. * @details
  8155. * The host will send this Full monitor mode register configuration message.
  8156. * This message can be sent per SOC or per PDEV which is differentiated
  8157. * by pdev id values.
  8158. *
  8159. * |31 16|15 11|10 8|7 3|2|1|0|
  8160. * |-------------------------------------------------------------|
  8161. * | reserved | pdev_id | MSG_TYPE |
  8162. * |-------------------------------------------------------------|
  8163. * | reserved |Release Ring |N|Z|E|
  8164. * |-------------------------------------------------------------|
  8165. *
  8166. * where E is 1-bit full monitor mode enable/disable.
  8167. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  8168. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  8169. *
  8170. * The following field definitions describe the format of the full monitor
  8171. * mode configuration message sent from the host to target for each pdev.
  8172. *
  8173. * Header fields:
  8174. * dword0 - b'7:0 - msg_type: This will be set to
  8175. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  8176. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8177. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8178. * specified pdev's LMAC ring.
  8179. * b'31:16 - reserved : Reserved for future use.
  8180. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  8181. * monitor mode rxdma register is to be enabled or disabled.
  8182. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  8183. * additional descriptors at ppdu end for zero mpdus
  8184. * enabled or disabled.
  8185. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  8186. * additional descriptors at ppdu end for non zero mpdus
  8187. * enabled or disabled.
  8188. * b'10:3 - release_ring: This indicates the destination ring
  8189. * selection for the descriptor at the end of PPDU
  8190. * 0 - REO ring select
  8191. * 1 - FW ring select
  8192. * 2 - SW ring select
  8193. * 3 - Release ring select
  8194. * Refer to htt_rx_full_mon_release_ring.
  8195. * b'31:11 - reserved for future use
  8196. */
  8197. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  8198. A_UINT32 msg_type:8,
  8199. pdev_id:8,
  8200. reserved0:16;
  8201. A_UINT32 full_monitor_mode_enable:1,
  8202. addnl_descs_zero_mpdus_end:1,
  8203. addnl_descs_non_zero_mpdus_end:1,
  8204. release_ring:8,
  8205. reserved1:21;
  8206. } POSTPACK;
  8207. /**
  8208. * Enumeration for full monitor mode destination ring select
  8209. * 0 - REO destination ring select
  8210. * 1 - FW destination ring select
  8211. * 2 - SW destination ring select
  8212. * 3 - Release destination ring select
  8213. */
  8214. enum htt_rx_full_mon_release_ring {
  8215. HTT_RX_MON_RING_REO,
  8216. HTT_RX_MON_RING_FW,
  8217. HTT_RX_MON_RING_SW,
  8218. HTT_RX_MON_RING_RELEASE,
  8219. };
  8220. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  8221. /* DWORD 0: Pdev ID */
  8222. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  8223. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  8224. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  8225. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  8226. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  8227. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  8228. do { \
  8229. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  8230. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  8231. } while (0)
  8232. /* DWORD 1:ENABLE */
  8233. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  8234. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  8235. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  8236. do { \
  8237. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  8238. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  8239. } while (0)
  8240. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  8241. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  8242. /* DWORD 1:ZERO_MPDU */
  8243. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  8244. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  8245. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  8246. do { \
  8247. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  8248. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  8249. } while (0)
  8250. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  8251. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  8252. /* DWORD 1:NON_ZERO_MPDU */
  8253. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  8254. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  8255. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  8256. do { \
  8257. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  8258. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  8259. } while (0)
  8260. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  8261. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  8262. /* DWORD 1:RELEASE_RINGS */
  8263. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  8264. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  8265. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  8266. do { \
  8267. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  8268. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  8269. } while (0)
  8270. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  8271. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  8272. /**
  8273. * Enumeration for IP Protocol or IPSEC Protocol
  8274. * IPsec describes the framework for providing security at IP layer.
  8275. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  8276. */
  8277. enum htt_rx_flow_proto {
  8278. HTT_RX_FLOW_IP_PROTO,
  8279. HTT_RX_FLOW_IPSEC_PROTO,
  8280. };
  8281. /**
  8282. * Enumeration for FSE Cache Invalidation
  8283. * 0 - No Cache Invalidation required
  8284. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8285. * 2 - Complete FSE Cache Invalidation
  8286. * 3 - FSE Disable
  8287. * 4 - FSE Enable
  8288. */
  8289. enum htt_rx_fse_operation {
  8290. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8291. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8292. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8293. HTT_RX_FSE_DISABLE,
  8294. HTT_RX_FSE_ENABLE,
  8295. };
  8296. /* DWORD 0: Pdev ID */
  8297. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8298. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8299. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8300. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8301. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8302. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8303. do { \
  8304. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8305. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8306. } while (0)
  8307. /* DWORD 1:IP PROTO or IPSEC */
  8308. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8309. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8310. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8311. do { \
  8312. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8313. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8314. } while (0)
  8315. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8316. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8317. /* DWORD 1:FSE Operation */
  8318. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8319. #define HTT_RX_FSE_OPERATION_S 1
  8320. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8321. do { \
  8322. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8323. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8324. } while (0)
  8325. #define HTT_RX_FSE_OPERATION_GET(word) \
  8326. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8327. /* DWORD 2-9:IP Address */
  8328. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8329. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8330. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8331. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8332. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8333. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8334. do { \
  8335. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8336. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8337. } while (0)
  8338. /* DWORD 10:Source Port Number */
  8339. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8340. #define HTT_RX_FSE_SOURCEPORT_S 0
  8341. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8342. do { \
  8343. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8344. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8345. } while (0)
  8346. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8347. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8348. /* DWORD 11:Destination Port Number */
  8349. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8350. #define HTT_RX_FSE_DESTPORT_S 16
  8351. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8352. do { \
  8353. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8354. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8355. } while (0)
  8356. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8357. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8358. /* DWORD 10-11:SPI (In case of IPSEC) */
  8359. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8360. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8361. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8362. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8363. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8364. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8365. do { \
  8366. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8367. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8368. } while (0)
  8369. /* DWORD 12:L4 PROTO */
  8370. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8371. #define HTT_RX_FSE_L4_PROTO_S 0
  8372. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8373. do { \
  8374. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8375. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8376. } while (0)
  8377. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8378. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8379. /**
  8380. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8381. *
  8382. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8383. *
  8384. * |31 24|23 |15 8|7 2|1|0|
  8385. * |----------------+----------------+----------------+----------------|
  8386. * | reserved | pdev_id | msg_type |
  8387. * |---------------------------------+----------------+----------------|
  8388. * | reserved |E|F|
  8389. * |---------------------------------+----------------+----------------|
  8390. * Where E = Configure the target to provide the 3-tuple hash value in
  8391. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8392. * F = Configure the target to provide the 3-tuple hash value in
  8393. * flow_id_toeplitz field of rx_msdu_start tlv
  8394. *
  8395. * The following field definitions describe the format of the 3 tuple hash value
  8396. * message sent from the host to target as part of initialization sequence.
  8397. *
  8398. * Header fields:
  8399. * dword0 - b'7:0 - msg_type: This will be set to
  8400. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8401. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8402. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8403. * specified pdev's LMAC ring.
  8404. * b'31:16 - reserved : Reserved for future use
  8405. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8406. * b'1 - toeplitz_hash_2_or_4_field_enable
  8407. * b'31:2 - reserved : Reserved for future use
  8408. * ---------+------+----------------------------------------------------------
  8409. * bit1 | bit0 | Functionality
  8410. * ---------+------+----------------------------------------------------------
  8411. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8412. * | | in flow_id_toeplitz field
  8413. * ---------+------+----------------------------------------------------------
  8414. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8415. * | | in toeplitz_hash_2_or_4 field
  8416. * ---------+------+----------------------------------------------------------
  8417. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8418. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8419. * ---------+------+----------------------------------------------------------
  8420. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8421. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8422. * | | toeplitz_hash_2_or_4 field
  8423. *----------------------------------------------------------------------------
  8424. */
  8425. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8426. A_UINT32 msg_type :8,
  8427. pdev_id :8,
  8428. reserved0 :16;
  8429. A_UINT32 flow_id_toeplitz_field_enable :1,
  8430. toeplitz_hash_2_or_4_field_enable :1,
  8431. reserved1 :30;
  8432. } POSTPACK;
  8433. /* DWORD0 : pdev_id configuration Macros */
  8434. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8435. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8436. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8437. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8438. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8439. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8440. do { \
  8441. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8442. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8443. } while (0)
  8444. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8445. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8446. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8447. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8448. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8449. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8450. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8451. do { \
  8452. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8453. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8454. } while (0)
  8455. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8456. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8457. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8458. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8459. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8460. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8461. do { \
  8462. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8463. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8464. } while (0)
  8465. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8466. /**
  8467. * @brief host --> target Host PA Address Size
  8468. *
  8469. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8470. *
  8471. * @details
  8472. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8473. * provide the physical start address and size of each of the memory
  8474. * areas within host DDR that the target FW may need to access.
  8475. *
  8476. * For example, the host can use this message to allow the target FW
  8477. * to set up access to the host's pools of TQM link descriptors.
  8478. * The message would appear as follows:
  8479. *
  8480. * |31 24|23 16|15 8|7 0|
  8481. * |----------------+----------------+----------------+----------------|
  8482. * | reserved | num_entries | msg_type |
  8483. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8484. * | mem area 0 size |
  8485. * |----------------+----------------+----------------+----------------|
  8486. * | mem area 0 physical_address_lo |
  8487. * |----------------+----------------+----------------+----------------|
  8488. * | mem area 0 physical_address_hi |
  8489. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8490. * | mem area 1 size |
  8491. * |----------------+----------------+----------------+----------------|
  8492. * | mem area 1 physical_address_lo |
  8493. * |----------------+----------------+----------------+----------------|
  8494. * | mem area 1 physical_address_hi |
  8495. * |----------------+----------------+----------------+----------------|
  8496. * ...
  8497. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8498. * | mem area N size |
  8499. * |----------------+----------------+----------------+----------------|
  8500. * | mem area N physical_address_lo |
  8501. * |----------------+----------------+----------------+----------------|
  8502. * | mem area N physical_address_hi |
  8503. * |----------------+----------------+----------------+----------------|
  8504. *
  8505. * The message is interpreted as follows:
  8506. * dword0 - b'0:7 - msg_type: This will be set to
  8507. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8508. * b'8:15 - number_entries: Indicated the number of host memory
  8509. * areas specified within the remainder of the message
  8510. * b'16:31 - reserved.
  8511. * dword1 - b'0:31 - memory area 0 size in bytes
  8512. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8513. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8514. * and similar for memory area 1 through memory area N.
  8515. */
  8516. PREPACK struct htt_h2t_host_paddr_size {
  8517. A_UINT32 msg_type: 8,
  8518. num_entries: 8,
  8519. reserved: 16;
  8520. } POSTPACK;
  8521. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8522. A_UINT32 size;
  8523. A_UINT32 physical_address_lo;
  8524. A_UINT32 physical_address_hi;
  8525. } POSTPACK;
  8526. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE \
  8527. (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8528. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_DWORDS \
  8529. (HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE >> 2)
  8530. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8531. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8532. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8533. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8534. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8535. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8536. do { \
  8537. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8538. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8539. } while (0)
  8540. /**
  8541. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8542. *
  8543. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8544. *
  8545. * @details
  8546. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8547. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8548. *
  8549. * The message would appear as follows:
  8550. *
  8551. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8552. * |---------------------------------+---+---+----------+-+-----------|
  8553. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8554. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8555. *
  8556. *
  8557. * The message is interpreted as follows:
  8558. * dword0 - b'0:7 - msg_type: This will be set to
  8559. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8560. * b'8 - override bit to drive MSDUs to PPE ring
  8561. * b'9:13 - REO destination ring indication
  8562. * b'14 - Multi buffer msdu override enable bit
  8563. * b'15 - Intra BSS override
  8564. * b'16 - Decap raw override
  8565. * b'17 - Decap Native wifi override
  8566. * b'18 - IP frag override
  8567. * b'19:31 - reserved
  8568. */
  8569. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8570. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8571. override: 1,
  8572. reo_destination_indication: 5,
  8573. multi_buffer_msdu_override_en: 1,
  8574. intra_bss_override: 1,
  8575. decap_raw_override: 1,
  8576. decap_nwifi_override: 1,
  8577. ip_frag_override: 1,
  8578. reserved: 13;
  8579. } POSTPACK;
  8580. /* DWORD 0: Override */
  8581. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8582. #define HTT_PPE_CFG_OVERRIDE_S 8
  8583. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8584. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8585. HTT_PPE_CFG_OVERRIDE_S)
  8586. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8587. do { \
  8588. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8589. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8590. } while (0)
  8591. /* DWORD 0: REO Destination Indication*/
  8592. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8593. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8594. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8595. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8596. HTT_PPE_CFG_REO_DEST_IND_S)
  8597. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8598. do { \
  8599. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8600. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8601. } while (0)
  8602. /* DWORD 0: Multi buffer MSDU override */
  8603. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8604. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8605. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8606. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8607. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8608. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8609. do { \
  8610. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8611. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8612. } while (0)
  8613. /* DWORD 0: Intra BSS override */
  8614. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8615. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8616. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8617. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8618. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8619. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8620. do { \
  8621. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8622. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8623. } while (0)
  8624. /* DWORD 0: Decap RAW override */
  8625. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8626. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8627. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8628. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8629. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8630. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8631. do { \
  8632. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8633. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8634. } while (0)
  8635. /* DWORD 0: Decap NWIFI override */
  8636. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8637. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8638. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8639. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8640. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8641. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8642. do { \
  8643. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8644. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8645. } while (0)
  8646. /* DWORD 0: IP frag override */
  8647. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8648. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8649. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8650. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8651. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8652. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8653. do { \
  8654. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8655. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8656. } while (0)
  8657. /*
  8658. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8659. *
  8660. * @details
  8661. * The following field definitions describe the format of the HTT host
  8662. * to target FW VDEV TX RX stats retrieve message.
  8663. * The message specifies the type of stats the host wants to retrieve.
  8664. *
  8665. * |31 27|26 25|24 17|16|15 8|7 0|
  8666. * |-----------------------------------------------------------|
  8667. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8668. * |-----------------------------------------------------------|
  8669. * | vdev_id lower bitmask |
  8670. * |-----------------------------------------------------------|
  8671. * | vdev_id upper bitmask |
  8672. * |-----------------------------------------------------------|
  8673. * Header fields:
  8674. * Where:
  8675. * dword0 - b'7:0 - msg_type: This will be set to
  8676. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8677. * b'15:8 - pdev id
  8678. * b'16(E) - Enable/Disable the vdev HW stats
  8679. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8680. * b'25:26(R) - Reset stats bits
  8681. * 0: don't reset stats
  8682. * 1: reset stats once
  8683. * 2: reset stats at the start of each periodic interval
  8684. * b'27:31 - reserved for future use
  8685. * dword1 - b'0:31 - vdev_id lower bitmask
  8686. * dword2 - b'0:31 - vdev_id upper bitmask
  8687. */
  8688. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8689. A_UINT32 msg_type :8,
  8690. pdev_id :8,
  8691. enable :1,
  8692. periodic_interval :8,
  8693. reset_stats_bits :2,
  8694. reserved0 :5;
  8695. A_UINT32 vdev_id_lower_bitmask;
  8696. A_UINT32 vdev_id_upper_bitmask;
  8697. } POSTPACK;
  8698. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8699. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8700. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8701. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8702. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8703. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8704. do { \
  8705. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8706. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8707. } while (0)
  8708. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8709. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8710. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8711. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8712. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8713. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8714. do { \
  8715. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8716. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8717. } while (0)
  8718. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8719. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8720. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8721. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8722. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8723. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8724. do { \
  8725. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8726. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8727. } while (0)
  8728. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8729. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8730. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8731. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8732. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8733. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8734. do { \
  8735. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8736. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8737. } while (0)
  8738. /*
  8739. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8740. *
  8741. * @details
  8742. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8743. * the default MSDU queues for one of the TIDs within the specified peer
  8744. * to the specified service class.
  8745. * The TID is indirectly specified - each service class is associated
  8746. * with a TID. All default MSDU queues for this peer-TID will be
  8747. * linked to the service class in question.
  8748. *
  8749. * |31 16|15 8|7 0|
  8750. * |------------------------------+--------------+--------------|
  8751. * | peer ID | svc class ID | msg type |
  8752. * |------------------------------------------------------------|
  8753. * Header fields:
  8754. * dword0 - b'7:0 - msg_type: This will be set to
  8755. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8756. * b'15:8 - service class ID
  8757. * b'31:16 - peer ID
  8758. */
  8759. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8760. A_UINT32 msg_type :8,
  8761. svc_class_id :8,
  8762. peer_id :16;
  8763. } POSTPACK;
  8764. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8765. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8766. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8767. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8768. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8769. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8770. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8771. do { \
  8772. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8773. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8774. } while (0)
  8775. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8776. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8777. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8778. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8779. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8780. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8781. do { \
  8782. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8783. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8784. } while (0)
  8785. /*
  8786. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8787. *
  8788. * @details
  8789. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8790. * remove the linkage of the specified peer-TID's MSDU queues to
  8791. * service classes.
  8792. *
  8793. * |31 16|15 8|7 0|
  8794. * |------------------------------+--------------+--------------|
  8795. * | peer ID | svc class ID | msg type |
  8796. * |------------------------------------------------------------|
  8797. * Header fields:
  8798. * dword0 - b'7:0 - msg_type: This will be set to
  8799. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8800. * b'15:8 - service class ID
  8801. * b'31:16 - peer ID
  8802. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8803. * value for peer ID indicates that the target should
  8804. * apply the UNMAP_REQ to all peers.
  8805. */
  8806. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8807. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8808. A_UINT32 msg_type :8,
  8809. svc_class_id :8,
  8810. peer_id :16;
  8811. } POSTPACK;
  8812. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8813. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8814. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8815. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8816. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8817. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8818. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8819. do { \
  8820. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8821. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8822. } while (0)
  8823. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8824. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8825. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8826. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8827. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8828. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8829. do { \
  8830. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8831. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8832. } while (0)
  8833. /*
  8834. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8835. *
  8836. * @details
  8837. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8838. * request the target to report what service class the default MSDU queues
  8839. * of the specified TIDs within the peer are linked to.
  8840. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8841. * to report what service class (if any) the default MSDU queues for
  8842. * each of the specified TIDs are linked to.
  8843. *
  8844. * |31 16|15 8|7 1| 0|
  8845. * |------------------------------+--------------+--------------|
  8846. * | peer ID | TID mask | msg type |
  8847. * |------------------------------------------------------------|
  8848. * | reserved |ETO|
  8849. * |------------------------------------------------------------|
  8850. * Header fields:
  8851. * dword0 - b'7:0 - msg_type: This will be set to
  8852. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8853. * b'15:8 - TID mask
  8854. * b'31:16 - peer ID
  8855. * dword1 - b'0 - "Existing Tids Only" flag
  8856. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8857. * message generated by this REQ will only show the
  8858. * mapping for TIDs that actually exist in the target's
  8859. * peer object.
  8860. * Any TIDs that are covered by a MAP_REQ but which
  8861. * do not actually exist will be shown as being
  8862. * unmapped (i.e. svc class ID 0xff).
  8863. * If this flag is cleared, the MAP_REPORT_CONF message
  8864. * will consider not only the mapping of TIDs currently
  8865. * existing in the peer, but also the mapping that will
  8866. * be applied for any TID objects created within this
  8867. * peer in the future.
  8868. * b'31:1 - reserved for future use
  8869. */
  8870. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8871. A_UINT32 msg_type :8,
  8872. tid_mask :8,
  8873. peer_id :16;
  8874. A_UINT32 existing_tids_only:1,
  8875. reserved :31;
  8876. } POSTPACK;
  8877. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8878. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8879. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8880. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8881. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8882. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8883. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8884. do { \
  8885. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8886. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8887. } while (0)
  8888. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8889. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8890. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8891. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8892. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8893. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8894. do { \
  8895. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8896. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8897. } while (0)
  8898. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8899. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8900. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8901. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8902. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8903. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8904. do { \
  8905. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8906. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8907. } while (0)
  8908. /**
  8909. * @brief Format of shared memory between Host and Target
  8910. * for UMAC hang recovery feature messaging.
  8911. * @details
  8912. * This is shared memory between Host and Target allocated
  8913. * and used in chips where UMAC hang recovery feature is supported.
  8914. * This shared memory is allocated per SOC level by Host since each
  8915. * SOC's target Q6FW needs to communicate independently to the Host
  8916. * through its own shared memory.
  8917. * If target sets a bit in t2h_msg (provided it's valid bit offset)
  8918. * then host interprets it as a new message from target.
  8919. * Host clears that particular read bit in t2h_msg after each read
  8920. * operation. It is vice versa for h2t_msg. At any given point
  8921. * of time there is expected to be only one bit set
  8922. * either in t2h_msg or h2t_msg (referring to valid bit offset).
  8923. *
  8924. * The message is interpreted as follows:
  8925. * dword0 - b'0:31 - magic_num: Magic number for the shared memory region
  8926. * added for debuggability purpose.
  8927. * dword1 - b'0 - do_pre_reset
  8928. * b'1 - do_post_reset_start
  8929. * b'2 - do_post_reset_complete
  8930. * b'3 - initiate_umac_recovery
  8931. * b'4:31 - rsvd_t2h
  8932. * dword2 - b'0 - pre_reset_done
  8933. * b'1 - post_reset_start_done
  8934. * b'2 - post_reset_complete_done
  8935. * b'3 - start_pre_reset
  8936. * b'4:31 - rsvd_h2t
  8937. */
  8938. PREPACK typedef struct {
  8939. /** Magic number added for debuggability. */
  8940. A_UINT32 magic_num;
  8941. union {
  8942. /*
  8943. * BIT [0] :- T2H msg to do pre-reset
  8944. * BIT [1] :- T2H msg to do post-reset start
  8945. * BIT [2] :- T2H msg to do post-reset complete
  8946. * BIT [3] :- T2H msg to initiate UMAC recovery sequence.
  8947. * This is needed to synchronize UMAC recovery
  8948. * across all SOCs.
  8949. * BIT [31 : 4] :- reserved
  8950. */
  8951. A_UINT32 t2h_msg;
  8952. struct {
  8953. A_UINT32 do_pre_reset : 1, /* BIT [0] */
  8954. do_post_reset_start : 1, /* BIT [1] */
  8955. do_post_reset_complete : 1, /* BIT [2] */
  8956. initiate_umac_recovery : 1, /* BIT [3] */
  8957. rsvd_t2h : 28; /* BIT [31 : 4] */
  8958. };
  8959. };
  8960. union {
  8961. /*
  8962. * BIT [0] :- H2T msg to send pre-reset done
  8963. * BIT [1] :- H2T msg to send post-reset start done
  8964. * BIT [2] :- H2T msg to send post-reset complete done
  8965. * BIT [3] :- H2T msg to start pre-reset.
  8966. * This is expected only after T2H
  8967. * initiate_umac_recovery was received by Host
  8968. * from one of the SOCs.
  8969. * BIT [31 : 4] :- reserved
  8970. */
  8971. A_UINT32 h2t_msg;
  8972. struct {
  8973. A_UINT32 pre_reset_done : 1, /* BIT [0] */
  8974. post_reset_start_done : 1, /* BIT [1] */
  8975. post_reset_complete_done : 1, /* BIT [2] */
  8976. start_pre_reset : 1, /* BIT [3] */
  8977. rsvd_h2t : 28; /* BIT [31 : 4] */
  8978. };
  8979. };
  8980. } POSTPACK htt_umac_hang_recovery_msg_shmem_t;
  8981. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES \
  8982. (sizeof(htt_umac_hang_recovery_msg_shmem_t))
  8983. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DWORDS \
  8984. (HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES >> 2)
  8985. /* dword1 - b'0 - do_pre_reset */
  8986. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M 0x00000001
  8987. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S 0
  8988. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_GET(word1) \
  8989. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M) >> \
  8990. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S)
  8991. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_SET(word1, _val) \
  8992. do { \
  8993. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET, _val); \
  8994. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S));\
  8995. } while (0)
  8996. /* dword1 - b'1 - do_post_reset_start */
  8997. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M 0x00000002
  8998. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S 1
  8999. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_GET(word1) \
  9000. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M) >> \
  9001. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S)
  9002. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_SET(word1, _val) \
  9003. do { \
  9004. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START, _val); \
  9005. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S));\
  9006. } while (0)
  9007. /* dword1 - b'2 - do_post_reset_complete */
  9008. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M 0x00000004
  9009. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S 2
  9010. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_GET(word1) \
  9011. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M) >> \
  9012. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S)
  9013. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_SET(word1, _val) \
  9014. do { \
  9015. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE, _val); \
  9016. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S));\
  9017. } while (0)
  9018. /* dword1 - b'3 - initiate_umac_recovery */
  9019. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M 0x00000008
  9020. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S 3
  9021. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_GET(word1) \
  9022. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M) >> \
  9023. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S)
  9024. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_SET(word1, _val) \
  9025. do { \
  9026. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY, _val); \
  9027. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S));\
  9028. } while (0)
  9029. /* dword2 - b'0 - pre_reset_done */
  9030. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M 0x00000001
  9031. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S 0
  9032. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_GET(word2) \
  9033. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M) >> \
  9034. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S)
  9035. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_SET(word2, _val) \
  9036. do { \
  9037. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE, _val); \
  9038. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S));\
  9039. } while (0)
  9040. /* dword2 - b'1 - post_reset_start_done */
  9041. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M 0x00000002
  9042. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S 1
  9043. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_GET(word2) \
  9044. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M) >> \
  9045. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S)
  9046. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_SET(word2, _val) \
  9047. do { \
  9048. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE, _val); \
  9049. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S));\
  9050. } while (0)
  9051. /* dword2 - b'2 - post_reset_complete_done */
  9052. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M 0x00000004
  9053. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S 2
  9054. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_GET(word2) \
  9055. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M) >> \
  9056. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S)
  9057. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_SET(word2, _val) \
  9058. do { \
  9059. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE, _val); \
  9060. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S));\
  9061. } while (0)
  9062. /* dword2 - b'3 - start_pre_reset */
  9063. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M 0x00000008
  9064. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S 3
  9065. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_GET(word2) \
  9066. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M) >> \
  9067. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S)
  9068. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_SET(word2, _val) \
  9069. do { \
  9070. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET, _val); \
  9071. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S));\
  9072. } while (0)
  9073. /**
  9074. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message
  9075. *
  9076. * @details
  9077. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message is sent
  9078. * by the host to provide prerequisite info to target for the UMAC hang
  9079. * recovery feature.
  9080. * The info sent in this H2T message are T2H message method, H2T message
  9081. * method, T2H MSI interrupt number and physical start address, size of
  9082. * the shared memory (refers to the shared memory dedicated for messaging
  9083. * between host and target when the DUT is in UMAC hang recovery mode).
  9084. * This H2T message is expected to be only sent if the WMI service bit
  9085. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target.
  9086. *
  9087. * |31 16|15 12|11 8|7 0|
  9088. * |-------------------------------+--------------+--------------+------------|
  9089. * | reserved |h2t msg method|t2h msg method| msg_type |
  9090. * |--------------------------------------------------------------------------|
  9091. * | t2h msi interrupt number |
  9092. * |--------------------------------------------------------------------------|
  9093. * | shared memory area size |
  9094. * |--------------------------------------------------------------------------|
  9095. * | shared memory area physical address low |
  9096. * |--------------------------------------------------------------------------|
  9097. * | shared memory area physical address high |
  9098. * |--------------------------------------------------------------------------|
  9099. *
  9100. * The message is interpreted as follows:
  9101. * dword0 - b'0:7 - msg_type
  9102. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP)
  9103. * b'8:11 - t2h_msg_method: indicates method to be used for
  9104. * T2H communication in UMAC hang recovery mode.
  9105. * Value zero indicates MSI interrupt (default method).
  9106. * Refer to htt_umac_hang_recovery_msg_method enum.
  9107. * b'12:15 - h2t_msg_method: indicates method to be used for
  9108. * H2T communication in UMAC hang recovery mode.
  9109. * Value zero indicates polling by target for this h2t msg
  9110. * during UMAC hang recovery mode.
  9111. * Refer to htt_umac_hang_recovery_msg_method enum.
  9112. * b'16:31 - reserved.
  9113. * dword1 - b'0:31 - t2h_msi_data: MSI data to be used for
  9114. * T2H communication in UMAC hang recovery mode.
  9115. * dword2 - b'0:31 - size: size of shared memory dedicated for messaging
  9116. * only when in UMAC hang recovery mode.
  9117. * This refers to size in bytes.
  9118. * dword3 - b'0:31 - physical_address_lo: lower 32 bit physical address
  9119. * of the shared memory dedicated for messaging only when
  9120. * in UMAC hang recovery mode.
  9121. * dword4 - b'0:31 - physical_address_hi: higher 32 bit physical address
  9122. * of the shared memory dedicated for messaging only when
  9123. * in UMAC hang recovery mode.
  9124. */
  9125. /* t2h_msg_method and h2t_msg_method */
  9126. enum htt_umac_hang_recovery_msg_method {
  9127. htt_umac_hang_recovery_msg_t2h_msi_and_h2t_polling = 0,
  9128. };
  9129. PREPACK typedef struct {
  9130. A_UINT32 msg_type : 8,
  9131. t2h_msg_method : 4,
  9132. h2t_msg_method : 4,
  9133. reserved : 16;
  9134. A_UINT32 t2h_msi_data;
  9135. /* size bytes and physical address of shared memory. */
  9136. struct htt_h2t_host_paddr_size_entry_t msg_shared_mem;
  9137. } POSTPACK htt_h2t_umac_hang_recovery_prerequisite_setup_t;
  9138. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES \
  9139. (sizeof(htt_h2t_umac_hang_recovery_prerequisite_setup_t))
  9140. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_DWORDS \
  9141. (HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES >> 2)
  9142. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M 0x00000F00
  9143. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S 8
  9144. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_GET(word0) \
  9145. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M) >> \
  9146. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S)
  9147. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_SET(word0, _val) \
  9148. do { \
  9149. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD, _val); \
  9150. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S));\
  9151. } while (0)
  9152. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M 0x0000F000
  9153. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S 12
  9154. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_GET(word0) \
  9155. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M) >> \
  9156. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S)
  9157. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_SET(word0, _val) \
  9158. do { \
  9159. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD, _val); \
  9160. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S));\
  9161. } while (0)
  9162. /**
  9163. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET message
  9164. *
  9165. * @details
  9166. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET is a SOC level
  9167. * HTT message sent by the host to indicate that the target needs to start the
  9168. * UMAC hang recovery feature from the point of pre-reset routine.
  9169. * The purpose of this H2T message is to have host synchronize and trigger
  9170. * UMAC recovery across all targets.
  9171. * The info sent in this H2T message is the flag to indicate whether the
  9172. * target needs to execute UMAC-recovery in context of the Initiator or
  9173. * Non-Initiator.
  9174. * This H2T message is expected to be sent as response to the
  9175. * initiate_umac_recovery indication from the Initiator target attached to
  9176. * this same host.
  9177. * This H2T message is expected to be only sent if the WMI service bit
  9178. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target
  9179. * and HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP was sent
  9180. * beforehand.
  9181. *
  9182. * |31 9|8|7 0|
  9183. * |-----------------------------------------------------------|
  9184. * | reserved |I| msg_type |
  9185. * |-----------------------------------------------------------|
  9186. * Where:
  9187. * I = is_initiator
  9188. *
  9189. * The message is interpreted as follows:
  9190. * dword0 - b'0:7 - msg_type
  9191. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET)
  9192. * b'8 - is_initiator: indicates whether the target needs to
  9193. * execute the UMAC-recovery in context of the Initiator or
  9194. * Non-Initiator.
  9195. * The value zero indicates this target is Non-Initiator.
  9196. * b'9:31 - reserved.
  9197. */
  9198. PREPACK typedef struct {
  9199. A_UINT32 msg_type : 8,
  9200. is_initiator : 1,
  9201. reserved : 23;
  9202. } POSTPACK htt_h2t_umac_hang_recovery_start_pre_reset_t;
  9203. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES \
  9204. (sizeof(htt_h2t_umac_hang_recovery_start_pre_reset_t))
  9205. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_DWORDS \
  9206. (HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES >> 2)
  9207. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M 0x00000100
  9208. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S 8
  9209. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_GET(word0) \
  9210. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M) >> \
  9211. HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S)
  9212. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_SET(word0, _val) \
  9213. do { \
  9214. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR, _val); \
  9215. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S));\
  9216. } while (0)
  9217. /*
  9218. * @brief host -> target HTT RX_CCE_SUPER_RULE_SETUP message
  9219. *
  9220. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP
  9221. *
  9222. * @details
  9223. * Host sends RX_CCE_SUPER_RULE setup message to target, in order to request,
  9224. * install or uninstall rx cce super rules to match certain kind of packets
  9225. * with specific parameters. Target sets up HW registers based on setup message
  9226. * and always confirms back to Host.
  9227. *
  9228. * The message would appear as follows:
  9229. * |31 24|23 16|15 8|7 0|
  9230. * |-----------------+-----------------+-----------------+-----------------|
  9231. * | reserved | operation | vdev_id | msg_type |
  9232. * |-----------------------------------------------------------------------|
  9233. * | cce_super_rule_param[0] |
  9234. * |-----------------------------------------------------------------------|
  9235. * | cce_super_rule_param[1] |
  9236. * |-----------------------------------------------------------------------|
  9237. *
  9238. * The message is interpreted as follows:
  9239. * dword0 - b'0:7 - msg_type: This will be set to
  9240. * 0x23 (HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP)
  9241. * b'8:15 - vdev_id: Identify which vdev RX_CCE_SUPER_RULE is for
  9242. * b'16:23 - operation: Identify operation to be taken,
  9243. * 0: HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST
  9244. * 1: HTT_RX_CCE_SUPER_RULE_INSTALL
  9245. * 2: HTT_RX_CCE_SUPER_RULE_RELEASE
  9246. * b'24:31 - reserved
  9247. * dword1~10 - cce_super_rule_param[0]:
  9248. * contains parameters used to setup RX_CCE_SUPER_RULE_0
  9249. * dword11~20 - cce_super_rule_param[1]:
  9250. * contains parameters used to setup RX_CCE_SUPER_RULE_1
  9251. *
  9252. * Each cce_super_rule_param structure would appear as follows:
  9253. * |31 24|23 16|15 8|7 0|
  9254. * |-----------------+-----------------+-----------------+-----------------|
  9255. * |src_ipv6_addr[3] |src_ipv6_addr[2] |src_ipv6_addr[1] |src_ipv6_addr[0] |
  9256. * |/src_ipv4_addr[3]|/src_ipv4_addr[2]|/src_ipv4_addr[1]|/src_ipv4_addr[0]|
  9257. * |-----------------------------------------------------------------------|
  9258. * |src_ipv6_addr[7] |src_ipv6_addr[6] |src_ipv6_addr[5] |src_ipv6_addr[4] |
  9259. * |-----------------------------------------------------------------------|
  9260. * |src_ipv6_addr[11]|src_ipv6_addr[10]|src_ipv6_addr[9] |src_ipv6_addr[8] |
  9261. * |-----------------------------------------------------------------------|
  9262. * |src_ipv6_addr[15]|src_ipv6_addr[14]|src_ipv6_addr[13]|src_ipv6_addr[12]|
  9263. * |-----------------------------------------------------------------------|
  9264. * |dst_ipv6_addr[3] |dst_ipv6_addr[2] |dst_ipv6_addr[1] |dst_ipv6_addr[0] |
  9265. * |/dst_ipv4_addr[3]|/dst_ipv4_addr[2]|/dst_ipv4_addr[1]|/dst_ipv4_addr[0]|
  9266. * |-----------------------------------------------------------------------|
  9267. * |dst_ipv6_addr[7] |dst_ipv6_addr[6] |dst_ipv6_addr[5] |dst_ipv6_addr[4] |
  9268. * |-----------------------------------------------------------------------|
  9269. * |dst_ipv6_addr[11]|dst_ipv6_addr[10]|dst_ipv6_addr[9] |dst_ipv6_addr[8] |
  9270. * |-----------------------------------------------------------------------|
  9271. * |dst_ipv6_addr[15]|dst_ipv6_addr[14]|dst_ipv6_addr[13]|dst_ipv6_addr[12]|
  9272. * |-----------------------------------------------------------------------|
  9273. * | is_valid | l4_type | l3_type |
  9274. * |-----------------------------------------------------------------------|
  9275. * | l4_dst_port | l4_src_port |
  9276. * |-----------------------------------------------------------------------|
  9277. *
  9278. * The cce_super_rule_param[0] structure is interpreted as follows:
  9279. * dword1 - b'0:7 - src_ipv6_addr[0]: b'120:127 of source ipv6 address
  9280. * (or src_ipv4_addr[0]: b'24:31 of source ipv4 address,
  9281. * in case of ipv4)
  9282. * b'8:15 - src_ipv6_addr[1]: b'112:119 of source ipv6 address
  9283. * (or src_ipv4_addr[1]: b'16:23 of source ipv4 address,
  9284. * in case of ipv4)
  9285. * b'16:23 - src_ipv6_addr[2]: b'104:111 of source ipv6 address
  9286. * (or src_ipv4_addr[2]: b'8:15 of source ipv4 address,
  9287. * in case of ipv4)
  9288. * b'24:31 - src_ipv6_addr[3]: b'96:103 of source ipv6 address
  9289. * (or src_ipv4_addr[3]: b'0:7 of source ipv4 address,
  9290. * in case of ipv4)
  9291. * dword2 - b'0:7 - src_ipv6_addr[4]: b'88:95 of source ipv6 address
  9292. * b'8:15 - src_ipv6_addr[5]: b'80:87 of source ipv6 address
  9293. * b'16:23 - src_ipv6_addr[6]: b'72:79 of source ipv6 address
  9294. * b'24:31 - src_ipv6_addr[7]: b'64:71 of source ipv6 address
  9295. * dword3 - b'0:7 - src_ipv6_addr[8]: b'56:63 of source ipv6 address
  9296. * b'8:15 - src_ipv6_addr[9]: b'48:55 of source ipv6 address
  9297. * b'16:23 - src_ipv6_addr[10]: b'40:47 of source ipv6 address
  9298. * b'24:31 - src_ipv6_addr[11]: b'32:39 of source ipv6 address
  9299. * dword4 - b'0:7 - src_ipv6_addr[12]: b'24:31 of source ipv6 address
  9300. * b'8:15 - src_ipv6_addr[13]: b'16:23 of source ipv6 address
  9301. * b'16:23 - src_ipv6_addr[14]: b'8:15 of source ipv6 address
  9302. * b'24:31 - src_ipv6_addr[15]: b'0:7 of source ipv6 address
  9303. * dword5 - b'0:7 - dst_ipv6_addr[0]: b'120:127 of destination ipv6 address
  9304. * (or dst_ipv4_addr[0]: b'24:31 of destination
  9305. * ipv4 address, in case of ipv4)
  9306. * b'8:15 - dst_ipv6_addr[1]: b'112:119 of destination ipv6 address
  9307. * (or dst_ipv4_addr[1]: b'16:23 of destination
  9308. * ipv4 address, in case of ipv4)
  9309. * b'16:23 - dst_ipv6_addr[2]: b'104:111 of destination ipv6 address
  9310. * (or dst_ipv4_addr[2]: b'8:15 of destination
  9311. * ipv4 address, in case of ipv4)
  9312. * b'24:31 - dst_ipv6_addr[3]: b'96:103 of destination ipv6 address
  9313. * (or dst_ipv4_addr[3]: b'0:7 of destination
  9314. * ipv4 address, in case of ipv4)
  9315. * dword6 - b'0:7 - dst_ipv6_addr[4]: b'88:95 of destination ipv6 address
  9316. * b'8:15 - dst_ipv6_addr[5]: b'80:87 of destination ipv6 address
  9317. * b'16:23 - dst_ipv6_addr[6]: b'72:79 of destination ipv6 address
  9318. * b'24:31 - dst_ipv6_addr[7]: b'64:71 of destination ipv6 address
  9319. * dword7 - b'0:7 - dst_ipv6_addr[8]: b'56:63 of destination ipv6 address
  9320. * b'8:15 - dst_ipv6_addr[9]: b'48:55 of destination ipv6 address
  9321. * b'16:23 - dst_ipv6_addr[10]: b'40:47 of destination ipv6 address
  9322. * b'24:31 - dst_ipv6_addr[11]: b'32:39 of destination ipv6 address
  9323. * dword8 - b'0:7 - dst_ipv6_addr[12]: b'24:31 of destination ipv6 address
  9324. * b'8:15 - dst_ipv6_addr[13]: b'16:23 of destination ipv6 address
  9325. * b'16:23 - dst_ipv6_addr[14]: b'8:15 of destination ipv6 address
  9326. * b'24:31 - dst_ipv6_addr[15]: b'0:7 of destination ipv6 address
  9327. * dword9 - b'0:15 - l3_type: type of L3 protocol, indicating L3 protocol used
  9328. * 0x0008: ipv4
  9329. * 0xdd86: ipv6
  9330. * b'16:23 - l4_type: type of L4 protocol, indicating L4 protocol used
  9331. * 6: TCP
  9332. * 17: UDP
  9333. * b'24:31 - is_valid: indicate whether this parameter is valid
  9334. * 0: invalid
  9335. * 1: valid
  9336. * dword10 - b'0:15 - l4_src_port: TCP/UDP source port field
  9337. * b'16:31 - l4_dst_port: TCP/UDP destination port field
  9338. *
  9339. * The cce_super_rule_param[1] structure is similar.
  9340. */
  9341. #define HTT_RX_CCE_SUPER_RULE_SETUP_NUM 2
  9342. enum htt_rx_cce_super_rule_setup_operation {
  9343. HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST = 0,
  9344. HTT_RX_CCE_SUPER_RULE_INSTALL,
  9345. HTT_RX_CCE_SUPER_RULE_RELEASE,
  9346. /* All operation should be before this */
  9347. HTT_RX_CCE_SUPER_RULE_SETUP_INVALID_OPERATION,
  9348. };
  9349. typedef struct {
  9350. union {
  9351. A_UINT8 src_ipv4_addr[4];
  9352. A_UINT8 src_ipv6_addr[16];
  9353. };
  9354. union {
  9355. A_UINT8 dst_ipv4_addr[4];
  9356. A_UINT8 dst_ipv6_addr[16];
  9357. };
  9358. A_UINT32 l3_type: 16,
  9359. l4_type: 8,
  9360. is_valid: 8;
  9361. A_UINT32 l4_src_port: 16,
  9362. l4_dst_port: 16;
  9363. } htt_rx_cce_super_rule_param_t;
  9364. PREPACK struct htt_rx_cce_super_rule_setup_t {
  9365. A_UINT32 msg_type: 8,
  9366. vdev_id: 8,
  9367. operation: 8,
  9368. reserved: 8;
  9369. htt_rx_cce_super_rule_param_t
  9370. cce_super_rule_param[HTT_RX_CCE_SUPER_RULE_SETUP_NUM];
  9371. } POSTPACK;
  9372. #define HTT_RX_CCE_SUPER_RULE_SETUP_SZ \
  9373. (sizeof(struct htt_rx_cce_super_rule_setup_t))
  9374. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_M 0x0000ff00
  9375. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_S 8
  9376. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_GET(_var) \
  9377. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_M) >> \
  9378. HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_S)
  9379. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_SET(_var, _val) \
  9380. do { \
  9381. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID, _val); \
  9382. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_S)); \
  9383. } while (0)
  9384. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_M 0x00ff0000
  9385. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S 16
  9386. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_GET(_var) \
  9387. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_M) >> \
  9388. HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S)
  9389. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_SET(_var, _val) \
  9390. do { \
  9391. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION, _val); \
  9392. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S)); \
  9393. } while (0)
  9394. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_M 0x0000ffff
  9395. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S 0
  9396. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_GET(_var) \
  9397. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_M) >> \
  9398. HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S)
  9399. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_SET(_var, _val) \
  9400. do { \
  9401. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE, _val); \
  9402. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S)); \
  9403. } while (0)
  9404. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_M 0x00ff0000
  9405. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S 16
  9406. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_GET(_var) \
  9407. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_M) >> \
  9408. HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S)
  9409. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_SET(_var, _val) \
  9410. do { \
  9411. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE, _val); \
  9412. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S)); \
  9413. } while (0)
  9414. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_M 0xff000000
  9415. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S 24
  9416. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_GET(_var) \
  9417. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_M) >> \
  9418. HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S)
  9419. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_SET(_var, _val) \
  9420. do { \
  9421. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID, _val); \
  9422. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S)); \
  9423. } while (0)
  9424. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_M 0x0000ffff
  9425. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S 0
  9426. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_GET(_var) \
  9427. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_M) >> \
  9428. HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S)
  9429. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_SET(_var, _val) \
  9430. do { \
  9431. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT, _val); \
  9432. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S)); \
  9433. } while (0)
  9434. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_M 0xffff0000
  9435. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S 16
  9436. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_GET(_var) \
  9437. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_M) >> \
  9438. HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S)
  9439. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_SET(_var, _val) \
  9440. do { \
  9441. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT, _val); \
  9442. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S)); \
  9443. } while (0)
  9444. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV4_ADDR_ARRAY_GET(_ptr, _array) \
  9445. do { \
  9446. A_MEMCPY(_array, _ptr, 4); \
  9447. } while (0)
  9448. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV4_ADDR_ARRAY_SET(_ptr, _array) \
  9449. do { \
  9450. A_MEMCPY(_ptr, _array, 4); \
  9451. } while (0)
  9452. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV6_ADDR_ARRAY_GET(_ptr, _array) \
  9453. do { \
  9454. A_MEMCPY(_array, _ptr, 16); \
  9455. } while (0)
  9456. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV6_ADDR_ARRAY_SET(_ptr, _array) \
  9457. do { \
  9458. A_MEMCPY(_ptr, _array, 16); \
  9459. } while (0)
  9460. /*=== target -> host messages ===============================================*/
  9461. enum htt_t2h_msg_type {
  9462. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  9463. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  9464. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  9465. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  9466. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  9467. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  9468. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  9469. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  9470. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  9471. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  9472. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  9473. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  9474. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  9475. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  9476. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  9477. /* only used for HL, add HTT MSG for HTT CREDIT update */
  9478. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  9479. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  9480. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  9481. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  9482. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  9483. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  9484. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  9485. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  9486. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  9487. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  9488. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  9489. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  9490. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  9491. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  9492. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  9493. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  9494. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  9495. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  9496. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  9497. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  9498. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  9499. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  9500. /* TX_OFFLOAD_DELIVER_IND:
  9501. * Forward the target's locally-generated packets to the host,
  9502. * to provide to the monitor mode interface.
  9503. */
  9504. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  9505. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  9506. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  9507. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  9508. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  9509. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  9510. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  9511. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  9512. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  9513. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  9514. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  9515. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  9516. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  9517. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  9518. HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN = 0x31,
  9519. HTT_T2H_MSG_TYPE_RX_DELBA_EXTN = 0x32,
  9520. HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE = 0x33,
  9521. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND = 0x34,
  9522. HTT_T2H_MSG_TYPE_TEST,
  9523. /* keep this last */
  9524. HTT_T2H_NUM_MSGS
  9525. };
  9526. /*
  9527. * HTT target to host message type -
  9528. * stored in bits 7:0 of the first word of the message
  9529. */
  9530. #define HTT_T2H_MSG_TYPE_M 0xff
  9531. #define HTT_T2H_MSG_TYPE_S 0
  9532. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  9533. do { \
  9534. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  9535. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  9536. } while (0)
  9537. #define HTT_T2H_MSG_TYPE_GET(word) \
  9538. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  9539. /**
  9540. * @brief target -> host version number confirmation message definition
  9541. *
  9542. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  9543. *
  9544. * |31 24|23 16|15 8|7 0|
  9545. * |----------------+----------------+----------------+----------------|
  9546. * | reserved | major number | minor number | msg type |
  9547. * |-------------------------------------------------------------------|
  9548. * : option request TLV (optional) |
  9549. * :...................................................................:
  9550. *
  9551. * The VER_CONF message may consist of a single 4-byte word, or may be
  9552. * extended with TLVs that specify HTT options selected by the target.
  9553. * The following option TLVs may be appended to the VER_CONF message:
  9554. * - LL_BUS_ADDR_SIZE
  9555. * - HL_SUPPRESS_TX_COMPL_IND
  9556. * - MAX_TX_QUEUE_GROUPS
  9557. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  9558. * may be appended to the VER_CONF message (but only one TLV of each type).
  9559. *
  9560. * Header fields:
  9561. * - MSG_TYPE
  9562. * Bits 7:0
  9563. * Purpose: identifies this as a version number confirmation message
  9564. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  9565. * - VER_MINOR
  9566. * Bits 15:8
  9567. * Purpose: Specify the minor number of the HTT message library version
  9568. * in use by the target firmware.
  9569. * The minor number specifies the specific revision within a range
  9570. * of fundamentally compatible HTT message definition revisions.
  9571. * Compatible revisions involve adding new messages or perhaps
  9572. * adding new fields to existing messages, in a backwards-compatible
  9573. * manner.
  9574. * Incompatible revisions involve changing the message type values,
  9575. * or redefining existing messages.
  9576. * Value: minor number
  9577. * - VER_MAJOR
  9578. * Bits 15:8
  9579. * Purpose: Specify the major number of the HTT message library version
  9580. * in use by the target firmware.
  9581. * The major number specifies the family of minor revisions that are
  9582. * fundamentally compatible with each other, but not with prior or
  9583. * later families.
  9584. * Value: major number
  9585. */
  9586. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  9587. #define HTT_VER_CONF_MINOR_S 8
  9588. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  9589. #define HTT_VER_CONF_MAJOR_S 16
  9590. #define HTT_VER_CONF_MINOR_SET(word, value) \
  9591. do { \
  9592. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  9593. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  9594. } while (0)
  9595. #define HTT_VER_CONF_MINOR_GET(word) \
  9596. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  9597. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  9598. do { \
  9599. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  9600. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  9601. } while (0)
  9602. #define HTT_VER_CONF_MAJOR_GET(word) \
  9603. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  9604. #define HTT_VER_CONF_BYTES 4
  9605. /**
  9606. * @brief - target -> host HTT Rx In order indication message
  9607. *
  9608. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  9609. *
  9610. * @details
  9611. *
  9612. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  9613. * |----------------+-------------------+---------------------+---------------|
  9614. * | peer ID | P| F| O| ext TID | msg type |
  9615. * |--------------------------------------------------------------------------|
  9616. * | MSDU count | Reserved | vdev id |
  9617. * |--------------------------------------------------------------------------|
  9618. * | MSDU 0 bus address (bits 31:0) |
  9619. #if HTT_PADDR64
  9620. * | MSDU 0 bus address (bits 63:32) |
  9621. #endif
  9622. * |--------------------------------------------------------------------------|
  9623. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  9624. * |--------------------------------------------------------------------------|
  9625. * | MSDU 1 bus address (bits 31:0) |
  9626. #if HTT_PADDR64
  9627. * | MSDU 1 bus address (bits 63:32) |
  9628. #endif
  9629. * |--------------------------------------------------------------------------|
  9630. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  9631. * |--------------------------------------------------------------------------|
  9632. */
  9633. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  9634. *
  9635. * @details
  9636. * bits
  9637. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  9638. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9639. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  9640. * | | frag | | | | fail |chksum fail|
  9641. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9642. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  9643. */
  9644. struct htt_rx_in_ord_paddr_ind_hdr_t
  9645. {
  9646. A_UINT32 /* word 0 */
  9647. msg_type: 8,
  9648. ext_tid: 5,
  9649. offload: 1,
  9650. frag: 1,
  9651. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  9652. peer_id: 16;
  9653. A_UINT32 /* word 1 */
  9654. vap_id: 8,
  9655. /* NOTE:
  9656. * This reserved_1 field is not truly reserved - certain targets use
  9657. * this field internally to store debug information, and do not zero
  9658. * out the contents of the field before uploading the message to the
  9659. * host. Thus, any host-target communication supported by this field
  9660. * is limited to using values that are never used by the debug
  9661. * information stored by certain targets in the reserved_1 field.
  9662. * In particular, the targets in question don't use the value 0x3
  9663. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  9664. * so this previously-unused value within these bits is available to
  9665. * use as the host / target PKT_CAPTURE_MODE flag.
  9666. */
  9667. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  9668. /* if pkt_capture_mode == 0x3, host should
  9669. * send rx frames to monitor mode interface
  9670. */
  9671. msdu_cnt: 16;
  9672. };
  9673. struct htt_rx_in_ord_paddr_ind_msdu32_t
  9674. {
  9675. A_UINT32 dma_addr;
  9676. A_UINT32
  9677. length: 16,
  9678. fw_desc: 8,
  9679. msdu_info:8;
  9680. };
  9681. struct htt_rx_in_ord_paddr_ind_msdu64_t
  9682. {
  9683. A_UINT32 dma_addr_lo;
  9684. A_UINT32 dma_addr_hi;
  9685. A_UINT32
  9686. length: 16,
  9687. fw_desc: 8,
  9688. msdu_info:8;
  9689. };
  9690. #if HTT_PADDR64
  9691. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  9692. #else
  9693. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  9694. #endif
  9695. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  9696. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  9697. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  9698. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  9699. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  9700. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  9701. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  9702. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  9703. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  9704. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  9705. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  9706. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  9707. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  9708. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  9709. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  9710. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  9711. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  9712. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  9713. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  9714. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  9715. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  9716. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  9717. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  9718. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  9719. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  9720. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  9721. /* for systems using 64-bit format for bus addresses */
  9722. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  9723. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  9724. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  9725. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  9726. /* for systems using 32-bit format for bus addresses */
  9727. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  9728. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  9729. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  9730. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  9731. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  9732. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  9733. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  9734. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  9735. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  9736. do { \
  9737. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  9738. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  9739. } while (0)
  9740. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  9741. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  9742. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  9743. do { \
  9744. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  9745. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  9746. } while (0)
  9747. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  9748. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  9749. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  9750. do { \
  9751. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  9752. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  9753. } while (0)
  9754. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  9755. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  9756. /*
  9757. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  9758. * deliver the rx frames to the monitor mode interface.
  9759. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  9760. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  9761. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  9762. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  9763. */
  9764. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  9765. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  9766. do { \
  9767. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  9768. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  9769. } while (0)
  9770. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  9771. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  9772. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  9773. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  9774. do { \
  9775. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  9776. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  9777. } while (0)
  9778. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  9779. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  9780. /* for systems using 64-bit format for bus addresses */
  9781. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  9782. do { \
  9783. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  9784. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  9785. } while (0)
  9786. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  9787. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  9788. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  9789. do { \
  9790. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  9791. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  9792. } while (0)
  9793. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  9794. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  9795. /* for systems using 32-bit format for bus addresses */
  9796. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  9797. do { \
  9798. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  9799. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  9800. } while (0)
  9801. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  9802. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  9803. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  9804. do { \
  9805. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  9806. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  9807. } while (0)
  9808. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  9809. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  9810. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  9811. do { \
  9812. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  9813. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  9814. } while (0)
  9815. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  9816. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  9817. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  9818. do { \
  9819. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  9820. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  9821. } while (0)
  9822. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  9823. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  9824. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  9825. do { \
  9826. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  9827. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  9828. } while (0)
  9829. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  9830. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  9831. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  9832. do { \
  9833. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  9834. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  9835. } while (0)
  9836. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  9837. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  9838. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  9839. do { \
  9840. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  9841. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  9842. } while (0)
  9843. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  9844. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  9845. /* definitions used within target -> host rx indication message */
  9846. PREPACK struct htt_rx_ind_hdr_prefix_t
  9847. {
  9848. A_UINT32 /* word 0 */
  9849. msg_type: 8,
  9850. ext_tid: 5,
  9851. release_valid: 1,
  9852. flush_valid: 1,
  9853. reserved0: 1,
  9854. peer_id: 16;
  9855. A_UINT32 /* word 1 */
  9856. flush_start_seq_num: 6,
  9857. flush_end_seq_num: 6,
  9858. release_start_seq_num: 6,
  9859. release_end_seq_num: 6,
  9860. num_mpdu_ranges: 8;
  9861. } POSTPACK;
  9862. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  9863. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  9864. #define HTT_TGT_RSSI_INVALID 0x80
  9865. PREPACK struct htt_rx_ppdu_desc_t
  9866. {
  9867. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  9868. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  9869. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  9870. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  9871. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  9872. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  9873. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  9874. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  9875. A_UINT32 /* word 0 */
  9876. rssi_cmb: 8,
  9877. timestamp_submicrosec: 8,
  9878. phy_err_code: 8,
  9879. phy_err: 1,
  9880. legacy_rate: 4,
  9881. legacy_rate_sel: 1,
  9882. end_valid: 1,
  9883. start_valid: 1;
  9884. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  9885. union {
  9886. A_UINT32 /* word 1 */
  9887. rssi0_pri20: 8,
  9888. rssi0_ext20: 8,
  9889. rssi0_ext40: 8,
  9890. rssi0_ext80: 8;
  9891. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  9892. } u0;
  9893. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  9894. union {
  9895. A_UINT32 /* word 2 */
  9896. rssi1_pri20: 8,
  9897. rssi1_ext20: 8,
  9898. rssi1_ext40: 8,
  9899. rssi1_ext80: 8;
  9900. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  9901. } u1;
  9902. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  9903. union {
  9904. A_UINT32 /* word 3 */
  9905. rssi2_pri20: 8,
  9906. rssi2_ext20: 8,
  9907. rssi2_ext40: 8,
  9908. rssi2_ext80: 8;
  9909. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  9910. } u2;
  9911. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  9912. union {
  9913. A_UINT32 /* word 4 */
  9914. rssi3_pri20: 8,
  9915. rssi3_ext20: 8,
  9916. rssi3_ext40: 8,
  9917. rssi3_ext80: 8;
  9918. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  9919. } u3;
  9920. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  9921. A_UINT32 tsf32; /* word 5 */
  9922. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  9923. A_UINT32 timestamp_microsec; /* word 6 */
  9924. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  9925. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  9926. A_UINT32 /* word 7 */
  9927. vht_sig_a1: 24,
  9928. preamble_type: 8;
  9929. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  9930. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  9931. A_UINT32 /* word 8 */
  9932. vht_sig_a2: 24,
  9933. /* sa_ant_matrix
  9934. * For cases where a single rx chain has options to be connected to
  9935. * different rx antennas, show which rx antennas were in use during
  9936. * receipt of a given PPDU.
  9937. * This sa_ant_matrix provides a bitmask of the antennas used while
  9938. * receiving this frame.
  9939. */
  9940. sa_ant_matrix: 8;
  9941. } POSTPACK;
  9942. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  9943. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  9944. PREPACK struct htt_rx_ind_hdr_suffix_t
  9945. {
  9946. A_UINT32 /* word 0 */
  9947. fw_rx_desc_bytes: 16,
  9948. reserved0: 16;
  9949. } POSTPACK;
  9950. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  9951. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  9952. PREPACK struct htt_rx_ind_hdr_t
  9953. {
  9954. struct htt_rx_ind_hdr_prefix_t prefix;
  9955. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  9956. struct htt_rx_ind_hdr_suffix_t suffix;
  9957. } POSTPACK;
  9958. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  9959. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  9960. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  9961. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9962. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9963. /*
  9964. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9965. * the offset into the HTT rx indication message at which the
  9966. * FW rx PPDU descriptor resides
  9967. */
  9968. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9969. /*
  9970. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9971. * the offset into the HTT rx indication message at which the
  9972. * header suffix (FW rx MSDU byte count) resides
  9973. */
  9974. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9975. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9976. /*
  9977. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9978. * the offset into the HTT rx indication message at which the per-MSDU
  9979. * information starts
  9980. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9981. * per-MSDU information portion of the message. The per-MSDU info itself
  9982. * starts at byte 12.
  9983. */
  9984. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9985. /**
  9986. * @brief target -> host rx indication message definition
  9987. *
  9988. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9989. *
  9990. * @details
  9991. * The following field definitions describe the format of the rx indication
  9992. * message sent from the target to the host.
  9993. * The message consists of three major sections:
  9994. * 1. a fixed-length header
  9995. * 2. a variable-length list of firmware rx MSDU descriptors
  9996. * 3. one or more 4-octet MPDU range information elements
  9997. * The fixed length header itself has two sub-sections
  9998. * 1. the message meta-information, including identification of the
  9999. * sender and type of the received data, and a 4-octet flush/release IE
  10000. * 2. the firmware rx PPDU descriptor
  10001. *
  10002. * The format of the message is depicted below.
  10003. * in this depiction, the following abbreviations are used for information
  10004. * elements within the message:
  10005. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  10006. * elements associated with the PPDU start are valid.
  10007. * Specifically, the following fields are valid only if SV is set:
  10008. * RSSI (all variants), L, legacy rate, preamble type, service,
  10009. * VHT-SIG-A
  10010. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  10011. * elements associated with the PPDU end are valid.
  10012. * Specifically, the following fields are valid only if EV is set:
  10013. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  10014. * - L - Legacy rate selector - if legacy rates are used, this flag
  10015. * indicates whether the rate is from a CCK (L == 1) or OFDM
  10016. * (L == 0) PHY.
  10017. * - P - PHY error flag - boolean indication of whether the rx frame had
  10018. * a PHY error
  10019. *
  10020. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  10021. * |----------------+-------------------+---------------------+---------------|
  10022. * | peer ID | |RV|FV| ext TID | msg type |
  10023. * |--------------------------------------------------------------------------|
  10024. * | num | release | release | flush | flush |
  10025. * | MPDU | end | start | end | start |
  10026. * | ranges | seq num | seq num | seq num | seq num |
  10027. * |==========================================================================|
  10028. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  10029. * |V|V| | rate | | | timestamp | RSSI |
  10030. * |--------------------------------------------------------------------------|
  10031. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  10032. * |--------------------------------------------------------------------------|
  10033. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  10034. * |--------------------------------------------------------------------------|
  10035. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  10036. * |--------------------------------------------------------------------------|
  10037. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  10038. * |--------------------------------------------------------------------------|
  10039. * | TSF LSBs |
  10040. * |--------------------------------------------------------------------------|
  10041. * | microsec timestamp |
  10042. * |--------------------------------------------------------------------------|
  10043. * | preamble type | HT-SIG / VHT-SIG-A1 |
  10044. * |--------------------------------------------------------------------------|
  10045. * | service | HT-SIG / VHT-SIG-A2 |
  10046. * |==========================================================================|
  10047. * | reserved | FW rx desc bytes |
  10048. * |--------------------------------------------------------------------------|
  10049. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  10050. * | desc B3 | desc B2 | desc B1 | desc B0 |
  10051. * |--------------------------------------------------------------------------|
  10052. * : : :
  10053. * |--------------------------------------------------------------------------|
  10054. * | alignment | MSDU Rx |
  10055. * | padding | desc Bn |
  10056. * |--------------------------------------------------------------------------|
  10057. * | reserved | MPDU range status | MPDU count |
  10058. * |--------------------------------------------------------------------------|
  10059. * : reserved : MPDU range status : MPDU count :
  10060. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  10061. *
  10062. * Header fields:
  10063. * - MSG_TYPE
  10064. * Bits 7:0
  10065. * Purpose: identifies this as an rx indication message
  10066. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  10067. * - EXT_TID
  10068. * Bits 12:8
  10069. * Purpose: identify the traffic ID of the rx data, including
  10070. * special "extended" TID values for multicast, broadcast, and
  10071. * non-QoS data frames
  10072. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  10073. * - FLUSH_VALID (FV)
  10074. * Bit 13
  10075. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  10076. * is valid
  10077. * Value:
  10078. * 1 -> flush IE is valid and needs to be processed
  10079. * 0 -> flush IE is not valid and should be ignored
  10080. * - REL_VALID (RV)
  10081. * Bit 13
  10082. * Purpose: indicate whether the release IE (start/end sequence numbers)
  10083. * is valid
  10084. * Value:
  10085. * 1 -> release IE is valid and needs to be processed
  10086. * 0 -> release IE is not valid and should be ignored
  10087. * - PEER_ID
  10088. * Bits 31:16
  10089. * Purpose: Identify, by ID, which peer sent the rx data
  10090. * Value: ID of the peer who sent the rx data
  10091. * - FLUSH_SEQ_NUM_START
  10092. * Bits 5:0
  10093. * Purpose: Indicate the start of a series of MPDUs to flush
  10094. * Not all MPDUs within this series are necessarily valid - the host
  10095. * must check each sequence number within this range to see if the
  10096. * corresponding MPDU is actually present.
  10097. * This field is only valid if the FV bit is set.
  10098. * Value:
  10099. * The sequence number for the first MPDUs to check to flush.
  10100. * The sequence number is masked by 0x3f.
  10101. * - FLUSH_SEQ_NUM_END
  10102. * Bits 11:6
  10103. * Purpose: Indicate the end of a series of MPDUs to flush
  10104. * Value:
  10105. * The sequence number one larger than the sequence number of the
  10106. * last MPDU to check to flush.
  10107. * The sequence number is masked by 0x3f.
  10108. * Not all MPDUs within this series are necessarily valid - the host
  10109. * must check each sequence number within this range to see if the
  10110. * corresponding MPDU is actually present.
  10111. * This field is only valid if the FV bit is set.
  10112. * - REL_SEQ_NUM_START
  10113. * Bits 17:12
  10114. * Purpose: Indicate the start of a series of MPDUs to release.
  10115. * All MPDUs within this series are present and valid - the host
  10116. * need not check each sequence number within this range to see if
  10117. * the corresponding MPDU is actually present.
  10118. * This field is only valid if the RV bit is set.
  10119. * Value:
  10120. * The sequence number for the first MPDUs to check to release.
  10121. * The sequence number is masked by 0x3f.
  10122. * - REL_SEQ_NUM_END
  10123. * Bits 23:18
  10124. * Purpose: Indicate the end of a series of MPDUs to release.
  10125. * Value:
  10126. * The sequence number one larger than the sequence number of the
  10127. * last MPDU to check to release.
  10128. * The sequence number is masked by 0x3f.
  10129. * All MPDUs within this series are present and valid - the host
  10130. * need not check each sequence number within this range to see if
  10131. * the corresponding MPDU is actually present.
  10132. * This field is only valid if the RV bit is set.
  10133. * - NUM_MPDU_RANGES
  10134. * Bits 31:24
  10135. * Purpose: Indicate how many ranges of MPDUs are present.
  10136. * Each MPDU range consists of a series of contiguous MPDUs within the
  10137. * rx frame sequence which all have the same MPDU status.
  10138. * Value: 1-63 (typically a small number, like 1-3)
  10139. *
  10140. * Rx PPDU descriptor fields:
  10141. * - RSSI_CMB
  10142. * Bits 7:0
  10143. * Purpose: Combined RSSI from all active rx chains, across the active
  10144. * bandwidth.
  10145. * Value: RSSI dB units w.r.t. noise floor
  10146. * - TIMESTAMP_SUBMICROSEC
  10147. * Bits 15:8
  10148. * Purpose: high-resolution timestamp
  10149. * Value:
  10150. * Sub-microsecond time of PPDU reception.
  10151. * This timestamp ranges from [0,MAC clock MHz).
  10152. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  10153. * to form a high-resolution, large range rx timestamp.
  10154. * - PHY_ERR_CODE
  10155. * Bits 23:16
  10156. * Purpose:
  10157. * If the rx frame processing resulted in a PHY error, indicate what
  10158. * type of rx PHY error occurred.
  10159. * Value:
  10160. * This field is valid if the "P" (PHY_ERR) flag is set.
  10161. * TBD: document/specify the values for this field
  10162. * - PHY_ERR
  10163. * Bit 24
  10164. * Purpose: indicate whether the rx PPDU had a PHY error
  10165. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  10166. * - LEGACY_RATE
  10167. * Bits 28:25
  10168. * Purpose:
  10169. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  10170. * specify which rate was used.
  10171. * Value:
  10172. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  10173. * flag.
  10174. * If LEGACY_RATE_SEL is 0:
  10175. * 0x8: OFDM 48 Mbps
  10176. * 0x9: OFDM 24 Mbps
  10177. * 0xA: OFDM 12 Mbps
  10178. * 0xB: OFDM 6 Mbps
  10179. * 0xC: OFDM 54 Mbps
  10180. * 0xD: OFDM 36 Mbps
  10181. * 0xE: OFDM 18 Mbps
  10182. * 0xF: OFDM 9 Mbps
  10183. * If LEGACY_RATE_SEL is 1:
  10184. * 0x8: CCK 11 Mbps long preamble
  10185. * 0x9: CCK 5.5 Mbps long preamble
  10186. * 0xA: CCK 2 Mbps long preamble
  10187. * 0xB: CCK 1 Mbps long preamble
  10188. * 0xC: CCK 11 Mbps short preamble
  10189. * 0xD: CCK 5.5 Mbps short preamble
  10190. * 0xE: CCK 2 Mbps short preamble
  10191. * - LEGACY_RATE_SEL
  10192. * Bit 29
  10193. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  10194. * Value:
  10195. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  10196. * used a legacy rate.
  10197. * 0 -> OFDM, 1 -> CCK
  10198. * - END_VALID
  10199. * Bit 30
  10200. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  10201. * the start of the PPDU are valid. Specifically, the following
  10202. * fields are only valid if END_VALID is set:
  10203. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  10204. * TIMESTAMP_SUBMICROSEC
  10205. * Value:
  10206. * 0 -> rx PPDU desc end fields are not valid
  10207. * 1 -> rx PPDU desc end fields are valid
  10208. * - START_VALID
  10209. * Bit 31
  10210. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  10211. * the end of the PPDU are valid. Specifically, the following
  10212. * fields are only valid if START_VALID is set:
  10213. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  10214. * VHT-SIG-A
  10215. * Value:
  10216. * 0 -> rx PPDU desc start fields are not valid
  10217. * 1 -> rx PPDU desc start fields are valid
  10218. * - RSSI0_PRI20
  10219. * Bits 7:0
  10220. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  10221. * Value: RSSI dB units w.r.t. noise floor
  10222. *
  10223. * - RSSI0_EXT20
  10224. * Bits 7:0
  10225. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  10226. * (if the rx bandwidth was >= 40 MHz)
  10227. * Value: RSSI dB units w.r.t. noise floor
  10228. * - RSSI0_EXT40
  10229. * Bits 7:0
  10230. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  10231. * (if the rx bandwidth was >= 80 MHz)
  10232. * Value: RSSI dB units w.r.t. noise floor
  10233. * - RSSI0_EXT80
  10234. * Bits 7:0
  10235. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  10236. * (if the rx bandwidth was >= 160 MHz)
  10237. * Value: RSSI dB units w.r.t. noise floor
  10238. *
  10239. * - RSSI1_PRI20
  10240. * Bits 7:0
  10241. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  10242. * Value: RSSI dB units w.r.t. noise floor
  10243. * - RSSI1_EXT20
  10244. * Bits 7:0
  10245. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  10246. * (if the rx bandwidth was >= 40 MHz)
  10247. * Value: RSSI dB units w.r.t. noise floor
  10248. * - RSSI1_EXT40
  10249. * Bits 7:0
  10250. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  10251. * (if the rx bandwidth was >= 80 MHz)
  10252. * Value: RSSI dB units w.r.t. noise floor
  10253. * - RSSI1_EXT80
  10254. * Bits 7:0
  10255. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  10256. * (if the rx bandwidth was >= 160 MHz)
  10257. * Value: RSSI dB units w.r.t. noise floor
  10258. *
  10259. * - RSSI2_PRI20
  10260. * Bits 7:0
  10261. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  10262. * Value: RSSI dB units w.r.t. noise floor
  10263. * - RSSI2_EXT20
  10264. * Bits 7:0
  10265. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  10266. * (if the rx bandwidth was >= 40 MHz)
  10267. * Value: RSSI dB units w.r.t. noise floor
  10268. * - RSSI2_EXT40
  10269. * Bits 7:0
  10270. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  10271. * (if the rx bandwidth was >= 80 MHz)
  10272. * Value: RSSI dB units w.r.t. noise floor
  10273. * - RSSI2_EXT80
  10274. * Bits 7:0
  10275. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  10276. * (if the rx bandwidth was >= 160 MHz)
  10277. * Value: RSSI dB units w.r.t. noise floor
  10278. *
  10279. * - RSSI3_PRI20
  10280. * Bits 7:0
  10281. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  10282. * Value: RSSI dB units w.r.t. noise floor
  10283. * - RSSI3_EXT20
  10284. * Bits 7:0
  10285. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  10286. * (if the rx bandwidth was >= 40 MHz)
  10287. * Value: RSSI dB units w.r.t. noise floor
  10288. * - RSSI3_EXT40
  10289. * Bits 7:0
  10290. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  10291. * (if the rx bandwidth was >= 80 MHz)
  10292. * Value: RSSI dB units w.r.t. noise floor
  10293. * - RSSI3_EXT80
  10294. * Bits 7:0
  10295. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  10296. * (if the rx bandwidth was >= 160 MHz)
  10297. * Value: RSSI dB units w.r.t. noise floor
  10298. *
  10299. * - TSF32
  10300. * Bits 31:0
  10301. * Purpose: specify the time the rx PPDU was received, in TSF units
  10302. * Value: 32 LSBs of the TSF
  10303. * - TIMESTAMP_MICROSEC
  10304. * Bits 31:0
  10305. * Purpose: specify the time the rx PPDU was received, in microsecond units
  10306. * Value: PPDU rx time, in microseconds
  10307. * - VHT_SIG_A1
  10308. * Bits 23:0
  10309. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  10310. * from the rx PPDU
  10311. * Value:
  10312. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10313. * VHT-SIG-A1 data.
  10314. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10315. * first 24 bits of the HT-SIG data.
  10316. * Otherwise, this field is invalid.
  10317. * Refer to the the 802.11 protocol for the definition of the
  10318. * HT-SIG and VHT-SIG-A1 fields
  10319. * - VHT_SIG_A2
  10320. * Bits 23:0
  10321. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  10322. * from the rx PPDU
  10323. * Value:
  10324. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10325. * VHT-SIG-A2 data.
  10326. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10327. * last 24 bits of the HT-SIG data.
  10328. * Otherwise, this field is invalid.
  10329. * Refer to the the 802.11 protocol for the definition of the
  10330. * HT-SIG and VHT-SIG-A2 fields
  10331. * - PREAMBLE_TYPE
  10332. * Bits 31:24
  10333. * Purpose: indicate the PHY format of the received burst
  10334. * Value:
  10335. * 0x4: Legacy (OFDM/CCK)
  10336. * 0x8: HT
  10337. * 0x9: HT with TxBF
  10338. * 0xC: VHT
  10339. * 0xD: VHT with TxBF
  10340. * - SERVICE
  10341. * Bits 31:24
  10342. * Purpose: TBD
  10343. * Value: TBD
  10344. *
  10345. * Rx MSDU descriptor fields:
  10346. * - FW_RX_DESC_BYTES
  10347. * Bits 15:0
  10348. * Purpose: Indicate how many bytes in the Rx indication are used for
  10349. * FW Rx descriptors
  10350. *
  10351. * Payload fields:
  10352. * - MPDU_COUNT
  10353. * Bits 7:0
  10354. * Purpose: Indicate how many sequential MPDUs share the same status.
  10355. * All MPDUs within the indicated list are from the same RA-TA-TID.
  10356. * - MPDU_STATUS
  10357. * Bits 15:8
  10358. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  10359. * received successfully.
  10360. * Value:
  10361. * 0x1: success
  10362. * 0x2: FCS error
  10363. * 0x3: duplicate error
  10364. * 0x4: replay error
  10365. * 0x5: invalid peer
  10366. */
  10367. /* header fields */
  10368. #define HTT_RX_IND_EXT_TID_M 0x1f00
  10369. #define HTT_RX_IND_EXT_TID_S 8
  10370. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  10371. #define HTT_RX_IND_FLUSH_VALID_S 13
  10372. #define HTT_RX_IND_REL_VALID_M 0x4000
  10373. #define HTT_RX_IND_REL_VALID_S 14
  10374. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  10375. #define HTT_RX_IND_PEER_ID_S 16
  10376. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  10377. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  10378. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  10379. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  10380. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  10381. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  10382. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  10383. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  10384. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  10385. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  10386. /* rx PPDU descriptor fields */
  10387. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  10388. #define HTT_RX_IND_RSSI_CMB_S 0
  10389. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  10390. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  10391. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  10392. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  10393. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  10394. #define HTT_RX_IND_PHY_ERR_S 24
  10395. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  10396. #define HTT_RX_IND_LEGACY_RATE_S 25
  10397. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  10398. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  10399. #define HTT_RX_IND_END_VALID_M 0x40000000
  10400. #define HTT_RX_IND_END_VALID_S 30
  10401. #define HTT_RX_IND_START_VALID_M 0x80000000
  10402. #define HTT_RX_IND_START_VALID_S 31
  10403. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  10404. #define HTT_RX_IND_RSSI_PRI20_S 0
  10405. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  10406. #define HTT_RX_IND_RSSI_EXT20_S 8
  10407. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  10408. #define HTT_RX_IND_RSSI_EXT40_S 16
  10409. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  10410. #define HTT_RX_IND_RSSI_EXT80_S 24
  10411. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  10412. #define HTT_RX_IND_VHT_SIG_A1_S 0
  10413. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  10414. #define HTT_RX_IND_VHT_SIG_A2_S 0
  10415. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  10416. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  10417. #define HTT_RX_IND_SERVICE_M 0xff000000
  10418. #define HTT_RX_IND_SERVICE_S 24
  10419. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  10420. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  10421. /* rx MSDU descriptor fields */
  10422. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  10423. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  10424. /* payload fields */
  10425. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  10426. #define HTT_RX_IND_MPDU_COUNT_S 0
  10427. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  10428. #define HTT_RX_IND_MPDU_STATUS_S 8
  10429. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  10430. do { \
  10431. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  10432. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  10433. } while (0)
  10434. #define HTT_RX_IND_EXT_TID_GET(word) \
  10435. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  10436. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  10437. do { \
  10438. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  10439. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  10440. } while (0)
  10441. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  10442. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  10443. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  10444. do { \
  10445. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  10446. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  10447. } while (0)
  10448. #define HTT_RX_IND_REL_VALID_GET(word) \
  10449. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  10450. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  10451. do { \
  10452. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  10453. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  10454. } while (0)
  10455. #define HTT_RX_IND_PEER_ID_GET(word) \
  10456. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  10457. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  10458. do { \
  10459. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  10460. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  10461. } while (0)
  10462. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  10463. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  10464. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  10465. do { \
  10466. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  10467. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  10468. } while (0)
  10469. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  10470. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  10471. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  10472. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  10473. do { \
  10474. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  10475. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  10476. } while (0)
  10477. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  10478. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  10479. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  10480. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  10481. do { \
  10482. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  10483. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  10484. } while (0)
  10485. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  10486. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  10487. HTT_RX_IND_REL_SEQ_NUM_START_S)
  10488. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  10489. do { \
  10490. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  10491. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  10492. } while (0)
  10493. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  10494. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  10495. HTT_RX_IND_REL_SEQ_NUM_END_S)
  10496. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  10497. do { \
  10498. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  10499. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  10500. } while (0)
  10501. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  10502. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  10503. HTT_RX_IND_NUM_MPDU_RANGES_S)
  10504. /* FW rx PPDU descriptor fields */
  10505. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  10506. do { \
  10507. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  10508. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  10509. } while (0)
  10510. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  10511. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  10512. HTT_RX_IND_RSSI_CMB_S)
  10513. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  10514. do { \
  10515. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  10516. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  10517. } while (0)
  10518. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  10519. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  10520. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  10521. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  10522. do { \
  10523. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  10524. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  10525. } while (0)
  10526. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  10527. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  10528. HTT_RX_IND_PHY_ERR_CODE_S)
  10529. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  10530. do { \
  10531. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  10532. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  10533. } while (0)
  10534. #define HTT_RX_IND_PHY_ERR_GET(word) \
  10535. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  10536. HTT_RX_IND_PHY_ERR_S)
  10537. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  10538. do { \
  10539. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  10540. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  10541. } while (0)
  10542. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  10543. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  10544. HTT_RX_IND_LEGACY_RATE_S)
  10545. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  10546. do { \
  10547. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  10548. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  10549. } while (0)
  10550. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  10551. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  10552. HTT_RX_IND_LEGACY_RATE_SEL_S)
  10553. #define HTT_RX_IND_END_VALID_SET(word, value) \
  10554. do { \
  10555. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  10556. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  10557. } while (0)
  10558. #define HTT_RX_IND_END_VALID_GET(word) \
  10559. (((word) & HTT_RX_IND_END_VALID_M) >> \
  10560. HTT_RX_IND_END_VALID_S)
  10561. #define HTT_RX_IND_START_VALID_SET(word, value) \
  10562. do { \
  10563. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  10564. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  10565. } while (0)
  10566. #define HTT_RX_IND_START_VALID_GET(word) \
  10567. (((word) & HTT_RX_IND_START_VALID_M) >> \
  10568. HTT_RX_IND_START_VALID_S)
  10569. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  10570. do { \
  10571. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  10572. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  10573. } while (0)
  10574. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  10575. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  10576. HTT_RX_IND_RSSI_PRI20_S)
  10577. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  10578. do { \
  10579. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  10580. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  10581. } while (0)
  10582. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  10583. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  10584. HTT_RX_IND_RSSI_EXT20_S)
  10585. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  10586. do { \
  10587. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  10588. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  10589. } while (0)
  10590. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  10591. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  10592. HTT_RX_IND_RSSI_EXT40_S)
  10593. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  10594. do { \
  10595. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  10596. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  10597. } while (0)
  10598. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  10599. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  10600. HTT_RX_IND_RSSI_EXT80_S)
  10601. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  10602. do { \
  10603. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  10604. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  10605. } while (0)
  10606. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  10607. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  10608. HTT_RX_IND_VHT_SIG_A1_S)
  10609. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  10610. do { \
  10611. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  10612. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  10613. } while (0)
  10614. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  10615. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  10616. HTT_RX_IND_VHT_SIG_A2_S)
  10617. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  10618. do { \
  10619. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  10620. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  10621. } while (0)
  10622. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  10623. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  10624. HTT_RX_IND_PREAMBLE_TYPE_S)
  10625. #define HTT_RX_IND_SERVICE_SET(word, value) \
  10626. do { \
  10627. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  10628. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  10629. } while (0)
  10630. #define HTT_RX_IND_SERVICE_GET(word) \
  10631. (((word) & HTT_RX_IND_SERVICE_M) >> \
  10632. HTT_RX_IND_SERVICE_S)
  10633. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  10634. do { \
  10635. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  10636. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  10637. } while (0)
  10638. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  10639. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  10640. HTT_RX_IND_SA_ANT_MATRIX_S)
  10641. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  10642. do { \
  10643. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  10644. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  10645. } while (0)
  10646. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  10647. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  10648. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  10649. do { \
  10650. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  10651. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  10652. } while (0)
  10653. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  10654. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  10655. #define HTT_RX_IND_HL_BYTES \
  10656. (HTT_RX_IND_HDR_BYTES + \
  10657. 4 /* single FW rx MSDU descriptor */ + \
  10658. 4 /* single MPDU range information element */)
  10659. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  10660. /* Could we use one macro entry? */
  10661. #define HTT_WORD_SET(word, field, value) \
  10662. do { \
  10663. HTT_CHECK_SET_VAL(field, value); \
  10664. (word) |= ((value) << field ## _S); \
  10665. } while (0)
  10666. #define HTT_WORD_GET(word, field) \
  10667. (((word) & field ## _M) >> field ## _S)
  10668. PREPACK struct hl_htt_rx_ind_base {
  10669. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  10670. } POSTPACK;
  10671. /*
  10672. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  10673. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  10674. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  10675. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  10676. * htt_rx_ind_hl_rx_desc_t.
  10677. */
  10678. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  10679. struct htt_rx_ind_hl_rx_desc_t {
  10680. A_UINT8 ver;
  10681. A_UINT8 len;
  10682. struct {
  10683. A_UINT8
  10684. first_msdu: 1,
  10685. last_msdu: 1,
  10686. c3_failed: 1,
  10687. c4_failed: 1,
  10688. ipv6: 1,
  10689. tcp: 1,
  10690. udp: 1,
  10691. reserved: 1;
  10692. } flags;
  10693. /* NOTE: no reserved space - don't append any new fields here */
  10694. };
  10695. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  10696. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10697. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  10698. #define HTT_RX_IND_HL_RX_DESC_VER 0
  10699. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  10700. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10701. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  10702. #define HTT_RX_IND_HL_FLAG_OFFSET \
  10703. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10704. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  10705. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  10706. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  10707. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  10708. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  10709. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  10710. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  10711. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  10712. /* This structure is used in HL, the basic descriptor information
  10713. * used by host. the structure is translated by FW from HW desc
  10714. * or generated by FW. But in HL monitor mode, the host would use
  10715. * the same structure with LL.
  10716. */
  10717. PREPACK struct hl_htt_rx_desc_base {
  10718. A_UINT32
  10719. seq_num:12,
  10720. encrypted:1,
  10721. chan_info_present:1,
  10722. resv0:2,
  10723. mcast_bcast:1,
  10724. fragment:1,
  10725. key_id_oct:8,
  10726. resv1:6;
  10727. A_UINT32
  10728. pn_31_0;
  10729. union {
  10730. struct {
  10731. A_UINT16 pn_47_32;
  10732. A_UINT16 pn_63_48;
  10733. } pn16;
  10734. A_UINT32 pn_63_32;
  10735. } u0;
  10736. A_UINT32
  10737. pn_95_64;
  10738. A_UINT32
  10739. pn_127_96;
  10740. } POSTPACK;
  10741. /*
  10742. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  10743. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  10744. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  10745. * Please see htt_chan_change_t for description of the fields.
  10746. */
  10747. PREPACK struct htt_chan_info_t
  10748. {
  10749. A_UINT32 primary_chan_center_freq_mhz: 16,
  10750. contig_chan1_center_freq_mhz: 16;
  10751. A_UINT32 contig_chan2_center_freq_mhz: 16,
  10752. phy_mode: 8,
  10753. reserved: 8;
  10754. } POSTPACK;
  10755. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  10756. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  10757. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  10758. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  10759. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  10760. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  10761. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  10762. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  10763. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  10764. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  10765. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  10766. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  10767. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  10768. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  10769. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  10770. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  10771. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  10772. /* Channel information */
  10773. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  10774. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  10775. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  10776. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  10777. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  10778. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  10779. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  10780. #define HTT_CHAN_INFO_PHY_MODE_S 16
  10781. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  10782. do { \
  10783. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  10784. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  10785. } while (0)
  10786. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  10787. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  10788. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  10789. do { \
  10790. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  10791. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  10792. } while (0)
  10793. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  10794. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  10795. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  10796. do { \
  10797. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  10798. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  10799. } while (0)
  10800. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  10801. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  10802. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  10803. do { \
  10804. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  10805. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  10806. } while (0)
  10807. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  10808. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  10809. /*
  10810. * @brief target -> host message definition for FW offloaded pkts
  10811. *
  10812. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  10813. *
  10814. * @details
  10815. * The following field definitions describe the format of the firmware
  10816. * offload deliver message sent from the target to the host.
  10817. *
  10818. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  10819. *
  10820. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  10821. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  10822. * | reserved_1 | msg type |
  10823. * |--------------------------------------------------------------------------|
  10824. * | phy_timestamp_l32 |
  10825. * |--------------------------------------------------------------------------|
  10826. * | WORD2 (see below) |
  10827. * |--------------------------------------------------------------------------|
  10828. * | seqno | framectrl |
  10829. * |--------------------------------------------------------------------------|
  10830. * | reserved_3 | vdev_id | tid_num|
  10831. * |--------------------------------------------------------------------------|
  10832. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  10833. * |--------------------------------------------------------------------------|
  10834. *
  10835. * where:
  10836. * STAT = status
  10837. * F = format (802.3 vs. 802.11)
  10838. *
  10839. * definition for word 2
  10840. *
  10841. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  10842. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  10843. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  10844. * |--------------------------------------------------------------------------|
  10845. *
  10846. * where:
  10847. * PR = preamble
  10848. * BF = beamformed
  10849. */
  10850. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  10851. {
  10852. A_UINT32 /* word 0 */
  10853. msg_type:8, /* [ 7: 0] */
  10854. reserved_1:24; /* [31: 8] */
  10855. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  10856. A_UINT32 /* word 2 */
  10857. /* preamble:
  10858. * 0-OFDM,
  10859. * 1-CCk,
  10860. * 2-HT,
  10861. * 3-VHT
  10862. */
  10863. preamble: 2, /* [1:0] */
  10864. /* mcs:
  10865. * In case of HT preamble interpret
  10866. * MCS along with NSS.
  10867. * Valid values for HT are 0 to 7.
  10868. * HT mcs 0 with NSS 2 is mcs 8.
  10869. * Valid values for VHT are 0 to 9.
  10870. */
  10871. mcs: 4, /* [5:2] */
  10872. /* rate:
  10873. * This is applicable only for
  10874. * CCK and OFDM preamble type
  10875. * rate 0: OFDM 48 Mbps,
  10876. * 1: OFDM 24 Mbps,
  10877. * 2: OFDM 12 Mbps
  10878. * 3: OFDM 6 Mbps
  10879. * 4: OFDM 54 Mbps
  10880. * 5: OFDM 36 Mbps
  10881. * 6: OFDM 18 Mbps
  10882. * 7: OFDM 9 Mbps
  10883. * rate 0: CCK 11 Mbps Long
  10884. * 1: CCK 5.5 Mbps Long
  10885. * 2: CCK 2 Mbps Long
  10886. * 3: CCK 1 Mbps Long
  10887. * 4: CCK 11 Mbps Short
  10888. * 5: CCK 5.5 Mbps Short
  10889. * 6: CCK 2 Mbps Short
  10890. */
  10891. rate : 3, /* [ 8: 6] */
  10892. rssi : 8, /* [16: 9] units=dBm */
  10893. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10894. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10895. stbc : 1, /* [22] */
  10896. sgi : 1, /* [23] */
  10897. ldpc : 1, /* [24] */
  10898. beamformed: 1, /* [25] */
  10899. reserved_2: 6; /* [31:26] */
  10900. A_UINT32 /* word 3 */
  10901. framectrl:16, /* [15: 0] */
  10902. seqno:16; /* [31:16] */
  10903. A_UINT32 /* word 4 */
  10904. tid_num:5, /* [ 4: 0] actual TID number */
  10905. vdev_id:8, /* [12: 5] */
  10906. reserved_3:19; /* [31:13] */
  10907. A_UINT32 /* word 5 */
  10908. /* status:
  10909. * 0: tx_ok
  10910. * 1: retry
  10911. * 2: drop
  10912. * 3: filtered
  10913. * 4: abort
  10914. * 5: tid delete
  10915. * 6: sw abort
  10916. * 7: dropped by peer migration
  10917. */
  10918. status:3, /* [2:0] */
  10919. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  10920. tx_mpdu_bytes:16, /* [19:4] */
  10921. /* Indicates retry count of offloaded/local generated Data tx frames */
  10922. tx_retry_cnt:6, /* [25:20] */
  10923. reserved_4:6; /* [31:26] */
  10924. } POSTPACK;
  10925. /* FW offload deliver ind message header fields */
  10926. /* DWORD one */
  10927. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  10928. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  10929. /* DWORD two */
  10930. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  10931. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  10932. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  10933. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  10934. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  10935. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  10936. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  10937. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  10938. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  10939. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  10940. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  10941. #define HTT_FW_OFFLOAD_IND_BW_S 19
  10942. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  10943. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  10944. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  10945. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  10946. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  10947. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  10948. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  10949. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  10950. /* DWORD three*/
  10951. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  10952. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  10953. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  10954. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  10955. /* DWORD four */
  10956. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  10957. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  10958. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  10959. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  10960. /* DWORD five */
  10961. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10962. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10963. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10964. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10965. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10966. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10967. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10968. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10969. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10970. do { \
  10971. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10972. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10973. } while (0)
  10974. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10975. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10976. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10977. do { \
  10978. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10979. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10980. } while (0)
  10981. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10982. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10983. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10984. do { \
  10985. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10986. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10987. } while (0)
  10988. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10989. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10990. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10991. do { \
  10992. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10993. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10994. } while (0)
  10995. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10996. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  10997. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  10998. do { \
  10999. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  11000. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  11001. } while (0)
  11002. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  11003. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  11004. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  11005. do { \
  11006. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  11007. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  11008. } while (0)
  11009. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  11010. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  11011. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  11012. do { \
  11013. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  11014. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  11015. } while (0)
  11016. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  11017. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  11018. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  11019. do { \
  11020. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  11021. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  11022. } while (0)
  11023. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  11024. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  11025. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  11026. do { \
  11027. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  11028. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  11029. } while (0)
  11030. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  11031. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  11032. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  11033. do { \
  11034. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  11035. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  11036. } while (0)
  11037. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  11038. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  11039. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  11040. do { \
  11041. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  11042. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  11043. } while (0)
  11044. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  11045. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  11046. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  11047. do { \
  11048. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  11049. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  11050. } while (0)
  11051. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  11052. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  11053. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  11054. do { \
  11055. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  11056. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  11057. } while (0)
  11058. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  11059. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  11060. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  11061. do { \
  11062. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  11063. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  11064. } while (0)
  11065. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  11066. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  11067. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  11068. do { \
  11069. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  11070. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  11071. } while (0)
  11072. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  11073. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  11074. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  11075. do { \
  11076. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  11077. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  11078. } while (0)
  11079. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  11080. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  11081. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  11082. do { \
  11083. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  11084. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  11085. } while (0)
  11086. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  11087. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  11088. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  11089. do { \
  11090. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  11091. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  11092. } while (0)
  11093. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  11094. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  11095. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  11096. do { \
  11097. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  11098. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  11099. } while (0)
  11100. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  11101. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  11102. /*
  11103. * @brief target -> host rx reorder flush message definition
  11104. *
  11105. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  11106. *
  11107. * @details
  11108. * The following field definitions describe the format of the rx flush
  11109. * message sent from the target to the host.
  11110. * The message consists of a 4-octet header, followed by one or more
  11111. * 4-octet payload information elements.
  11112. *
  11113. * |31 24|23 8|7 0|
  11114. * |--------------------------------------------------------------|
  11115. * | TID | peer ID | msg type |
  11116. * |--------------------------------------------------------------|
  11117. * | seq num end | seq num start | MPDU status | reserved |
  11118. * |--------------------------------------------------------------|
  11119. * First DWORD:
  11120. * - MSG_TYPE
  11121. * Bits 7:0
  11122. * Purpose: identifies this as an rx flush message
  11123. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  11124. * - PEER_ID
  11125. * Bits 23:8 (only bits 18:8 actually used)
  11126. * Purpose: identify which peer's rx data is being flushed
  11127. * Value: (rx) peer ID
  11128. * - TID
  11129. * Bits 31:24 (only bits 27:24 actually used)
  11130. * Purpose: Specifies which traffic identifier's rx data is being flushed
  11131. * Value: traffic identifier
  11132. * Second DWORD:
  11133. * - MPDU_STATUS
  11134. * Bits 15:8
  11135. * Purpose:
  11136. * Indicate whether the flushed MPDUs should be discarded or processed.
  11137. * Value:
  11138. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  11139. * stages of rx processing
  11140. * other: discard the MPDUs
  11141. * It is anticipated that flush messages will always have
  11142. * MPDU status == 1, but the status flag is included for
  11143. * flexibility.
  11144. * - SEQ_NUM_START
  11145. * Bits 23:16
  11146. * Purpose:
  11147. * Indicate the start of a series of consecutive MPDUs being flushed.
  11148. * Not all MPDUs within this range are necessarily valid - the host
  11149. * must check each sequence number within this range to see if the
  11150. * corresponding MPDU is actually present.
  11151. * Value:
  11152. * The sequence number for the first MPDU in the sequence.
  11153. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11154. * - SEQ_NUM_END
  11155. * Bits 30:24
  11156. * Purpose:
  11157. * Indicate the end of a series of consecutive MPDUs being flushed.
  11158. * Value:
  11159. * The sequence number one larger than the sequence number of the
  11160. * last MPDU being flushed.
  11161. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11162. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  11163. * are to be released for further rx processing.
  11164. * Not all MPDUs within this range are necessarily valid - the host
  11165. * must check each sequence number within this range to see if the
  11166. * corresponding MPDU is actually present.
  11167. */
  11168. /* first DWORD */
  11169. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  11170. #define HTT_RX_FLUSH_PEER_ID_S 8
  11171. #define HTT_RX_FLUSH_TID_M 0xff000000
  11172. #define HTT_RX_FLUSH_TID_S 24
  11173. /* second DWORD */
  11174. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  11175. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  11176. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  11177. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  11178. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  11179. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  11180. #define HTT_RX_FLUSH_BYTES 8
  11181. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  11182. do { \
  11183. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  11184. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  11185. } while (0)
  11186. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  11187. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  11188. #define HTT_RX_FLUSH_TID_SET(word, value) \
  11189. do { \
  11190. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  11191. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  11192. } while (0)
  11193. #define HTT_RX_FLUSH_TID_GET(word) \
  11194. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  11195. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  11196. do { \
  11197. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  11198. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  11199. } while (0)
  11200. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  11201. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  11202. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  11203. do { \
  11204. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  11205. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  11206. } while (0)
  11207. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  11208. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  11209. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  11210. do { \
  11211. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  11212. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  11213. } while (0)
  11214. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  11215. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  11216. /*
  11217. * @brief target -> host rx pn check indication message
  11218. *
  11219. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  11220. *
  11221. * @details
  11222. * The following field definitions describe the format of the Rx PN check
  11223. * indication message sent from the target to the host.
  11224. * The message consists of a 4-octet header, followed by the start and
  11225. * end sequence numbers to be released, followed by the PN IEs. Each PN
  11226. * IE is one octet containing the sequence number that failed the PN
  11227. * check.
  11228. *
  11229. * |31 24|23 8|7 0|
  11230. * |--------------------------------------------------------------|
  11231. * | TID | peer ID | msg type |
  11232. * |--------------------------------------------------------------|
  11233. * | Reserved | PN IE count | seq num end | seq num start|
  11234. * |--------------------------------------------------------------|
  11235. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  11236. * |--------------------------------------------------------------|
  11237. * First DWORD:
  11238. * - MSG_TYPE
  11239. * Bits 7:0
  11240. * Purpose: Identifies this as an rx pn check indication message
  11241. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  11242. * - PEER_ID
  11243. * Bits 23:8 (only bits 18:8 actually used)
  11244. * Purpose: identify which peer
  11245. * Value: (rx) peer ID
  11246. * - TID
  11247. * Bits 31:24 (only bits 27:24 actually used)
  11248. * Purpose: identify traffic identifier
  11249. * Value: traffic identifier
  11250. * Second DWORD:
  11251. * - SEQ_NUM_START
  11252. * Bits 7:0
  11253. * Purpose:
  11254. * Indicates the starting sequence number of the MPDU in this
  11255. * series of MPDUs that went though PN check.
  11256. * Value:
  11257. * The sequence number for the first MPDU in the sequence.
  11258. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11259. * - SEQ_NUM_END
  11260. * Bits 15:8
  11261. * Purpose:
  11262. * Indicates the ending sequence number of the MPDU in this
  11263. * series of MPDUs that went though PN check.
  11264. * Value:
  11265. * The sequence number one larger then the sequence number of the last
  11266. * MPDU being flushed.
  11267. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11268. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  11269. * for invalid PN numbers and are ready to be released for further processing.
  11270. * Not all MPDUs within this range are necessarily valid - the host
  11271. * must check each sequence number within this range to see if the
  11272. * corresponding MPDU is actually present.
  11273. * - PN_IE_COUNT
  11274. * Bits 23:16
  11275. * Purpose:
  11276. * Used to determine the variable number of PN information elements in this
  11277. * message
  11278. *
  11279. * PN information elements:
  11280. * - PN_IE_x-
  11281. * Purpose:
  11282. * Each PN information element contains the sequence number of the MPDU that
  11283. * has failed the target PN check.
  11284. * Value:
  11285. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  11286. * that failed the PN check.
  11287. */
  11288. /* first DWORD */
  11289. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  11290. #define HTT_RX_PN_IND_PEER_ID_S 8
  11291. #define HTT_RX_PN_IND_TID_M 0xff000000
  11292. #define HTT_RX_PN_IND_TID_S 24
  11293. /* second DWORD */
  11294. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  11295. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  11296. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  11297. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  11298. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  11299. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  11300. #define HTT_RX_PN_IND_BYTES 8
  11301. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  11302. do { \
  11303. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  11304. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  11305. } while (0)
  11306. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  11307. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  11308. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  11309. do { \
  11310. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  11311. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  11312. } while (0)
  11313. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  11314. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  11315. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  11316. do { \
  11317. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  11318. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  11319. } while (0)
  11320. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  11321. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  11322. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  11323. do { \
  11324. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  11325. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  11326. } while (0)
  11327. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  11328. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  11329. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  11330. do { \
  11331. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  11332. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  11333. } while (0)
  11334. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  11335. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  11336. /*
  11337. * @brief target -> host rx offload deliver message for LL system
  11338. *
  11339. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  11340. *
  11341. * @details
  11342. * In a low latency system this message is sent whenever the offload
  11343. * manager flushes out the packets it has coalesced in its coalescing buffer.
  11344. * The DMA of the actual packets into host memory is done before sending out
  11345. * this message. This message indicates only how many MSDUs to reap. The
  11346. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  11347. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  11348. * DMA'd by the MAC directly into host memory these packets do not contain
  11349. * the MAC descriptors in the header portion of the packet. Instead they contain
  11350. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  11351. * message, the packets are delivered directly to the NW stack without going
  11352. * through the regular reorder buffering and PN checking path since it has
  11353. * already been done in target.
  11354. *
  11355. * |31 24|23 16|15 8|7 0|
  11356. * |-----------------------------------------------------------------------|
  11357. * | Total MSDU count | reserved | msg type |
  11358. * |-----------------------------------------------------------------------|
  11359. *
  11360. * @brief target -> host rx offload deliver message for HL system
  11361. *
  11362. * @details
  11363. * In a high latency system this message is sent whenever the offload manager
  11364. * flushes out the packets it has coalesced in its coalescing buffer. The
  11365. * actual packets are also carried along with this message. When the host
  11366. * receives this message, it is expected to deliver these packets to the NW
  11367. * stack directly instead of routing them through the reorder buffering and
  11368. * PN checking path since it has already been done in target.
  11369. *
  11370. * |31 24|23 16|15 8|7 0|
  11371. * |-----------------------------------------------------------------------|
  11372. * | Total MSDU count | reserved | msg type |
  11373. * |-----------------------------------------------------------------------|
  11374. * | peer ID | MSDU length |
  11375. * |-----------------------------------------------------------------------|
  11376. * | MSDU payload | FW Desc | tid | vdev ID |
  11377. * |-----------------------------------------------------------------------|
  11378. * | MSDU payload contd. |
  11379. * |-----------------------------------------------------------------------|
  11380. * | peer ID | MSDU length |
  11381. * |-----------------------------------------------------------------------|
  11382. * | MSDU payload | FW Desc | tid | vdev ID |
  11383. * |-----------------------------------------------------------------------|
  11384. * | MSDU payload contd. |
  11385. * |-----------------------------------------------------------------------|
  11386. *
  11387. */
  11388. /* first DWORD */
  11389. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  11390. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  11391. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  11392. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  11393. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  11394. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  11395. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  11396. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  11397. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  11398. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  11399. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  11400. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  11401. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  11402. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  11403. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  11404. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  11405. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  11406. do { \
  11407. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  11408. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  11409. } while (0)
  11410. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  11411. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  11412. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  11413. do { \
  11414. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  11415. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  11416. } while (0)
  11417. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  11418. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  11419. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  11420. do { \
  11421. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  11422. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  11423. } while (0)
  11424. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  11425. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  11426. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  11427. do { \
  11428. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  11429. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  11430. } while (0)
  11431. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  11432. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  11433. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  11434. do { \
  11435. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  11436. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  11437. } while (0)
  11438. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  11439. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  11440. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  11441. do { \
  11442. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  11443. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  11444. } while (0)
  11445. /**
  11446. * @brief target -> host rx peer map/unmap message definition
  11447. *
  11448. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  11449. *
  11450. * @details
  11451. * The following diagram shows the format of the rx peer map message sent
  11452. * from the target to the host. This layout assumes the target operates
  11453. * as little-endian.
  11454. *
  11455. * This message always contains a SW peer ID. The main purpose of the
  11456. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11457. * with, so that the host can use that peer ID to determine which peer
  11458. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11459. * other purposes, such as identifying during tx completions which peer
  11460. * the tx frames in question were transmitted to.
  11461. *
  11462. * In certain generations of chips, the peer map message also contains
  11463. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  11464. * to identify which peer the frame needs to be forwarded to (i.e. the
  11465. * peer associated with the Destination MAC Address within the packet),
  11466. * and particularly which vdev needs to transmit the frame (for cases
  11467. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  11468. * meaning as AST_INDEX_0.
  11469. * This DA-based peer ID that is provided for certain rx frames
  11470. * (the rx frames that need to be re-transmitted as tx frames)
  11471. * is the ID that the HW uses for referring to the peer in question,
  11472. * rather than the peer ID that the SW+FW use to refer to the peer.
  11473. *
  11474. *
  11475. * |31 24|23 16|15 8|7 0|
  11476. * |-----------------------------------------------------------------------|
  11477. * | SW peer ID | VDEV ID | msg type |
  11478. * |-----------------------------------------------------------------------|
  11479. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11480. * |-----------------------------------------------------------------------|
  11481. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11482. * |-----------------------------------------------------------------------|
  11483. *
  11484. *
  11485. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  11486. *
  11487. * The following diagram shows the format of the rx peer unmap message sent
  11488. * from the target to the host.
  11489. *
  11490. * |31 24|23 16|15 8|7 0|
  11491. * |-----------------------------------------------------------------------|
  11492. * | SW peer ID | VDEV ID | msg type |
  11493. * |-----------------------------------------------------------------------|
  11494. *
  11495. * The following field definitions describe the format of the rx peer map
  11496. * and peer unmap messages sent from the target to the host.
  11497. * - MSG_TYPE
  11498. * Bits 7:0
  11499. * Purpose: identifies this as an rx peer map or peer unmap message
  11500. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  11501. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  11502. * - VDEV_ID
  11503. * Bits 15:8
  11504. * Purpose: Indicates which virtual device the peer is associated
  11505. * with.
  11506. * Value: vdev ID (used in the host to look up the vdev object)
  11507. * - PEER_ID (a.k.a. SW_PEER_ID)
  11508. * Bits 31:16
  11509. * Purpose: The peer ID (index) that WAL is allocating (map) or
  11510. * freeing (unmap)
  11511. * Value: (rx) peer ID
  11512. * - MAC_ADDR_L32 (peer map only)
  11513. * Bits 31:0
  11514. * Purpose: Identifies which peer node the peer ID is for.
  11515. * Value: lower 4 bytes of peer node's MAC address
  11516. * - MAC_ADDR_U16 (peer map only)
  11517. * Bits 15:0
  11518. * Purpose: Identifies which peer node the peer ID is for.
  11519. * Value: upper 2 bytes of peer node's MAC address
  11520. * - HW_PEER_ID
  11521. * Bits 31:16
  11522. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11523. * address, so for rx frames marked for rx --> tx forwarding, the
  11524. * host can determine from the HW peer ID provided as meta-data with
  11525. * the rx frame which peer the frame is supposed to be forwarded to.
  11526. * Value: ID used by the MAC HW to identify the peer
  11527. */
  11528. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  11529. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  11530. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  11531. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  11532. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  11533. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  11534. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11535. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  11536. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  11537. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  11538. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  11539. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  11540. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  11541. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  11542. do { \
  11543. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  11544. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  11545. } while (0)
  11546. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  11547. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  11548. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  11549. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  11550. do { \
  11551. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  11552. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  11553. } while (0)
  11554. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  11555. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  11556. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  11557. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  11558. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  11559. do { \
  11560. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  11561. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  11562. } while (0)
  11563. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  11564. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  11565. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11566. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  11567. #define HTT_RX_PEER_MAP_BYTES 12
  11568. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  11569. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  11570. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  11571. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  11572. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  11573. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  11574. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  11575. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  11576. #define HTT_RX_PEER_UNMAP_BYTES 4
  11577. /**
  11578. * @brief target -> host rx peer map V2 message definition
  11579. *
  11580. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  11581. *
  11582. * @details
  11583. * The following diagram shows the format of the rx peer map v2 message sent
  11584. * from the target to the host. This layout assumes the target operates
  11585. * as little-endian.
  11586. *
  11587. * This message always contains a SW peer ID. The main purpose of the
  11588. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11589. * with, so that the host can use that peer ID to determine which peer
  11590. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11591. * other purposes, such as identifying during tx completions which peer
  11592. * the tx frames in question were transmitted to.
  11593. *
  11594. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  11595. * is used during rx --> tx frame forwarding to identify which peer the
  11596. * frame needs to be forwarded to (i.e. the peer associated with the
  11597. * Destination MAC Address within the packet), and particularly which vdev
  11598. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  11599. * This DA-based peer ID that is provided for certain rx frames
  11600. * (the rx frames that need to be re-transmitted as tx frames)
  11601. * is the ID that the HW uses for referring to the peer in question,
  11602. * rather than the peer ID that the SW+FW use to refer to the peer.
  11603. *
  11604. * The HW peer id here is the same meaning as AST_INDEX_0.
  11605. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  11606. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  11607. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  11608. * AST is valid.
  11609. *
  11610. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  11611. * |-------------------------------------------------------------------------|
  11612. * | SW peer ID | VDEV ID | msg type |
  11613. * |-------------------------------------------------------------------------|
  11614. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11615. * |-------------------------------------------------------------------------|
  11616. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11617. * |-------------------------------------------------------------------------|
  11618. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  11619. * |-------------------------------------------------------------------------|
  11620. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  11621. * |-------------------------------------------------------------------------|
  11622. * |TID valid low pri| TID valid hi pri | AST index 2 |
  11623. * |-------------------------------------------------------------------------|
  11624. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  11625. * |-------------------------------------------------------------------------|
  11626. * | Reserved_2 |
  11627. * |-------------------------------------------------------------------------|
  11628. * Where:
  11629. * NH = Next Hop
  11630. * ASTVM = AST valid mask
  11631. * OA = on-chip AST valid bit
  11632. * ASTFM = AST flow mask
  11633. *
  11634. * The following field definitions describe the format of the rx peer map v2
  11635. * messages sent from the target to the host.
  11636. * - MSG_TYPE
  11637. * Bits 7:0
  11638. * Purpose: identifies this as an rx peer map v2 message
  11639. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  11640. * - VDEV_ID
  11641. * Bits 15:8
  11642. * Purpose: Indicates which virtual device the peer is associated with.
  11643. * Value: vdev ID (used in the host to look up the vdev object)
  11644. * - SW_PEER_ID
  11645. * Bits 31:16
  11646. * Purpose: The peer ID (index) that WAL is allocating
  11647. * Value: (rx) peer ID
  11648. * - MAC_ADDR_L32
  11649. * Bits 31:0
  11650. * Purpose: Identifies which peer node the peer ID is for.
  11651. * Value: lower 4 bytes of peer node's MAC address
  11652. * - MAC_ADDR_U16
  11653. * Bits 15:0
  11654. * Purpose: Identifies which peer node the peer ID is for.
  11655. * Value: upper 2 bytes of peer node's MAC address
  11656. * - HW_PEER_ID / AST_INDEX_0
  11657. * Bits 31:16
  11658. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11659. * address, so for rx frames marked for rx --> tx forwarding, the
  11660. * host can determine from the HW peer ID provided as meta-data with
  11661. * the rx frame which peer the frame is supposed to be forwarded to.
  11662. * Value: ID used by the MAC HW to identify the peer
  11663. * - AST_HASH_VALUE
  11664. * Bits 15:0
  11665. * Purpose: Indicates AST Hash value is required for the TCL AST index
  11666. * override feature.
  11667. * - NEXT_HOP
  11668. * Bit 16
  11669. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  11670. * (Wireless Distribution System).
  11671. * - AST_VALID_MASK
  11672. * Bits 19:17
  11673. * Purpose: Indicate if the AST 1 through AST 3 are valid
  11674. * - ONCHIP_AST_VALID_FLAG
  11675. * Bit 20
  11676. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  11677. * is valid.
  11678. * - AST_INDEX_1
  11679. * Bits 15:0
  11680. * Purpose: indicate the second AST index for this peer
  11681. * - AST_0_FLOW_MASK
  11682. * Bits 19:16
  11683. * Purpose: identify the which flow the AST 0 entry corresponds to.
  11684. * - AST_1_FLOW_MASK
  11685. * Bits 23:20
  11686. * Purpose: identify the which flow the AST 1 entry corresponds to.
  11687. * - AST_2_FLOW_MASK
  11688. * Bits 27:24
  11689. * Purpose: identify the which flow the AST 2 entry corresponds to.
  11690. * - AST_3_FLOW_MASK
  11691. * Bits 31:28
  11692. * Purpose: identify the which flow the AST 3 entry corresponds to.
  11693. * - AST_INDEX_2
  11694. * Bits 15:0
  11695. * Purpose: indicate the third AST index for this peer
  11696. * - TID_VALID_HI_PRI
  11697. * Bits 23:16
  11698. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  11699. * - TID_VALID_LOW_PRI
  11700. * Bits 31:24
  11701. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  11702. * - AST_INDEX_3
  11703. * Bits 15:0
  11704. * Purpose: indicate the fourth AST index for this peer
  11705. * - ONCHIP_AST_IDX / RESERVED
  11706. * Bits 31:16
  11707. * Purpose: This field is valid only when split AST feature is enabled.
  11708. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  11709. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11710. * address, this ast_idx is used for LMAC modules for RXPCU.
  11711. * Value: ID used by the LMAC HW to identify the peer
  11712. */
  11713. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  11714. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  11715. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  11716. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  11717. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  11718. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  11719. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  11720. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  11721. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  11722. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  11723. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  11724. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  11725. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  11726. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  11727. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  11728. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  11729. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  11730. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  11731. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  11732. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  11733. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  11734. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  11735. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  11736. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  11737. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  11738. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  11739. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  11740. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  11741. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  11742. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  11743. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  11744. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  11745. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  11746. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  11747. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  11748. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  11749. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  11750. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  11751. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  11752. do { \
  11753. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  11754. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  11755. } while (0)
  11756. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  11757. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  11758. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  11759. do { \
  11760. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  11761. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  11762. } while (0)
  11763. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  11764. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  11765. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  11766. do { \
  11767. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  11768. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  11769. } while (0)
  11770. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  11771. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  11772. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  11773. do { \
  11774. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  11775. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  11776. } while (0)
  11777. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  11778. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  11779. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  11780. do { \
  11781. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  11782. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  11783. } while (0)
  11784. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  11785. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  11786. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  11787. do { \
  11788. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  11789. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  11790. } while (0)
  11791. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  11792. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  11793. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  11794. do { \
  11795. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  11796. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  11797. } while (0)
  11798. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  11799. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  11800. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11801. do { \
  11802. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  11803. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  11804. } while (0)
  11805. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  11806. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  11807. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  11808. do { \
  11809. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  11810. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  11811. } while (0)
  11812. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  11813. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  11814. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  11815. do { \
  11816. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  11817. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  11818. } while (0)
  11819. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  11820. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  11821. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  11822. do { \
  11823. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  11824. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  11825. } while (0)
  11826. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  11827. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  11828. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  11829. do { \
  11830. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  11831. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  11832. } while (0)
  11833. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  11834. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  11835. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  11836. do { \
  11837. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  11838. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  11839. } while (0)
  11840. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  11841. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  11842. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  11843. do { \
  11844. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  11845. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  11846. } while (0)
  11847. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  11848. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  11849. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  11850. do { \
  11851. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  11852. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  11853. } while (0)
  11854. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  11855. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  11856. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  11857. do { \
  11858. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  11859. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  11860. } while (0)
  11861. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  11862. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  11863. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  11864. do { \
  11865. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  11866. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  11867. } while (0)
  11868. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  11869. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  11870. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11871. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  11872. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  11873. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  11874. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  11875. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  11876. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  11877. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  11878. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  11879. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  11880. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  11881. #define HTT_RX_PEER_MAP_V2_BYTES 32
  11882. /**
  11883. * @brief target -> host rx peer map V3 message definition
  11884. *
  11885. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  11886. *
  11887. * @details
  11888. * The following diagram shows the format of the rx peer map v3 message sent
  11889. * from the target to the host.
  11890. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  11891. * This layout assumes the target operates as little-endian.
  11892. *
  11893. * |31 24|23 20|19|18|17|16|15 8|7 0|
  11894. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  11895. * | SW peer ID | VDEV ID | msg type |
  11896. * |-----------------+--------------------+-----------------+-----------------|
  11897. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11898. * |-----------------+--------------------+-----------------+-----------------|
  11899. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  11900. * |-----------------+--------+-----------+-----------------+-----------------|
  11901. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  11902. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  11903. * | (8bits) | | (4bits) | |
  11904. * |-----------------+--------+--+--+--+--------------------------------------|
  11905. * | RESERVED |E |O | | |
  11906. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  11907. * | |V |V | | |
  11908. * |-----------------+--------------------+-----------------------------------|
  11909. * | HTT_MSDU_IDX_ | RESERVED | |
  11910. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  11911. * | (8bits) | | |
  11912. * |-----------------+--------------------+-----------------------------------|
  11913. * | Reserved_2 |
  11914. * |--------------------------------------------------------------------------|
  11915. * | Reserved_3 |
  11916. * |--------------------------------------------------------------------------|
  11917. *
  11918. * Where:
  11919. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  11920. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  11921. * NH = Next Hop
  11922. * The following field definitions describe the format of the rx peer map v3
  11923. * messages sent from the target to the host.
  11924. * - MSG_TYPE
  11925. * Bits 7:0
  11926. * Purpose: identifies this as a peer map v3 message
  11927. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  11928. * - VDEV_ID
  11929. * Bits 15:8
  11930. * Purpose: Indicates which virtual device the peer is associated with.
  11931. * - SW_PEER_ID
  11932. * Bits 31:16
  11933. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  11934. * - MAC_ADDR_L32
  11935. * Bits 31:0
  11936. * Purpose: Identifies which peer node the peer ID is for.
  11937. * Value: lower 4 bytes of peer node's MAC address
  11938. * - MAC_ADDR_U16
  11939. * Bits 15:0
  11940. * Purpose: Identifies which peer node the peer ID is for.
  11941. * Value: upper 2 bytes of peer node's MAC address
  11942. * - MULTICAST_SW_PEER_ID
  11943. * Bits 31:16
  11944. * Purpose: The multicast peer ID (index)
  11945. * Value: set to HTT_INVALID_PEER if not valid
  11946. * - HW_PEER_ID / AST_INDEX
  11947. * Bits 15:0
  11948. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11949. * address, so for rx frames marked for rx --> tx forwarding, the
  11950. * host can determine from the HW peer ID provided as meta-data with
  11951. * the rx frame which peer the frame is supposed to be forwarded to.
  11952. * - CACHE_SET_NUM
  11953. * Bits 19:16
  11954. * Purpose: Cache Set Number for AST_INDEX
  11955. * Cache set number that should be used to cache the index based
  11956. * search results, for address and flow search.
  11957. * This value should be equal to LSB 4 bits of the hash value
  11958. * of match data, in case of search index points to an entry which
  11959. * may be used in content based search also. The value can be
  11960. * anything when the entry pointed by search index will not be
  11961. * used for content based search.
  11962. * - HTT_MSDU_IDX_VALID_MASK
  11963. * Bits 31:24
  11964. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11965. * - ONCHIP_AST_IDX / RESERVED
  11966. * Bits 15:0
  11967. * Purpose: This field is valid only when split AST feature is enabled.
  11968. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11969. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11970. * address, this ast_idx is used for LMAC modules for RXPCU.
  11971. * - NEXT_HOP
  11972. * Bits 16
  11973. * Purpose: Flag indicates next_hop AST entry used for WDS
  11974. * (Wireless Distribution System).
  11975. * - ONCHIP_AST_VALID
  11976. * Bits 17
  11977. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11978. * - EXT_AST_VALID
  11979. * Bits 18
  11980. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11981. * - EXT_AST_INDEX
  11982. * Bits 15:0
  11983. * Purpose: This field describes Extended AST index
  11984. * Valid if EXT_AST_VALID flag set
  11985. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11986. * Bits 31:24
  11987. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11988. */
  11989. /* dword 0 */
  11990. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11991. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11992. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11993. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11994. /* dword 1 */
  11995. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11996. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  11997. /* dword 2 */
  11998. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  11999. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  12000. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  12001. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  12002. /* dword 3 */
  12003. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  12004. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  12005. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  12006. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  12007. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  12008. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  12009. /* dword 4 */
  12010. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  12011. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  12012. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  12013. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  12014. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  12015. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  12016. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  12017. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  12018. /* dword 5 */
  12019. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  12020. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  12021. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  12022. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  12023. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  12024. do { \
  12025. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  12026. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  12027. } while (0)
  12028. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  12029. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  12030. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  12031. do { \
  12032. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  12033. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  12034. } while (0)
  12035. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  12036. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  12037. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  12038. do { \
  12039. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  12040. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  12041. } while (0)
  12042. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  12043. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  12044. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  12045. do { \
  12046. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  12047. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  12048. } while (0)
  12049. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  12050. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  12051. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  12052. do { \
  12053. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  12054. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  12055. } while (0)
  12056. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  12057. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  12058. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  12059. do { \
  12060. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  12061. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  12062. } while (0)
  12063. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  12064. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  12065. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  12066. do { \
  12067. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  12068. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  12069. } while (0)
  12070. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  12071. (((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)
  12072. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  12073. do { \
  12074. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  12075. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  12076. } while (0)
  12077. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  12078. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  12079. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  12080. do { \
  12081. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  12082. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  12083. } while (0)
  12084. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  12085. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  12086. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  12087. do { \
  12088. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  12089. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  12090. } while (0)
  12091. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  12092. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  12093. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  12094. do { \
  12095. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  12096. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  12097. } while (0)
  12098. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  12099. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  12100. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  12101. do { \
  12102. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  12103. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  12104. } while (0)
  12105. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  12106. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  12107. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  12108. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  12109. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  12110. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  12111. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  12112. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  12113. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  12114. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  12115. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  12116. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  12117. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  12118. #define HTT_RX_PEER_MAP_V3_BYTES 32
  12119. /**
  12120. * @brief target -> host rx peer unmap V2 message definition
  12121. *
  12122. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  12123. *
  12124. * The following diagram shows the format of the rx peer unmap message sent
  12125. * from the target to the host.
  12126. *
  12127. * |31 24|23 16|15 8|7 0|
  12128. * |-----------------------------------------------------------------------|
  12129. * | SW peer ID | VDEV ID | msg type |
  12130. * |-----------------------------------------------------------------------|
  12131. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12132. * |-----------------------------------------------------------------------|
  12133. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  12134. * |-----------------------------------------------------------------------|
  12135. * | Peer Delete Duration |
  12136. * |-----------------------------------------------------------------------|
  12137. * | Reserved_0 | WDS Free Count |
  12138. * |-----------------------------------------------------------------------|
  12139. * | Reserved_1 |
  12140. * |-----------------------------------------------------------------------|
  12141. * | Reserved_2 |
  12142. * |-----------------------------------------------------------------------|
  12143. *
  12144. *
  12145. * The following field definitions describe the format of the rx peer unmap
  12146. * messages sent from the target to the host.
  12147. * - MSG_TYPE
  12148. * Bits 7:0
  12149. * Purpose: identifies this as an rx peer unmap v2 message
  12150. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  12151. * - VDEV_ID
  12152. * Bits 15:8
  12153. * Purpose: Indicates which virtual device the peer is associated
  12154. * with.
  12155. * Value: vdev ID (used in the host to look up the vdev object)
  12156. * - SW_PEER_ID
  12157. * Bits 31:16
  12158. * Purpose: The peer ID (index) that WAL is freeing
  12159. * Value: (rx) peer ID
  12160. * - MAC_ADDR_L32
  12161. * Bits 31:0
  12162. * Purpose: Identifies which peer node the peer ID is for.
  12163. * Value: lower 4 bytes of peer node's MAC address
  12164. * - MAC_ADDR_U16
  12165. * Bits 15:0
  12166. * Purpose: Identifies which peer node the peer ID is for.
  12167. * Value: upper 2 bytes of peer node's MAC address
  12168. * - NEXT_HOP
  12169. * Bits 16
  12170. * Purpose: Bit indicates next_hop AST entry used for WDS
  12171. * (Wireless Distribution System).
  12172. * - PEER_DELETE_DURATION
  12173. * Bits 31:0
  12174. * Purpose: Time taken to delete peer, in msec,
  12175. * Used for monitoring / debugging PEER delete response delay
  12176. * - PEER_WDS_FREE_COUNT
  12177. * Bits 15:0
  12178. * Purpose: Count of WDS entries deleted associated to peer deleted
  12179. */
  12180. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  12181. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  12182. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  12183. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  12184. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  12185. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  12186. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  12187. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  12188. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  12189. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  12190. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  12191. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  12192. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  12193. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  12194. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  12195. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  12196. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  12197. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  12198. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  12199. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  12200. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  12201. do { \
  12202. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  12203. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  12204. } while (0)
  12205. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  12206. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  12207. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  12208. do { \
  12209. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  12210. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  12211. } while (0)
  12212. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  12213. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  12214. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  12215. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  12216. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  12217. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  12218. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  12219. /**
  12220. * @brief target -> host rx peer mlo map message definition
  12221. *
  12222. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  12223. *
  12224. * @details
  12225. * The following diagram shows the format of the rx mlo peer map message sent
  12226. * from the target to the host. This layout assumes the target operates
  12227. * as little-endian.
  12228. *
  12229. * MCC:
  12230. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  12231. *
  12232. * WIN:
  12233. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  12234. * It will be sent on the Assoc Link.
  12235. *
  12236. * This message always contains a MLO peer ID. The main purpose of the
  12237. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  12238. * with, so that the host can use that MLO peer ID to determine which peer
  12239. * transmitted the rx frame.
  12240. *
  12241. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  12242. * |-------------------------------------------------------------------------|
  12243. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  12244. * |-------------------------------------------------------------------------|
  12245. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12246. * |-------------------------------------------------------------------------|
  12247. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  12248. * |-------------------------------------------------------------------------|
  12249. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  12250. * |-------------------------------------------------------------------------|
  12251. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  12252. * |-------------------------------------------------------------------------|
  12253. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  12254. * |-------------------------------------------------------------------------|
  12255. * |RSVD |
  12256. * |-------------------------------------------------------------------------|
  12257. * |RSVD |
  12258. * |-------------------------------------------------------------------------|
  12259. * | htt_tlv_hdr_t |
  12260. * |-------------------------------------------------------------------------|
  12261. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12262. * |-------------------------------------------------------------------------|
  12263. * | htt_tlv_hdr_t |
  12264. * |-------------------------------------------------------------------------|
  12265. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12266. * |-------------------------------------------------------------------------|
  12267. * | htt_tlv_hdr_t |
  12268. * |-------------------------------------------------------------------------|
  12269. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12270. * |-------------------------------------------------------------------------|
  12271. *
  12272. * Where:
  12273. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  12274. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  12275. * V (valid) - 1 Bit Bit17
  12276. * CHIPID - 3 Bits
  12277. * TIDMASK - 8 Bits
  12278. * CACHE_SET_NUM - 8 Bits
  12279. *
  12280. * The following field definitions describe the format of the rx MLO peer map
  12281. * messages sent from the target to the host.
  12282. * - MSG_TYPE
  12283. * Bits 7:0
  12284. * Purpose: identifies this as an rx mlo peer map message
  12285. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  12286. *
  12287. * - MLO_PEER_ID
  12288. * Bits 23:8
  12289. * Purpose: The MLO peer ID (index).
  12290. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  12291. * Value: MLO peer ID
  12292. *
  12293. * - NUMLINK
  12294. * Bits: 26:24 (3Bits)
  12295. * Purpose: Indicate the max number of logical links supported per client.
  12296. * Value: number of logical links
  12297. *
  12298. * - PRC
  12299. * Bits: 29:27 (3Bits)
  12300. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  12301. * if there is migration of the primary chip.
  12302. * Value: Primary REO CHIPID
  12303. *
  12304. * - MAC_ADDR_L32
  12305. * Bits 31:0
  12306. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  12307. * Value: lower 4 bytes of peer node's MAC address
  12308. *
  12309. * - MAC_ADDR_U16
  12310. * Bits 15:0
  12311. * Purpose: Identifies which peer node the peer ID is for.
  12312. * Value: upper 2 bytes of peer node's MAC address
  12313. *
  12314. * - PRIMARY_TCL_AST_IDX
  12315. * Bits 15:0
  12316. * Purpose: Primary TCL AST index for this peer.
  12317. *
  12318. * - V
  12319. * 1 Bit Position 16
  12320. * Purpose: If the ast idx is valid.
  12321. *
  12322. * - CHIPID
  12323. * Bits 19:17
  12324. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  12325. *
  12326. * - TIDMASK
  12327. * Bits 27:20
  12328. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  12329. *
  12330. * - CACHE_SET_NUM
  12331. * Bits 31:28
  12332. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  12333. * Cache set number that should be used to cache the index based
  12334. * search results, for address and flow search.
  12335. * This value should be equal to LSB four bits of the hash value
  12336. * of match data, in case of search index points to an entry which
  12337. * may be used in content based search also. The value can be
  12338. * anything when the entry pointed by search index will not be
  12339. * used for content based search.
  12340. *
  12341. * - htt_tlv_hdr_t
  12342. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  12343. *
  12344. * Bits 11:0
  12345. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  12346. *
  12347. * Bits 23:12
  12348. * Purpose: Length, Length of the value that follows the header
  12349. *
  12350. * Bits 31:28
  12351. * Purpose: Reserved.
  12352. *
  12353. *
  12354. * - SW_PEER_ID
  12355. * Bits 15:0
  12356. * Purpose: The peer ID (index) that WAL is allocating
  12357. * Value: (rx) peer ID
  12358. *
  12359. * - VDEV_ID
  12360. * Bits 23:16
  12361. * Purpose: Indicates which virtual device the peer is associated with.
  12362. * Value: vdev ID (used in the host to look up the vdev object)
  12363. *
  12364. * - CHIPID
  12365. * Bits 26:24
  12366. * Purpose: Indicates which Chip id the peer is associated with.
  12367. * Value: chip ID (Provided by Host as part of QMI exchange)
  12368. */
  12369. typedef enum {
  12370. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  12371. } MLO_PEER_MAP_TLV_TAG_ID;
  12372. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  12373. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  12374. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  12375. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  12376. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  12377. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  12378. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  12379. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  12380. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  12381. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  12382. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  12383. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  12384. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  12385. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  12386. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  12387. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  12388. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  12389. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  12390. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  12391. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  12392. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  12393. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  12394. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  12395. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  12396. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  12397. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  12398. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  12399. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  12400. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  12401. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  12402. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  12403. do { \
  12404. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  12405. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  12406. } while (0)
  12407. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  12408. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  12409. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  12410. do { \
  12411. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  12412. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  12413. } while (0)
  12414. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  12415. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  12416. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  12417. do { \
  12418. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  12419. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  12420. } while (0)
  12421. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  12422. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  12423. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  12424. do { \
  12425. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  12426. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  12427. } while (0)
  12428. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  12429. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  12430. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  12431. do { \
  12432. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  12433. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  12434. } while (0)
  12435. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  12436. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  12437. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  12438. do { \
  12439. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  12440. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  12441. } while (0)
  12442. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  12443. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  12444. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  12445. do { \
  12446. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  12447. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  12448. } while (0)
  12449. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  12450. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  12451. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  12452. do { \
  12453. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  12454. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  12455. } while (0)
  12456. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  12457. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  12458. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  12459. do { \
  12460. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  12461. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  12462. } while (0)
  12463. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  12464. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  12465. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  12466. do { \
  12467. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  12468. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  12469. } while (0)
  12470. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  12471. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  12472. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  12473. do { \
  12474. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  12475. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  12476. } while (0)
  12477. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  12478. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  12479. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  12480. do { \
  12481. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  12482. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  12483. } while (0)
  12484. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  12485. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  12486. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  12487. do { \
  12488. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  12489. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  12490. } while (0)
  12491. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  12492. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  12493. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  12494. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  12495. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  12496. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  12497. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  12498. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  12499. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  12500. *
  12501. * The following diagram shows the format of the rx mlo peer unmap message sent
  12502. * from the target to the host.
  12503. *
  12504. * |31 24|23 16|15 8|7 0|
  12505. * |-----------------------------------------------------------------------|
  12506. * | RSVD_24_31 | MLO peer ID | msg type |
  12507. * |-----------------------------------------------------------------------|
  12508. */
  12509. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  12510. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  12511. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  12512. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  12513. /**
  12514. * @brief target -> host message specifying security parameters
  12515. *
  12516. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  12517. *
  12518. * @details
  12519. * The following diagram shows the format of the security specification
  12520. * message sent from the target to the host.
  12521. * This security specification message tells the host whether a PN check is
  12522. * necessary on rx data frames, and if so, how large the PN counter is.
  12523. * This message also tells the host about the security processing to apply
  12524. * to defragmented rx frames - specifically, whether a Message Integrity
  12525. * Check is required, and the Michael key to use.
  12526. *
  12527. * |31 24|23 16|15|14 8|7 0|
  12528. * |-----------------------------------------------------------------------|
  12529. * | peer ID | U| security type | msg type |
  12530. * |-----------------------------------------------------------------------|
  12531. * | Michael Key K0 |
  12532. * |-----------------------------------------------------------------------|
  12533. * | Michael Key K1 |
  12534. * |-----------------------------------------------------------------------|
  12535. * | WAPI RSC Low0 |
  12536. * |-----------------------------------------------------------------------|
  12537. * | WAPI RSC Low1 |
  12538. * |-----------------------------------------------------------------------|
  12539. * | WAPI RSC Hi0 |
  12540. * |-----------------------------------------------------------------------|
  12541. * | WAPI RSC Hi1 |
  12542. * |-----------------------------------------------------------------------|
  12543. *
  12544. * The following field definitions describe the format of the security
  12545. * indication message sent from the target to the host.
  12546. * - MSG_TYPE
  12547. * Bits 7:0
  12548. * Purpose: identifies this as a security specification message
  12549. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  12550. * - SEC_TYPE
  12551. * Bits 14:8
  12552. * Purpose: specifies which type of security applies to the peer
  12553. * Value: htt_sec_type enum value
  12554. * - UNICAST
  12555. * Bit 15
  12556. * Purpose: whether this security is applied to unicast or multicast data
  12557. * Value: 1 -> unicast, 0 -> multicast
  12558. * - PEER_ID
  12559. * Bits 31:16
  12560. * Purpose: The ID number for the peer the security specification is for
  12561. * Value: peer ID
  12562. * - MICHAEL_KEY_K0
  12563. * Bits 31:0
  12564. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  12565. * Value: Michael Key K0 (if security type is TKIP)
  12566. * - MICHAEL_KEY_K1
  12567. * Bits 31:0
  12568. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  12569. * Value: Michael Key K1 (if security type is TKIP)
  12570. * - WAPI_RSC_LOW0
  12571. * Bits 31:0
  12572. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  12573. * Value: WAPI RSC Low0 (if security type is WAPI)
  12574. * - WAPI_RSC_LOW1
  12575. * Bits 31:0
  12576. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  12577. * Value: WAPI RSC Low1 (if security type is WAPI)
  12578. * - WAPI_RSC_HI0
  12579. * Bits 31:0
  12580. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  12581. * Value: WAPI RSC Hi0 (if security type is WAPI)
  12582. * - WAPI_RSC_HI1
  12583. * Bits 31:0
  12584. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  12585. * Value: WAPI RSC Hi1 (if security type is WAPI)
  12586. */
  12587. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  12588. #define HTT_SEC_IND_SEC_TYPE_S 8
  12589. #define HTT_SEC_IND_UNICAST_M 0x00008000
  12590. #define HTT_SEC_IND_UNICAST_S 15
  12591. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  12592. #define HTT_SEC_IND_PEER_ID_S 16
  12593. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  12594. do { \
  12595. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  12596. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  12597. } while (0)
  12598. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  12599. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  12600. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  12601. do { \
  12602. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  12603. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  12604. } while (0)
  12605. #define HTT_SEC_IND_UNICAST_GET(word) \
  12606. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  12607. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  12608. do { \
  12609. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  12610. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  12611. } while (0)
  12612. #define HTT_SEC_IND_PEER_ID_GET(word) \
  12613. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  12614. #define HTT_SEC_IND_BYTES 28
  12615. /**
  12616. * @brief target -> host rx ADDBA / DELBA message definitions
  12617. *
  12618. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  12619. *
  12620. * @details
  12621. * The following diagram shows the format of the rx ADDBA message sent
  12622. * from the target to the host:
  12623. *
  12624. * |31 20|19 16|15 8|7 0|
  12625. * |---------------------------------------------------------------------|
  12626. * | peer ID | TID | window size | msg type |
  12627. * |---------------------------------------------------------------------|
  12628. *
  12629. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  12630. *
  12631. * The following diagram shows the format of the rx DELBA message sent
  12632. * from the target to the host:
  12633. *
  12634. * |31 20|19 16|15 10|9 8|7 0|
  12635. * |---------------------------------------------------------------------|
  12636. * | peer ID | TID | window size | IR| msg type |
  12637. * |---------------------------------------------------------------------|
  12638. *
  12639. * The following field definitions describe the format of the rx ADDBA
  12640. * and DELBA messages sent from the target to the host.
  12641. * - MSG_TYPE
  12642. * Bits 7:0
  12643. * Purpose: identifies this as an rx ADDBA or DELBA message
  12644. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  12645. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  12646. * - IR (initiator / recipient)
  12647. * Bits 9:8 (DELBA only)
  12648. * Purpose: specify whether the DELBA handshake was initiated by the
  12649. * local STA/AP, or by the peer STA/AP
  12650. * Value:
  12651. * 0 - unspecified
  12652. * 1 - initiator (a.k.a. originator)
  12653. * 2 - recipient (a.k.a. responder)
  12654. * 3 - unused / reserved
  12655. * - WIN_SIZE
  12656. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  12657. * Purpose: Specifies the length of the block ack window (max = 64).
  12658. * Value:
  12659. * block ack window length specified by the received ADDBA/DELBA
  12660. * management message.
  12661. * - TID
  12662. * Bits 19:16
  12663. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12664. * Value:
  12665. * TID specified by the received ADDBA or DELBA management message.
  12666. * - PEER_ID
  12667. * Bits 31:20
  12668. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12669. * Value:
  12670. * ID (hash value) used by the host for fast, direct lookup of
  12671. * host SW peer info, including rx reorder states.
  12672. */
  12673. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  12674. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  12675. #define HTT_RX_ADDBA_TID_M 0xf0000
  12676. #define HTT_RX_ADDBA_TID_S 16
  12677. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  12678. #define HTT_RX_ADDBA_PEER_ID_S 20
  12679. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  12680. do { \
  12681. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  12682. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  12683. } while (0)
  12684. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  12685. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12686. #define HTT_RX_ADDBA_TID_SET(word, value) \
  12687. do { \
  12688. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  12689. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  12690. } while (0)
  12691. #define HTT_RX_ADDBA_TID_GET(word) \
  12692. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  12693. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  12694. do { \
  12695. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  12696. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  12697. } while (0)
  12698. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  12699. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  12700. #define HTT_RX_ADDBA_BYTES 4
  12701. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  12702. #define HTT_RX_DELBA_INITIATOR_S 8
  12703. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  12704. #define HTT_RX_DELBA_WIN_SIZE_S 10
  12705. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  12706. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  12707. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  12708. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  12709. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  12710. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  12711. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  12712. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  12713. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12714. do { \
  12715. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12716. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12717. } while (0)
  12718. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12719. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12720. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  12721. do { \
  12722. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  12723. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  12724. } while (0)
  12725. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  12726. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  12727. #define HTT_RX_DELBA_BYTES 4
  12728. /**
  12729. * @brief target -> host rx ADDBA / DELBA message definitions
  12730. *
  12731. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN
  12732. *
  12733. * @details
  12734. * The following diagram shows the format of the rx ADDBA extn message sent
  12735. * from the target to the host:
  12736. *
  12737. * |31 20|19 16|15 13|12 8|7 0|
  12738. * |---------------------------------------------------------------------|
  12739. * | peer ID | TID | reserved | msg type |
  12740. * |---------------------------------------------------------------------|
  12741. * | reserved | window size |
  12742. * |---------------------------------------------------------------------|
  12743. *
  12744. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA_EXTN
  12745. *
  12746. * The following diagram shows the format of the rx DELBA message sent
  12747. * from the target to the host:
  12748. *
  12749. * |31 20|19 16|15 13|12 10|9 8|7 0|
  12750. * |---------------------------------------------------------------------|
  12751. * | peer ID | TID | reserved | IR| msg type |
  12752. * |---------------------------------------------------------------------|
  12753. * | reserved | window size |
  12754. * |---------------------------------------------------------------------|
  12755. *
  12756. * The following field definitions describe the format of the rx ADDBA
  12757. * and DELBA messages sent from the target to the host.
  12758. * - MSG_TYPE
  12759. * Bits 7:0
  12760. * Purpose: identifies this as an rx ADDBA or DELBA message
  12761. * Value: ADDBA -> 0x31 (HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN),
  12762. * DELBA -> 0x32 (HTT_T2H_MSG_TYPE_RX_DELBA_EXTN)
  12763. * - IR (initiator / recipient)
  12764. * Bits 9:8 (DELBA only)
  12765. * Purpose: specify whether the DELBA handshake was initiated by the
  12766. * local STA/AP, or by the peer STA/AP
  12767. * Value:
  12768. * 0 - unspecified
  12769. * 1 - initiator (a.k.a. originator)
  12770. * 2 - recipient (a.k.a. responder)
  12771. * 3 - unused / reserved
  12772. * Value:
  12773. * block ack window length specified by the received ADDBA/DELBA
  12774. * management message.
  12775. * - TID
  12776. * Bits 19:16
  12777. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12778. * Value:
  12779. * TID specified by the received ADDBA or DELBA management message.
  12780. * - PEER_ID
  12781. * Bits 31:20
  12782. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12783. * Value:
  12784. * ID (hash value) used by the host for fast, direct lookup of
  12785. * host SW peer info, including rx reorder states.
  12786. * == DWORD 1
  12787. * - WIN_SIZE
  12788. * Bits 12:0 for ADDBA, bits 12:0 for DELBA
  12789. * Purpose: Specifies the length of the block ack window (max = 8191).
  12790. */
  12791. #define HTT_RX_ADDBA_EXTN_TID_M 0xf0000
  12792. #define HTT_RX_ADDBA_EXTN_TID_S 16
  12793. #define HTT_RX_ADDBA_EXTN_PEER_ID_M 0xfff00000
  12794. #define HTT_RX_ADDBA_EXTN_PEER_ID_S 20
  12795. /*--- Dword 0 ---*/
  12796. #define HTT_RX_ADDBA_EXTN_TID_SET(word, value) \
  12797. do { \
  12798. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_TID, value); \
  12799. (word) |= (value) << HTT_RX_ADDBA_EXTN_TID_S; \
  12800. } while (0)
  12801. #define HTT_RX_ADDBA_EXTN_TID_GET(word) \
  12802. (((word) & HTT_RX_ADDBA_EXTN_TID_M) >> HTT_RX_ADDBA_EXTN_TID_S)
  12803. #define HTT_RX_ADDBA_EXTN_PEER_ID_SET(word, value) \
  12804. do { \
  12805. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_PEER_ID, value); \
  12806. (word) |= (value) << HTT_RX_ADDBA_EXTN_PEER_ID_S; \
  12807. } while (0)
  12808. #define HTT_RX_ADDBA_EXTN_PEER_ID_GET(word) \
  12809. (((word) & HTT_RX_ADDBA_EXTN_PEER_ID_M) >> HTT_RX_ADDBA_EXTN_PEER_ID_S)
  12810. /*--- Dword 1 ---*/
  12811. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_M 0x1fff
  12812. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_S 0
  12813. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_SET(word, value) \
  12814. do { \
  12815. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_WIN_SIZE, value); \
  12816. (word) |= (value) << HTT_RX_ADDBA_EXTN_WIN_SIZE_S; \
  12817. } while (0)
  12818. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_GET(word) \
  12819. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12820. #define HTT_RX_ADDBA_EXTN_BYTES 8
  12821. #define HTT_RX_DELBA_EXTN_INITIATOR_M 0x00000300
  12822. #define HTT_RX_DELBA_EXTN_INITIATOR_S 8
  12823. #define HTT_RX_DELBA_EXTN_TID_M 0xf0000
  12824. #define HTT_RX_DELBA_EXTN_TID_S 16
  12825. #define HTT_RX_DELBA_EXTN_PEER_ID_M 0xfff00000
  12826. #define HTT_RX_DELBA_EXTN_PEER_ID_S 20
  12827. /*--- Dword 0 ---*/
  12828. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12829. do { \
  12830. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12831. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12832. } while (0)
  12833. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12834. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12835. #define HTT_RX_DELBA_EXTN_TID_SET(word, value) \
  12836. do { \
  12837. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_TID, value); \
  12838. (word) |= (value) << HTT_RX_DELBA_EXTN_TID_S; \
  12839. } while (0)
  12840. #define HTT_RX_DELBA_EXTN_TID_GET(word) \
  12841. (((word) & HTT_RX_DELBA_EXTN_TID_M) >> HTT_RX_DELBA_EXTN_TID_S)
  12842. #define HTT_RX_DELBA_EXTN_PEER_ID_SET(word, value) \
  12843. do { \
  12844. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_PEER_ID, value); \
  12845. (word) |= (value) << HTT_RX_DELBA_EXTN_PEER_ID_S; \
  12846. } while (0)
  12847. #define HTT_RX_DELBA_EXTN_PEER_ID_GET(word) \
  12848. (((word) & HTT_RX_DELBA_EXTN_PEER_ID_M) >> HTT_RX_DELBA_EXTN_PEER_ID_S)
  12849. /*--- Dword 1 ---*/
  12850. #define HTT_RX_DELBA_EXTN_WIN_SIZE_M 0x1fff
  12851. #define HTT_RX_DELBA_EXTN_WIN_SIZE_S 0
  12852. #define HTT_RX_DELBA_EXTN_WIN_SIZE_SET(word, value) \
  12853. do { \
  12854. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_WIN_SIZE, value); \
  12855. (word) |= (value) << HTT_RX_DELBA_EXTN_WIN_SIZE_S; \
  12856. } while (0)
  12857. #define HTT_RX_DELBA_EXTN_WIN_SIZE_GET(word) \
  12858. (((word) & HTT_RX_DELBA_EXTN_WIN_SIZE_M) >> HTT_RX_DELBA_EXTN_WIN_SIZE_S)
  12859. #define HTT_RX_DELBA_EXTN_BYTES 8
  12860. /**
  12861. * @brief tx queue group information element definition
  12862. *
  12863. * @details
  12864. * The following diagram shows the format of the tx queue group
  12865. * information element, which can be included in target --> host
  12866. * messages to specify the number of tx "credits" (tx descriptors
  12867. * for LL, or tx buffers for HL) available to a particular group
  12868. * of host-side tx queues, and which host-side tx queues belong to
  12869. * the group.
  12870. *
  12871. * |31|30 24|23 16|15|14|13 0|
  12872. * |------------------------------------------------------------------------|
  12873. * | X| reserved | tx queue grp ID | A| S| credit count |
  12874. * |------------------------------------------------------------------------|
  12875. * | vdev ID mask | AC mask |
  12876. * |------------------------------------------------------------------------|
  12877. *
  12878. * The following definitions describe the fields within the tx queue group
  12879. * information element:
  12880. * - credit_count
  12881. * Bits 13:1
  12882. * Purpose: specify how many tx credits are available to the tx queue group
  12883. * Value: An absolute or relative, positive or negative credit value
  12884. * The 'A' bit specifies whether the value is absolute or relative.
  12885. * The 'S' bit specifies whether the value is positive or negative.
  12886. * A negative value can only be relative, not absolute.
  12887. * An absolute value replaces any prior credit value the host has for
  12888. * the tx queue group in question.
  12889. * A relative value is added to the prior credit value the host has for
  12890. * the tx queue group in question.
  12891. * - sign
  12892. * Bit 14
  12893. * Purpose: specify whether the credit count is positive or negative
  12894. * Value: 0 -> positive, 1 -> negative
  12895. * - absolute
  12896. * Bit 15
  12897. * Purpose: specify whether the credit count is absolute or relative
  12898. * Value: 0 -> relative, 1 -> absolute
  12899. * - txq_group_id
  12900. * Bits 23:16
  12901. * Purpose: indicate which tx queue group's credit and/or membership are
  12902. * being specified
  12903. * Value: 0 to max_tx_queue_groups-1
  12904. * - reserved
  12905. * Bits 30:16
  12906. * Value: 0x0
  12907. * - eXtension
  12908. * Bit 31
  12909. * Purpose: specify whether another tx queue group info element follows
  12910. * Value: 0 -> no more tx queue group information elements
  12911. * 1 -> another tx queue group information element immediately follows
  12912. * - ac_mask
  12913. * Bits 15:0
  12914. * Purpose: specify which Access Categories belong to the tx queue group
  12915. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  12916. * the tx queue group.
  12917. * The AC bit-mask values are obtained by left-shifting by the
  12918. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  12919. * - vdev_id_mask
  12920. * Bits 31:16
  12921. * Purpose: specify which vdev's tx queues belong to the tx queue group
  12922. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  12923. * belong to the tx queue group.
  12924. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  12925. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  12926. */
  12927. PREPACK struct htt_txq_group {
  12928. A_UINT32
  12929. credit_count: 14,
  12930. sign: 1,
  12931. absolute: 1,
  12932. tx_queue_group_id: 8,
  12933. reserved0: 7,
  12934. extension: 1;
  12935. A_UINT32
  12936. ac_mask: 16,
  12937. vdev_id_mask: 16;
  12938. } POSTPACK;
  12939. /* first word */
  12940. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  12941. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  12942. #define HTT_TXQ_GROUP_SIGN_S 14
  12943. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  12944. #define HTT_TXQ_GROUP_ABS_S 15
  12945. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  12946. #define HTT_TXQ_GROUP_ID_S 16
  12947. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  12948. #define HTT_TXQ_GROUP_EXT_S 31
  12949. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  12950. /* second word */
  12951. #define HTT_TXQ_GROUP_AC_MASK_S 0
  12952. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  12953. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  12954. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  12955. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  12956. do { \
  12957. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  12958. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  12959. } while (0)
  12960. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  12961. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  12962. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  12963. do { \
  12964. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  12965. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  12966. } while (0)
  12967. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  12968. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  12969. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  12970. do { \
  12971. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  12972. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  12973. } while (0)
  12974. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  12975. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  12976. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  12977. do { \
  12978. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  12979. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  12980. } while (0)
  12981. #define HTT_TXQ_GROUP_ID_GET(_info) \
  12982. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  12983. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  12984. do { \
  12985. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  12986. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  12987. } while (0)
  12988. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  12989. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  12990. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  12991. do { \
  12992. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  12993. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  12994. } while (0)
  12995. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  12996. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  12997. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  12998. do { \
  12999. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  13000. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  13001. } while (0)
  13002. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  13003. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  13004. /**
  13005. * @brief target -> host TX completion indication message definition
  13006. *
  13007. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  13008. *
  13009. * @details
  13010. * The following diagram shows the format of the TX completion indication sent
  13011. * from the target to the host
  13012. *
  13013. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  13014. * |-------------------------------------------------------------------|
  13015. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  13016. * |-------------------------------------------------------------------|
  13017. * payload:| MSDU1 ID | MSDU0 ID |
  13018. * |-------------------------------------------------------------------|
  13019. * : MSDU3 ID | MSDU2 ID :
  13020. * |-------------------------------------------------------------------|
  13021. * | struct htt_tx_compl_ind_append_retries |
  13022. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13023. * | struct htt_tx_compl_ind_append_tx_tstamp |
  13024. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13025. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  13026. * |-------------------------------------------------------------------|
  13027. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  13028. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13029. * | MSDU0 tx_tsf64_low |
  13030. * |-------------------------------------------------------------------|
  13031. * | MSDU0 tx_tsf64_high |
  13032. * |-------------------------------------------------------------------|
  13033. * | MSDU1 tx_tsf64_low |
  13034. * |-------------------------------------------------------------------|
  13035. * | MSDU1 tx_tsf64_high |
  13036. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13037. * | phy_timestamp |
  13038. * |-------------------------------------------------------------------|
  13039. * | rate specs (see below) |
  13040. * |-------------------------------------------------------------------|
  13041. * | seqctrl | framectrl |
  13042. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13043. * Where:
  13044. * A0 = append (a.k.a. append0)
  13045. * A1 = append1
  13046. * TP = MSDU tx power presence
  13047. * A2 = append2
  13048. * A3 = append3
  13049. * A4 = append4
  13050. *
  13051. * The following field definitions describe the format of the TX completion
  13052. * indication sent from the target to the host
  13053. * Header fields:
  13054. * - msg_type
  13055. * Bits 7:0
  13056. * Purpose: identifies this as HTT TX completion indication
  13057. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  13058. * - status
  13059. * Bits 10:8
  13060. * Purpose: the TX completion status of payload fragmentations descriptors
  13061. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  13062. * - tid
  13063. * Bits 14:11
  13064. * Purpose: the tid associated with those fragmentation descriptors. It is
  13065. * valid or not, depending on the tid_invalid bit.
  13066. * Value: 0 to 15
  13067. * - tid_invalid
  13068. * Bits 15:15
  13069. * Purpose: this bit indicates whether the tid field is valid or not
  13070. * Value: 0 indicates valid; 1 indicates invalid
  13071. * - num
  13072. * Bits 23:16
  13073. * Purpose: the number of payload in this indication
  13074. * Value: 1 to 255
  13075. * - append (a.k.a. append0)
  13076. * Bits 24:24
  13077. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  13078. * the number of tx retries for one MSDU at the end of this message
  13079. * Value: 0 indicates no appending; 1 indicates appending
  13080. * - append1
  13081. * Bits 25:25
  13082. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  13083. * contains the timestamp info for each TX msdu id in payload.
  13084. * The order of the timestamps matches the order of the MSDU IDs.
  13085. * Note that a big-endian host needs to account for the reordering
  13086. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  13087. * conversion) when determining which tx timestamp corresponds to
  13088. * which MSDU ID.
  13089. * Value: 0 indicates no appending; 1 indicates appending
  13090. * - msdu_tx_power_presence
  13091. * Bits 26:26
  13092. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  13093. * for each MSDU referenced by the TX_COMPL_IND message.
  13094. * The tx power is reported in 0.5 dBm units.
  13095. * The order of the per-MSDU tx power reports matches the order
  13096. * of the MSDU IDs.
  13097. * Note that a big-endian host needs to account for the reordering
  13098. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  13099. * conversion) when determining which Tx Power corresponds to
  13100. * which MSDU ID.
  13101. * Value: 0 indicates MSDU tx power reports are not appended,
  13102. * 1 indicates MSDU tx power reports are appended
  13103. * - append2
  13104. * Bits 27:27
  13105. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  13106. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  13107. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  13108. * same for all MSDUs within a single PPDU, the RSSI is duplicated
  13109. * for each MSDU, for convenience.
  13110. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  13111. * this append2 bit is set).
  13112. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  13113. * dB above the noise floor.
  13114. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  13115. * 1 indicates MSDU ACK RSSI values are appended.
  13116. * - append3
  13117. * Bits 28:28
  13118. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  13119. * contains the tx tsf info based on wlan global TSF for
  13120. * each TX msdu id in payload.
  13121. * The order of the tx tsf matches the order of the MSDU IDs.
  13122. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  13123. * values to indicate the the lower 32 bits and higher 32 bits of
  13124. * the tx tsf.
  13125. * The tx_tsf64 here represents the time MSDU was acked and the
  13126. * tx_tsf64 has microseconds units.
  13127. * Value: 0 indicates no appending; 1 indicates appending
  13128. * - append4
  13129. * Bits 29:29
  13130. * Purpose: Indicate whether data frame control fields and fields required
  13131. * for radio tap header are appended for each MSDU in TX_COMP_IND
  13132. * message. The order of the this message matches the order of
  13133. * the MSDU IDs.
  13134. * Value: 0 indicates frame control fields and fields required for
  13135. * radio tap header values are not appended,
  13136. * 1 indicates frame control fields and fields required for
  13137. * radio tap header values are appended.
  13138. * Payload fields:
  13139. * - hmsdu_id
  13140. * Bits 15:0
  13141. * Purpose: this ID is used to track the Tx buffer in host
  13142. * Value: 0 to "size of host MSDU descriptor pool - 1"
  13143. */
  13144. PREPACK struct htt_tx_data_hdr_information {
  13145. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  13146. A_UINT32 /* word 1 */
  13147. /* preamble:
  13148. * 0-OFDM,
  13149. * 1-CCk,
  13150. * 2-HT,
  13151. * 3-VHT
  13152. */
  13153. preamble: 2, /* [1:0] */
  13154. /* mcs:
  13155. * In case of HT preamble interpret
  13156. * MCS along with NSS.
  13157. * Valid values for HT are 0 to 7.
  13158. * HT mcs 0 with NSS 2 is mcs 8.
  13159. * Valid values for VHT are 0 to 9.
  13160. */
  13161. mcs: 4, /* [5:2] */
  13162. /* rate:
  13163. * This is applicable only for
  13164. * CCK and OFDM preamble type
  13165. * rate 0: OFDM 48 Mbps,
  13166. * 1: OFDM 24 Mbps,
  13167. * 2: OFDM 12 Mbps
  13168. * 3: OFDM 6 Mbps
  13169. * 4: OFDM 54 Mbps
  13170. * 5: OFDM 36 Mbps
  13171. * 6: OFDM 18 Mbps
  13172. * 7: OFDM 9 Mbps
  13173. * rate 0: CCK 11 Mbps Long
  13174. * 1: CCK 5.5 Mbps Long
  13175. * 2: CCK 2 Mbps Long
  13176. * 3: CCK 1 Mbps Long
  13177. * 4: CCK 11 Mbps Short
  13178. * 5: CCK 5.5 Mbps Short
  13179. * 6: CCK 2 Mbps Short
  13180. */
  13181. rate : 3, /* [ 8: 6] */
  13182. rssi : 8, /* [16: 9] units=dBm */
  13183. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  13184. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  13185. stbc : 1, /* [22] */
  13186. sgi : 1, /* [23] */
  13187. ldpc : 1, /* [24] */
  13188. beamformed: 1, /* [25] */
  13189. /* tx_retry_cnt:
  13190. * Indicates retry count of data tx frames provided by the host.
  13191. */
  13192. tx_retry_cnt: 6; /* [31:26] */
  13193. A_UINT32 /* word 2 */
  13194. framectrl:16, /* [15: 0] */
  13195. seqno:16; /* [31:16] */
  13196. } POSTPACK;
  13197. #define HTT_TX_COMPL_IND_STATUS_S 8
  13198. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  13199. #define HTT_TX_COMPL_IND_TID_S 11
  13200. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  13201. #define HTT_TX_COMPL_IND_TID_INV_S 15
  13202. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  13203. #define HTT_TX_COMPL_IND_NUM_S 16
  13204. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  13205. #define HTT_TX_COMPL_IND_APPEND_S 24
  13206. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  13207. #define HTT_TX_COMPL_IND_APPEND1_S 25
  13208. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  13209. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  13210. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  13211. #define HTT_TX_COMPL_IND_APPEND2_S 27
  13212. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  13213. #define HTT_TX_COMPL_IND_APPEND3_S 28
  13214. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  13215. #define HTT_TX_COMPL_IND_APPEND4_S 29
  13216. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  13217. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  13218. do { \
  13219. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  13220. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  13221. } while (0)
  13222. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  13223. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  13224. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  13225. do { \
  13226. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  13227. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  13228. } while (0)
  13229. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  13230. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  13231. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  13232. do { \
  13233. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  13234. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  13235. } while (0)
  13236. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  13237. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  13238. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  13239. do { \
  13240. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  13241. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  13242. } while (0)
  13243. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  13244. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  13245. HTT_TX_COMPL_IND_TID_INV_S)
  13246. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  13247. do { \
  13248. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  13249. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  13250. } while (0)
  13251. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  13252. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  13253. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  13254. do { \
  13255. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  13256. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  13257. } while (0)
  13258. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  13259. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  13260. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  13261. do { \
  13262. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  13263. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  13264. } while (0)
  13265. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  13266. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  13267. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  13268. do { \
  13269. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  13270. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  13271. } while (0)
  13272. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  13273. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  13274. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  13275. do { \
  13276. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  13277. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  13278. } while (0)
  13279. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  13280. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  13281. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  13282. do { \
  13283. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  13284. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  13285. } while (0)
  13286. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  13287. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  13288. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  13289. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  13290. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  13291. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  13292. #define HTT_TX_COMPL_IND_STAT_OK 0
  13293. /* DISCARD:
  13294. * current meaning:
  13295. * MSDUs were queued for transmission but filtered by HW or SW
  13296. * without any over the air attempts
  13297. * legacy meaning (HL Rome):
  13298. * MSDUs were discarded by the target FW without any over the air
  13299. * attempts due to lack of space
  13300. */
  13301. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  13302. /* NO_ACK:
  13303. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  13304. */
  13305. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  13306. /* POSTPONE:
  13307. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  13308. * be downloaded again later (in the appropriate order), when they are
  13309. * deliverable.
  13310. */
  13311. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  13312. /*
  13313. * The PEER_DEL tx completion status is used for HL cases
  13314. * where the peer the frame is for has been deleted.
  13315. * The host has already discarded its copy of the frame, but
  13316. * it still needs the tx completion to restore its credit.
  13317. */
  13318. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  13319. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  13320. #define HTT_TX_COMPL_IND_STAT_DROP 5
  13321. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  13322. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  13323. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  13324. PREPACK struct htt_tx_compl_ind_base {
  13325. A_UINT32 hdr;
  13326. A_UINT16 payload[1/*or more*/];
  13327. } POSTPACK;
  13328. PREPACK struct htt_tx_compl_ind_append_retries {
  13329. A_UINT16 msdu_id;
  13330. A_UINT8 tx_retries;
  13331. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  13332. 0: this is the last append_retries struct */
  13333. } POSTPACK;
  13334. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  13335. A_UINT32 timestamp[1/*or more*/];
  13336. } POSTPACK;
  13337. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  13338. A_UINT32 tx_tsf64_low;
  13339. A_UINT32 tx_tsf64_high;
  13340. } POSTPACK;
  13341. /* htt_tx_data_hdr_information payload extension fields: */
  13342. /* DWORD zero */
  13343. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  13344. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  13345. /* DWORD one */
  13346. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  13347. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  13348. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  13349. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  13350. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  13351. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  13352. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  13353. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  13354. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  13355. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  13356. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  13357. #define HTT_FW_TX_DATA_HDR_BW_S 19
  13358. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  13359. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  13360. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  13361. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  13362. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  13363. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  13364. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  13365. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  13366. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  13367. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  13368. /* DWORD two */
  13369. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  13370. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  13371. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  13372. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  13373. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  13374. do { \
  13375. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  13376. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  13377. } while (0)
  13378. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  13379. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  13380. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  13381. do { \
  13382. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  13383. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  13384. } while (0)
  13385. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  13386. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  13387. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  13388. do { \
  13389. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  13390. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  13391. } while (0)
  13392. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  13393. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  13394. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  13395. do { \
  13396. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  13397. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  13398. } while (0)
  13399. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  13400. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  13401. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  13402. do { \
  13403. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  13404. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  13405. } while (0)
  13406. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  13407. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  13408. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  13409. do { \
  13410. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  13411. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  13412. } while (0)
  13413. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  13414. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  13415. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  13416. do { \
  13417. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  13418. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  13419. } while (0)
  13420. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  13421. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  13422. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  13423. do { \
  13424. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  13425. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  13426. } while (0)
  13427. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  13428. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  13429. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  13430. do { \
  13431. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  13432. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  13433. } while (0)
  13434. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  13435. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  13436. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  13437. do { \
  13438. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  13439. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  13440. } while (0)
  13441. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  13442. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  13443. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  13444. do { \
  13445. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  13446. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  13447. } while (0)
  13448. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  13449. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  13450. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  13451. do { \
  13452. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  13453. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  13454. } while (0)
  13455. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  13456. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  13457. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  13458. do { \
  13459. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  13460. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  13461. } while (0)
  13462. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  13463. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  13464. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  13465. do { \
  13466. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  13467. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  13468. } while (0)
  13469. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  13470. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  13471. /**
  13472. * @brief target -> host rate-control update indication message
  13473. *
  13474. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  13475. *
  13476. * @details
  13477. * The following diagram shows the format of the RC Update message
  13478. * sent from the target to the host, while processing the tx-completion
  13479. * of a transmitted PPDU.
  13480. *
  13481. * |31 24|23 16|15 8|7 0|
  13482. * |-------------------------------------------------------------|
  13483. * | peer ID | vdev ID | msg_type |
  13484. * |-------------------------------------------------------------|
  13485. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  13486. * |-------------------------------------------------------------|
  13487. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  13488. * |-------------------------------------------------------------|
  13489. * | : |
  13490. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  13491. * | : |
  13492. * |-------------------------------------------------------------|
  13493. * | : |
  13494. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  13495. * | : |
  13496. * |-------------------------------------------------------------|
  13497. * : :
  13498. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13499. *
  13500. */
  13501. typedef struct {
  13502. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  13503. A_UINT32 rate_code_flags;
  13504. A_UINT32 flags; /* Encodes information such as excessive
  13505. retransmission, aggregate, some info
  13506. from .11 frame control,
  13507. STBC, LDPC, (SGI and Tx Chain Mask
  13508. are encoded in ptx_rc->flags field),
  13509. AMPDU truncation (BT/time based etc.),
  13510. RTS/CTS attempt */
  13511. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  13512. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  13513. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  13514. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  13515. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  13516. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  13517. } HTT_RC_TX_DONE_PARAMS;
  13518. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  13519. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  13520. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  13521. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  13522. #define HTT_RC_UPDATE_VDEVID_S 8
  13523. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  13524. #define HTT_RC_UPDATE_PEERID_S 16
  13525. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  13526. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  13527. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  13528. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  13529. do { \
  13530. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  13531. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  13532. } while (0)
  13533. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  13534. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  13535. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  13536. do { \
  13537. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  13538. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  13539. } while (0)
  13540. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  13541. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  13542. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  13543. do { \
  13544. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  13545. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  13546. } while (0)
  13547. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  13548. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  13549. /**
  13550. * @brief target -> host rx fragment indication message definition
  13551. *
  13552. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  13553. *
  13554. * @details
  13555. * The following field definitions describe the format of the rx fragment
  13556. * indication message sent from the target to the host.
  13557. * The rx fragment indication message shares the format of the
  13558. * rx indication message, but not all fields from the rx indication message
  13559. * are relevant to the rx fragment indication message.
  13560. *
  13561. *
  13562. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  13563. * |-----------+-------------------+---------------------+-------------|
  13564. * | peer ID | |FV| ext TID | msg type |
  13565. * |-------------------------------------------------------------------|
  13566. * | | flush | flush |
  13567. * | | end | start |
  13568. * | | seq num | seq num |
  13569. * |-------------------------------------------------------------------|
  13570. * | reserved | FW rx desc bytes |
  13571. * |-------------------------------------------------------------------|
  13572. * | | FW MSDU Rx |
  13573. * | | desc B0 |
  13574. * |-------------------------------------------------------------------|
  13575. * Header fields:
  13576. * - MSG_TYPE
  13577. * Bits 7:0
  13578. * Purpose: identifies this as an rx fragment indication message
  13579. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  13580. * - EXT_TID
  13581. * Bits 12:8
  13582. * Purpose: identify the traffic ID of the rx data, including
  13583. * special "extended" TID values for multicast, broadcast, and
  13584. * non-QoS data frames
  13585. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  13586. * - FLUSH_VALID (FV)
  13587. * Bit 13
  13588. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  13589. * is valid
  13590. * Value:
  13591. * 1 -> flush IE is valid and needs to be processed
  13592. * 0 -> flush IE is not valid and should be ignored
  13593. * - PEER_ID
  13594. * Bits 31:16
  13595. * Purpose: Identify, by ID, which peer sent the rx data
  13596. * Value: ID of the peer who sent the rx data
  13597. * - FLUSH_SEQ_NUM_START
  13598. * Bits 5:0
  13599. * Purpose: Indicate the start of a series of MPDUs to flush
  13600. * Not all MPDUs within this series are necessarily valid - the host
  13601. * must check each sequence number within this range to see if the
  13602. * corresponding MPDU is actually present.
  13603. * This field is only valid if the FV bit is set.
  13604. * Value:
  13605. * The sequence number for the first MPDUs to check to flush.
  13606. * The sequence number is masked by 0x3f.
  13607. * - FLUSH_SEQ_NUM_END
  13608. * Bits 11:6
  13609. * Purpose: Indicate the end of a series of MPDUs to flush
  13610. * Value:
  13611. * The sequence number one larger than the sequence number of the
  13612. * last MPDU to check to flush.
  13613. * The sequence number is masked by 0x3f.
  13614. * Not all MPDUs within this series are necessarily valid - the host
  13615. * must check each sequence number within this range to see if the
  13616. * corresponding MPDU is actually present.
  13617. * This field is only valid if the FV bit is set.
  13618. * Rx descriptor fields:
  13619. * - FW_RX_DESC_BYTES
  13620. * Bits 15:0
  13621. * Purpose: Indicate how many bytes in the Rx indication are used for
  13622. * FW Rx descriptors
  13623. * Value: 1
  13624. */
  13625. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  13626. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  13627. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  13628. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  13629. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  13630. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  13631. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  13632. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  13633. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  13634. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  13635. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  13636. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  13637. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  13638. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  13639. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  13640. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  13641. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  13642. #define HTT_RX_FRAG_IND_BYTES \
  13643. (4 /* msg hdr */ + \
  13644. 4 /* flush spec */ + \
  13645. 4 /* (unused) FW rx desc bytes spec */ + \
  13646. 4 /* FW rx desc */)
  13647. /**
  13648. * @brief target -> host test message definition
  13649. *
  13650. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  13651. *
  13652. * @details
  13653. * The following field definitions describe the format of the test
  13654. * message sent from the target to the host.
  13655. * The message consists of a 4-octet header, followed by a variable
  13656. * number of 32-bit integer values, followed by a variable number
  13657. * of 8-bit character values.
  13658. *
  13659. * |31 16|15 8|7 0|
  13660. * |-----------------------------------------------------------|
  13661. * | num chars | num ints | msg type |
  13662. * |-----------------------------------------------------------|
  13663. * | int 0 |
  13664. * |-----------------------------------------------------------|
  13665. * | int 1 |
  13666. * |-----------------------------------------------------------|
  13667. * | ... |
  13668. * |-----------------------------------------------------------|
  13669. * | char 3 | char 2 | char 1 | char 0 |
  13670. * |-----------------------------------------------------------|
  13671. * | | | ... | char 4 |
  13672. * |-----------------------------------------------------------|
  13673. * - MSG_TYPE
  13674. * Bits 7:0
  13675. * Purpose: identifies this as a test message
  13676. * Value: HTT_MSG_TYPE_TEST
  13677. * - NUM_INTS
  13678. * Bits 15:8
  13679. * Purpose: indicate how many 32-bit integers follow the message header
  13680. * - NUM_CHARS
  13681. * Bits 31:16
  13682. * Purpose: indicate how many 8-bit characters follow the series of integers
  13683. */
  13684. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  13685. #define HTT_RX_TEST_NUM_INTS_S 8
  13686. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  13687. #define HTT_RX_TEST_NUM_CHARS_S 16
  13688. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  13689. do { \
  13690. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  13691. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  13692. } while (0)
  13693. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  13694. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  13695. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  13696. do { \
  13697. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  13698. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  13699. } while (0)
  13700. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  13701. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  13702. /**
  13703. * @brief target -> host packet log message
  13704. *
  13705. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  13706. *
  13707. * @details
  13708. * The following field definitions describe the format of the packet log
  13709. * message sent from the target to the host.
  13710. * The message consists of a 4-octet header,followed by a variable number
  13711. * of 32-bit character values.
  13712. *
  13713. * |31 16|15 12|11 10|9 8|7 0|
  13714. * |------------------------------------------------------------------|
  13715. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  13716. * |------------------------------------------------------------------|
  13717. * | payload |
  13718. * |------------------------------------------------------------------|
  13719. * - MSG_TYPE
  13720. * Bits 7:0
  13721. * Purpose: identifies this as a pktlog message
  13722. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  13723. * - mac_id
  13724. * Bits 9:8
  13725. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  13726. * Value: 0-3
  13727. * - pdev_id
  13728. * Bits 11:10
  13729. * Purpose: pdev_id
  13730. * Value: 0-3
  13731. * 0 (for rings at SOC level),
  13732. * 1/2/3 PDEV -> 0/1/2
  13733. * - payload_size
  13734. * Bits 31:16
  13735. * Purpose: explicitly specify the payload size
  13736. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  13737. */
  13738. PREPACK struct htt_pktlog_msg {
  13739. A_UINT32 header;
  13740. A_UINT32 payload[1/* or more */];
  13741. } POSTPACK;
  13742. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  13743. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  13744. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  13745. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  13746. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  13747. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  13748. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  13749. do { \
  13750. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  13751. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  13752. } while (0)
  13753. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  13754. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  13755. HTT_T2H_PKTLOG_MAC_ID_S)
  13756. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  13757. do { \
  13758. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  13759. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  13760. } while (0)
  13761. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  13762. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  13763. HTT_T2H_PKTLOG_PDEV_ID_S)
  13764. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  13765. do { \
  13766. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  13767. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  13768. } while (0)
  13769. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  13770. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  13771. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  13772. /*
  13773. * Rx reorder statistics
  13774. * NB: all the fields must be defined in 4 octets size.
  13775. */
  13776. struct rx_reorder_stats {
  13777. /* Non QoS MPDUs received */
  13778. A_UINT32 deliver_non_qos;
  13779. /* MPDUs received in-order */
  13780. A_UINT32 deliver_in_order;
  13781. /* Flush due to reorder timer expired */
  13782. A_UINT32 deliver_flush_timeout;
  13783. /* Flush due to move out of window */
  13784. A_UINT32 deliver_flush_oow;
  13785. /* Flush due to DELBA */
  13786. A_UINT32 deliver_flush_delba;
  13787. /* MPDUs dropped due to FCS error */
  13788. A_UINT32 fcs_error;
  13789. /* MPDUs dropped due to monitor mode non-data packet */
  13790. A_UINT32 mgmt_ctrl;
  13791. /* Unicast-data MPDUs dropped due to invalid peer */
  13792. A_UINT32 invalid_peer;
  13793. /* MPDUs dropped due to duplication (non aggregation) */
  13794. A_UINT32 dup_non_aggr;
  13795. /* MPDUs dropped due to processed before */
  13796. A_UINT32 dup_past;
  13797. /* MPDUs dropped due to duplicate in reorder queue */
  13798. A_UINT32 dup_in_reorder;
  13799. /* Reorder timeout happened */
  13800. A_UINT32 reorder_timeout;
  13801. /* invalid bar ssn */
  13802. A_UINT32 invalid_bar_ssn;
  13803. /* reorder reset due to bar ssn */
  13804. A_UINT32 ssn_reset;
  13805. /* Flush due to delete peer */
  13806. A_UINT32 deliver_flush_delpeer;
  13807. /* Flush due to offload*/
  13808. A_UINT32 deliver_flush_offload;
  13809. /* Flush due to out of buffer*/
  13810. A_UINT32 deliver_flush_oob;
  13811. /* MPDUs dropped due to PN check fail */
  13812. A_UINT32 pn_fail;
  13813. /* MPDUs dropped due to unable to allocate memory */
  13814. A_UINT32 store_fail;
  13815. /* Number of times the tid pool alloc succeeded */
  13816. A_UINT32 tid_pool_alloc_succ;
  13817. /* Number of times the MPDU pool alloc succeeded */
  13818. A_UINT32 mpdu_pool_alloc_succ;
  13819. /* Number of times the MSDU pool alloc succeeded */
  13820. A_UINT32 msdu_pool_alloc_succ;
  13821. /* Number of times the tid pool alloc failed */
  13822. A_UINT32 tid_pool_alloc_fail;
  13823. /* Number of times the MPDU pool alloc failed */
  13824. A_UINT32 mpdu_pool_alloc_fail;
  13825. /* Number of times the MSDU pool alloc failed */
  13826. A_UINT32 msdu_pool_alloc_fail;
  13827. /* Number of times the tid pool freed */
  13828. A_UINT32 tid_pool_free;
  13829. /* Number of times the MPDU pool freed */
  13830. A_UINT32 mpdu_pool_free;
  13831. /* Number of times the MSDU pool freed */
  13832. A_UINT32 msdu_pool_free;
  13833. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  13834. A_UINT32 msdu_queued;
  13835. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  13836. A_UINT32 msdu_recycled;
  13837. /* Number of MPDUs with invalid peer but A2 found in AST */
  13838. A_UINT32 invalid_peer_a2_in_ast;
  13839. /* Number of MPDUs with invalid peer but A3 found in AST */
  13840. A_UINT32 invalid_peer_a3_in_ast;
  13841. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  13842. A_UINT32 invalid_peer_bmc_mpdus;
  13843. /* Number of MSDUs with err attention word */
  13844. A_UINT32 rxdesc_err_att;
  13845. /* Number of MSDUs with flag of peer_idx_invalid */
  13846. A_UINT32 rxdesc_err_peer_idx_inv;
  13847. /* Number of MSDUs with flag of peer_idx_timeout */
  13848. A_UINT32 rxdesc_err_peer_idx_to;
  13849. /* Number of MSDUs with flag of overflow */
  13850. A_UINT32 rxdesc_err_ov;
  13851. /* Number of MSDUs with flag of msdu_length_err */
  13852. A_UINT32 rxdesc_err_msdu_len;
  13853. /* Number of MSDUs with flag of mpdu_length_err */
  13854. A_UINT32 rxdesc_err_mpdu_len;
  13855. /* Number of MSDUs with flag of tkip_mic_err */
  13856. A_UINT32 rxdesc_err_tkip_mic;
  13857. /* Number of MSDUs with flag of decrypt_err */
  13858. A_UINT32 rxdesc_err_decrypt;
  13859. /* Number of MSDUs with flag of fcs_err */
  13860. A_UINT32 rxdesc_err_fcs;
  13861. /* Number of Unicast (bc_mc bit is not set in attention word)
  13862. * frames with invalid peer handler
  13863. */
  13864. A_UINT32 rxdesc_uc_msdus_inv_peer;
  13865. /* Number of unicast frame directly (direct bit is set in attention word)
  13866. * to DUT with invalid peer handler
  13867. */
  13868. A_UINT32 rxdesc_direct_msdus_inv_peer;
  13869. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  13870. * frames with invalid peer handler
  13871. */
  13872. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  13873. /* Number of MSDUs dropped due to no first MSDU flag */
  13874. A_UINT32 rxdesc_no_1st_msdu;
  13875. /* Number of MSDUs dropped due to ring overflow */
  13876. A_UINT32 msdu_drop_ring_ov;
  13877. /* Number of MSDUs dropped due to FC mismatch */
  13878. A_UINT32 msdu_drop_fc_mismatch;
  13879. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  13880. A_UINT32 msdu_drop_mgmt_remote_ring;
  13881. /* Number of MSDUs dropped due to errors not reported in attention word */
  13882. A_UINT32 msdu_drop_misc;
  13883. /* Number of MSDUs go to offload before reorder */
  13884. A_UINT32 offload_msdu_wal;
  13885. /* Number of data frame dropped by offload after reorder */
  13886. A_UINT32 offload_msdu_reorder;
  13887. /* Number of MPDUs with sequence number in the past and within the BA window */
  13888. A_UINT32 dup_past_within_window;
  13889. /* Number of MPDUs with sequence number in the past and outside the BA window */
  13890. A_UINT32 dup_past_outside_window;
  13891. /* Number of MSDUs with decrypt/MIC error */
  13892. A_UINT32 rxdesc_err_decrypt_mic;
  13893. /* Number of data MSDUs received on both local and remote rings */
  13894. A_UINT32 data_msdus_on_both_rings;
  13895. /* MPDUs never filled */
  13896. A_UINT32 holes_not_filled;
  13897. };
  13898. /*
  13899. * Rx Remote buffer statistics
  13900. * NB: all the fields must be defined in 4 octets size.
  13901. */
  13902. struct rx_remote_buffer_mgmt_stats {
  13903. /* Total number of MSDUs reaped for Rx processing */
  13904. A_UINT32 remote_reaped;
  13905. /* MSDUs recycled within firmware */
  13906. A_UINT32 remote_recycled;
  13907. /* MSDUs stored by Data Rx */
  13908. A_UINT32 data_rx_msdus_stored;
  13909. /* Number of HTT indications from WAL Rx MSDU */
  13910. A_UINT32 wal_rx_ind;
  13911. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  13912. A_UINT32 wal_rx_ind_unconsumed;
  13913. /* Number of HTT indications from Data Rx MSDU */
  13914. A_UINT32 data_rx_ind;
  13915. /* Number of unconsumed HTT indications from Data Rx MSDU */
  13916. A_UINT32 data_rx_ind_unconsumed;
  13917. /* Number of HTT indications from ATHBUF */
  13918. A_UINT32 athbuf_rx_ind;
  13919. /* Number of remote buffers requested for refill */
  13920. A_UINT32 refill_buf_req;
  13921. /* Number of remote buffers filled by the host */
  13922. A_UINT32 refill_buf_rsp;
  13923. /* Number of times MAC hw_index = f/w write_index */
  13924. A_INT32 mac_no_bufs;
  13925. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  13926. A_INT32 fw_indices_equal;
  13927. /* Number of times f/w finds no buffers to post */
  13928. A_INT32 host_no_bufs;
  13929. };
  13930. /*
  13931. * TXBF MU/SU packets and NDPA statistics
  13932. * NB: all the fields must be defined in 4 octets size.
  13933. */
  13934. struct rx_txbf_musu_ndpa_pkts_stats {
  13935. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  13936. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  13937. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  13938. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  13939. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  13940. A_UINT32 reserved[3]; /* must be set to 0x0 */
  13941. };
  13942. /*
  13943. * htt_dbg_stats_status -
  13944. * present - The requested stats have been delivered in full.
  13945. * This indicates that either the stats information was contained
  13946. * in its entirety within this message, or else this message
  13947. * completes the delivery of the requested stats info that was
  13948. * partially delivered through earlier STATS_CONF messages.
  13949. * partial - The requested stats have been delivered in part.
  13950. * One or more subsequent STATS_CONF messages with the same
  13951. * cookie value will be sent to deliver the remainder of the
  13952. * information.
  13953. * error - The requested stats could not be delivered, for example due
  13954. * to a shortage of memory to construct a message holding the
  13955. * requested stats.
  13956. * invalid - The requested stat type is either not recognized, or the
  13957. * target is configured to not gather the stats type in question.
  13958. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13959. * series_done - This special value indicates that no further stats info
  13960. * elements are present within a series of stats info elems
  13961. * (within a stats upload confirmation message).
  13962. */
  13963. enum htt_dbg_stats_status {
  13964. HTT_DBG_STATS_STATUS_PRESENT = 0,
  13965. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  13966. HTT_DBG_STATS_STATUS_ERROR = 2,
  13967. HTT_DBG_STATS_STATUS_INVALID = 3,
  13968. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  13969. };
  13970. /**
  13971. * @brief target -> host statistics upload
  13972. *
  13973. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  13974. *
  13975. * @details
  13976. * The following field definitions describe the format of the HTT target
  13977. * to host stats upload confirmation message.
  13978. * The message contains a cookie echoed from the HTT host->target stats
  13979. * upload request, which identifies which request the confirmation is
  13980. * for, and a series of tag-length-value stats information elements.
  13981. * The tag-length header for each stats info element also includes a
  13982. * status field, to indicate whether the request for the stat type in
  13983. * question was fully met, partially met, unable to be met, or invalid
  13984. * (if the stat type in question is disabled in the target).
  13985. * A special value of all 1's in this status field is used to indicate
  13986. * the end of the series of stats info elements.
  13987. *
  13988. *
  13989. * |31 16|15 8|7 5|4 0|
  13990. * |------------------------------------------------------------|
  13991. * | reserved | msg type |
  13992. * |------------------------------------------------------------|
  13993. * | cookie LSBs |
  13994. * |------------------------------------------------------------|
  13995. * | cookie MSBs |
  13996. * |------------------------------------------------------------|
  13997. * | stats entry length | reserved | S |stat type|
  13998. * |------------------------------------------------------------|
  13999. * | |
  14000. * | type-specific stats info |
  14001. * | |
  14002. * |------------------------------------------------------------|
  14003. * | stats entry length | reserved | S |stat type|
  14004. * |------------------------------------------------------------|
  14005. * | |
  14006. * | type-specific stats info |
  14007. * | |
  14008. * |------------------------------------------------------------|
  14009. * | n/a | reserved | 111 | n/a |
  14010. * |------------------------------------------------------------|
  14011. * Header fields:
  14012. * - MSG_TYPE
  14013. * Bits 7:0
  14014. * Purpose: identifies this is a statistics upload confirmation message
  14015. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  14016. * - COOKIE_LSBS
  14017. * Bits 31:0
  14018. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14019. * message with its preceding host->target stats request message.
  14020. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14021. * - COOKIE_MSBS
  14022. * Bits 31:0
  14023. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14024. * message with its preceding host->target stats request message.
  14025. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14026. *
  14027. * Stats Information Element tag-length header fields:
  14028. * - STAT_TYPE
  14029. * Bits 4:0
  14030. * Purpose: identifies the type of statistics info held in the
  14031. * following information element
  14032. * Value: htt_dbg_stats_type
  14033. * - STATUS
  14034. * Bits 7:5
  14035. * Purpose: indicate whether the requested stats are present
  14036. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  14037. * the completion of the stats entry series
  14038. * - LENGTH
  14039. * Bits 31:16
  14040. * Purpose: indicate the stats information size
  14041. * Value: This field specifies the number of bytes of stats information
  14042. * that follows the element tag-length header.
  14043. * It is expected but not required that this length is a multiple of
  14044. * 4 bytes. Even if the length is not an integer multiple of 4, the
  14045. * subsequent stats entry header will begin on a 4-byte aligned
  14046. * boundary.
  14047. */
  14048. #define HTT_T2H_STATS_COOKIE_SIZE 8
  14049. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  14050. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  14051. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  14052. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  14053. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  14054. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  14055. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  14056. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14057. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  14058. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  14059. do { \
  14060. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  14061. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  14062. } while (0)
  14063. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  14064. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  14065. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  14066. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  14067. do { \
  14068. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  14069. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  14070. } while (0)
  14071. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  14072. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  14073. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  14074. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14075. do { \
  14076. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  14077. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  14078. } while (0)
  14079. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  14080. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  14081. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  14082. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  14083. #define HTT_MAX_AGGR 64
  14084. #define HTT_HL_MAX_AGGR 18
  14085. /**
  14086. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  14087. *
  14088. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  14089. *
  14090. * @details
  14091. * The following field definitions describe the format of the HTT host
  14092. * to target frag_desc/msdu_ext bank configuration message.
  14093. * The message contains the based address and the min and max id of the
  14094. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  14095. * MSDU_EXT/FRAG_DESC.
  14096. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  14097. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  14098. * the hardware does the mapping/translation.
  14099. *
  14100. * Total banks that can be configured is configured to 16.
  14101. *
  14102. * This should be called before any TX has be initiated by the HTT
  14103. *
  14104. * |31 16|15 8|7 5|4 0|
  14105. * |------------------------------------------------------------|
  14106. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  14107. * |------------------------------------------------------------|
  14108. * | BANK0_BASE_ADDRESS (bits 31:0) |
  14109. #if HTT_PADDR64
  14110. * | BANK0_BASE_ADDRESS (bits 63:32) |
  14111. #endif
  14112. * |------------------------------------------------------------|
  14113. * | ... |
  14114. * |------------------------------------------------------------|
  14115. * | BANK15_BASE_ADDRESS (bits 31:0) |
  14116. #if HTT_PADDR64
  14117. * | BANK15_BASE_ADDRESS (bits 63:32) |
  14118. #endif
  14119. * |------------------------------------------------------------|
  14120. * | BANK0_MAX_ID | BANK0_MIN_ID |
  14121. * |------------------------------------------------------------|
  14122. * | ... |
  14123. * |------------------------------------------------------------|
  14124. * | BANK15_MAX_ID | BANK15_MIN_ID |
  14125. * |------------------------------------------------------------|
  14126. * Header fields:
  14127. * - MSG_TYPE
  14128. * Bits 7:0
  14129. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  14130. * for systems with 64-bit format for bus addresses:
  14131. * - BANKx_BASE_ADDRESS_LO
  14132. * Bits 31:0
  14133. * Purpose: Provide a mechanism to specify the base address of the
  14134. * MSDU_EXT bank physical/bus address.
  14135. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  14136. * - BANKx_BASE_ADDRESS_HI
  14137. * Bits 31:0
  14138. * Purpose: Provide a mechanism to specify the base address of the
  14139. * MSDU_EXT bank physical/bus address.
  14140. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  14141. * for systems with 32-bit format for bus addresses:
  14142. * - BANKx_BASE_ADDRESS
  14143. * Bits 31:0
  14144. * Purpose: Provide a mechanism to specify the base address of the
  14145. * MSDU_EXT bank physical/bus address.
  14146. * Value: MSDU_EXT bank physical / bus address
  14147. * - BANKx_MIN_ID
  14148. * Bits 15:0
  14149. * Purpose: Provide a mechanism to specify the min index that needs to
  14150. * mapped.
  14151. * - BANKx_MAX_ID
  14152. * Bits 31:16
  14153. * Purpose: Provide a mechanism to specify the max index that needs to
  14154. * mapped.
  14155. *
  14156. */
  14157. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  14158. * safe value.
  14159. * @note MAX supported banks is 16.
  14160. */
  14161. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  14162. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  14163. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  14164. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  14165. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  14166. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  14167. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  14168. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  14169. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  14170. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  14171. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  14172. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  14173. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  14174. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  14175. do { \
  14176. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  14177. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  14178. } while (0)
  14179. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  14180. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  14181. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  14182. do { \
  14183. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  14184. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  14185. } while (0)
  14186. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  14187. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  14188. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  14189. do { \
  14190. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  14191. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  14192. } while (0)
  14193. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  14194. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  14195. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  14196. do { \
  14197. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  14198. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  14199. } while (0)
  14200. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  14201. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  14202. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  14203. do { \
  14204. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  14205. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  14206. } while (0)
  14207. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  14208. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  14209. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  14210. do { \
  14211. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  14212. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  14213. } while (0)
  14214. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  14215. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  14216. /*
  14217. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  14218. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  14219. * addresses are stored in a XXX-bit field.
  14220. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  14221. * htt_tx_frag_desc64_bank_cfg_t structs.
  14222. */
  14223. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  14224. _paddr_bits_, \
  14225. _paddr__bank_base_address_) \
  14226. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  14227. /** word 0 \
  14228. * msg_type: 8, \
  14229. * pdev_id: 2, \
  14230. * swap: 1, \
  14231. * reserved0: 5, \
  14232. * num_banks: 8, \
  14233. * desc_size: 8; \
  14234. */ \
  14235. A_UINT32 word0; \
  14236. /* \
  14237. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  14238. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  14239. * the second A_UINT32). \
  14240. */ \
  14241. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  14242. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  14243. } POSTPACK
  14244. /* define htt_tx_frag_desc32_bank_cfg_t */
  14245. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  14246. /* define htt_tx_frag_desc64_bank_cfg_t */
  14247. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  14248. /*
  14249. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  14250. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  14251. */
  14252. #if HTT_PADDR64
  14253. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  14254. #else
  14255. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  14256. #endif
  14257. /**
  14258. * @brief target -> host HTT TX Credit total count update message definition
  14259. *
  14260. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  14261. *
  14262. *|31 16|15|14 9| 8 |7 0 |
  14263. *|---------------------+--+----------+-------+----------|
  14264. *|cur htt credit delta | Q| reserved | sign | msg type |
  14265. *|------------------------------------------------------|
  14266. *
  14267. * Header fields:
  14268. * - MSG_TYPE
  14269. * Bits 7:0
  14270. * Purpose: identifies this as a htt tx credit delta update message
  14271. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  14272. * - SIGN
  14273. * Bits 8
  14274. * identifies whether credit delta is positive or negative
  14275. * Value:
  14276. * - 0x0: credit delta is positive, rebalance in some buffers
  14277. * - 0x1: credit delta is negative, rebalance out some buffers
  14278. * - reserved
  14279. * Bits 14:9
  14280. * Value: 0x0
  14281. * - TXQ_GRP
  14282. * Bit 15
  14283. * Purpose: indicates whether any tx queue group information elements
  14284. * are appended to the tx credit update message
  14285. * Value: 0 -> no tx queue group information element is present
  14286. * 1 -> a tx queue group information element immediately follows
  14287. * - DELTA_COUNT
  14288. * Bits 31:16
  14289. * Purpose: Specify current htt credit delta absolute count
  14290. */
  14291. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  14292. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  14293. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  14294. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  14295. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  14296. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  14297. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  14298. do { \
  14299. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  14300. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  14301. } while (0)
  14302. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  14303. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  14304. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  14305. do { \
  14306. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  14307. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  14308. } while (0)
  14309. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  14310. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  14311. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  14312. do { \
  14313. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  14314. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  14315. } while (0)
  14316. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  14317. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  14318. #define HTT_TX_CREDIT_MSG_BYTES 4
  14319. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  14320. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  14321. /**
  14322. * @brief HTT WDI_IPA Operation Response Message
  14323. *
  14324. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  14325. *
  14326. * @details
  14327. * HTT WDI_IPA Operation Response message is sent by target
  14328. * to host confirming suspend or resume operation.
  14329. * |31 24|23 16|15 8|7 0|
  14330. * |----------------+----------------+----------------+----------------|
  14331. * | op_code | Rsvd | msg_type |
  14332. * |-------------------------------------------------------------------|
  14333. * | Rsvd | Response len |
  14334. * |-------------------------------------------------------------------|
  14335. * | |
  14336. * | Response-type specific info |
  14337. * | |
  14338. * | |
  14339. * |-------------------------------------------------------------------|
  14340. * Header fields:
  14341. * - MSG_TYPE
  14342. * Bits 7:0
  14343. * Purpose: Identifies this as WDI_IPA Operation Response message
  14344. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  14345. * - OP_CODE
  14346. * Bits 31:16
  14347. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  14348. * value: = enum htt_wdi_ipa_op_code
  14349. * - RSP_LEN
  14350. * Bits 16:0
  14351. * Purpose: length for the response-type specific info
  14352. * value: = length in bytes for response-type specific info
  14353. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  14354. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  14355. */
  14356. PREPACK struct htt_wdi_ipa_op_response_t
  14357. {
  14358. /* DWORD 0: flags and meta-data */
  14359. A_UINT32
  14360. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  14361. reserved1: 8,
  14362. op_code: 16;
  14363. A_UINT32
  14364. rsp_len: 16,
  14365. reserved2: 16;
  14366. } POSTPACK;
  14367. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  14368. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  14369. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  14370. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  14371. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  14372. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  14373. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  14374. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  14375. do { \
  14376. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  14377. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  14378. } while (0)
  14379. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  14380. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  14381. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  14382. do { \
  14383. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  14384. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  14385. } while (0)
  14386. enum htt_phy_mode {
  14387. htt_phy_mode_11a = 0,
  14388. htt_phy_mode_11g = 1,
  14389. htt_phy_mode_11b = 2,
  14390. htt_phy_mode_11g_only = 3,
  14391. htt_phy_mode_11na_ht20 = 4,
  14392. htt_phy_mode_11ng_ht20 = 5,
  14393. htt_phy_mode_11na_ht40 = 6,
  14394. htt_phy_mode_11ng_ht40 = 7,
  14395. htt_phy_mode_11ac_vht20 = 8,
  14396. htt_phy_mode_11ac_vht40 = 9,
  14397. htt_phy_mode_11ac_vht80 = 10,
  14398. htt_phy_mode_11ac_vht20_2g = 11,
  14399. htt_phy_mode_11ac_vht40_2g = 12,
  14400. htt_phy_mode_11ac_vht80_2g = 13,
  14401. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  14402. htt_phy_mode_11ac_vht160 = 15,
  14403. htt_phy_mode_max,
  14404. };
  14405. /**
  14406. * @brief target -> host HTT channel change indication
  14407. *
  14408. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  14409. *
  14410. * @details
  14411. * Specify when a channel change occurs.
  14412. * This allows the host to precisely determine which rx frames arrived
  14413. * on the old channel and which rx frames arrived on the new channel.
  14414. *
  14415. *|31 |7 0 |
  14416. *|-------------------------------------------+----------|
  14417. *| reserved | msg type |
  14418. *|------------------------------------------------------|
  14419. *| primary_chan_center_freq_mhz |
  14420. *|------------------------------------------------------|
  14421. *| contiguous_chan1_center_freq_mhz |
  14422. *|------------------------------------------------------|
  14423. *| contiguous_chan2_center_freq_mhz |
  14424. *|------------------------------------------------------|
  14425. *| phy_mode |
  14426. *|------------------------------------------------------|
  14427. *
  14428. * Header fields:
  14429. * - MSG_TYPE
  14430. * Bits 7:0
  14431. * Purpose: identifies this as a htt channel change indication message
  14432. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  14433. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  14434. * Bits 31:0
  14435. * Purpose: identify the (center of the) new 20 MHz primary channel
  14436. * Value: center frequency of the 20 MHz primary channel, in MHz units
  14437. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  14438. * Bits 31:0
  14439. * Purpose: identify the (center of the) contiguous frequency range
  14440. * comprising the new channel.
  14441. * For example, if the new channel is a 80 MHz channel extending
  14442. * 60 MHz beyond the primary channel, this field would be 30 larger
  14443. * than the primary channel center frequency field.
  14444. * Value: center frequency of the contiguous frequency range comprising
  14445. * the full channel in MHz units
  14446. * (80+80 channels also use the CONTIG_CHAN2 field)
  14447. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  14448. * Bits 31:0
  14449. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  14450. * within a VHT 80+80 channel.
  14451. * This field is only relevant for VHT 80+80 channels.
  14452. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  14453. * channel (arbitrary value for cases besides VHT 80+80)
  14454. * - PHY_MODE
  14455. * Bits 31:0
  14456. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  14457. * and band
  14458. * Value: htt_phy_mode enum value
  14459. */
  14460. PREPACK struct htt_chan_change_t
  14461. {
  14462. /* DWORD 0: flags and meta-data */
  14463. A_UINT32
  14464. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  14465. reserved1: 24;
  14466. A_UINT32 primary_chan_center_freq_mhz;
  14467. A_UINT32 contig_chan1_center_freq_mhz;
  14468. A_UINT32 contig_chan2_center_freq_mhz;
  14469. A_UINT32 phy_mode;
  14470. } POSTPACK;
  14471. /*
  14472. * Due to historical / backwards-compatibility reasons, maintain the
  14473. * below htt_chan_change_msg struct definition, which needs to be
  14474. * consistent with the above htt_chan_change_t struct definition
  14475. * (aside from the htt_chan_change_t definition including the msg_type
  14476. * dword within the message, and the htt_chan_change_msg only containing
  14477. * the payload of the message that follows the msg_type dword).
  14478. */
  14479. PREPACK struct htt_chan_change_msg {
  14480. A_UINT32 chan_mhz; /* frequency in mhz */
  14481. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  14482. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  14483. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  14484. } POSTPACK;
  14485. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  14486. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  14487. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  14488. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  14489. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  14490. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  14491. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  14492. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  14493. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  14494. do { \
  14495. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  14496. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  14497. } while (0)
  14498. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  14499. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  14500. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  14501. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  14502. do { \
  14503. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  14504. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  14505. } while (0)
  14506. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  14507. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  14508. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  14509. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  14510. do { \
  14511. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  14512. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  14513. } while (0)
  14514. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  14515. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  14516. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  14517. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  14518. do { \
  14519. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  14520. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  14521. } while (0)
  14522. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  14523. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  14524. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  14525. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  14526. /**
  14527. * @brief rx offload packet error message
  14528. *
  14529. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  14530. *
  14531. * @details
  14532. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  14533. * of target payload like mic err.
  14534. *
  14535. * |31 24|23 16|15 8|7 0|
  14536. * |----------------+----------------+----------------+----------------|
  14537. * | tid | vdev_id | msg_sub_type | msg_type |
  14538. * |-------------------------------------------------------------------|
  14539. * : (sub-type dependent content) :
  14540. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14541. * Header fields:
  14542. * - msg_type
  14543. * Bits 7:0
  14544. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  14545. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  14546. * - msg_sub_type
  14547. * Bits 15:8
  14548. * Purpose: Identifies which type of rx error is reported by this message
  14549. * value: htt_rx_ofld_pkt_err_type
  14550. * - vdev_id
  14551. * Bits 23:16
  14552. * Purpose: Identifies which vdev received the erroneous rx frame
  14553. * value:
  14554. * - tid
  14555. * Bits 31:24
  14556. * Purpose: Identifies the traffic type of the rx frame
  14557. * value:
  14558. *
  14559. * - The payload fields used if the sub-type == MIC error are shown below.
  14560. * Note - MIC err is per MSDU, while PN is per MPDU.
  14561. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  14562. * with MIC err in A-MSDU case, so FW will send only one HTT message
  14563. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  14564. * instead of sending separate HTT messages for each wrong MSDU within
  14565. * the MPDU.
  14566. *
  14567. * |31 24|23 16|15 8|7 0|
  14568. * |----------------+----------------+----------------+----------------|
  14569. * | Rsvd | key_id | peer_id |
  14570. * |-------------------------------------------------------------------|
  14571. * | receiver MAC addr 31:0 |
  14572. * |-------------------------------------------------------------------|
  14573. * | Rsvd | receiver MAC addr 47:32 |
  14574. * |-------------------------------------------------------------------|
  14575. * | transmitter MAC addr 31:0 |
  14576. * |-------------------------------------------------------------------|
  14577. * | Rsvd | transmitter MAC addr 47:32 |
  14578. * |-------------------------------------------------------------------|
  14579. * | PN 31:0 |
  14580. * |-------------------------------------------------------------------|
  14581. * | Rsvd | PN 47:32 |
  14582. * |-------------------------------------------------------------------|
  14583. * - peer_id
  14584. * Bits 15:0
  14585. * Purpose: identifies which peer is frame is from
  14586. * value:
  14587. * - key_id
  14588. * Bits 23:16
  14589. * Purpose: identifies key_id of rx frame
  14590. * value:
  14591. * - RA_31_0 (receiver MAC addr 31:0)
  14592. * Bits 31:0
  14593. * Purpose: identifies by MAC address which vdev received the frame
  14594. * value: MAC address lower 4 bytes
  14595. * - RA_47_32 (receiver MAC addr 47:32)
  14596. * Bits 15:0
  14597. * Purpose: identifies by MAC address which vdev received the frame
  14598. * value: MAC address upper 2 bytes
  14599. * - TA_31_0 (transmitter MAC addr 31:0)
  14600. * Bits 31:0
  14601. * Purpose: identifies by MAC address which peer transmitted the frame
  14602. * value: MAC address lower 4 bytes
  14603. * - TA_47_32 (transmitter MAC addr 47:32)
  14604. * Bits 15:0
  14605. * Purpose: identifies by MAC address which peer transmitted the frame
  14606. * value: MAC address upper 2 bytes
  14607. * - PN_31_0
  14608. * Bits 31:0
  14609. * Purpose: Identifies pn of rx frame
  14610. * value: PN lower 4 bytes
  14611. * - PN_47_32
  14612. * Bits 15:0
  14613. * Purpose: Identifies pn of rx frame
  14614. * value:
  14615. * TKIP or CCMP: PN upper 2 bytes
  14616. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  14617. */
  14618. enum htt_rx_ofld_pkt_err_type {
  14619. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  14620. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  14621. };
  14622. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  14623. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  14624. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  14625. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  14626. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  14627. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  14628. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  14629. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  14630. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  14631. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  14632. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  14633. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  14634. do { \
  14635. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  14636. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  14637. } while (0)
  14638. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  14639. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  14640. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  14641. do { \
  14642. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  14643. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  14644. } while (0)
  14645. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  14646. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  14647. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  14648. do { \
  14649. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  14650. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  14651. } while (0)
  14652. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  14653. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  14654. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  14655. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  14656. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  14657. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  14658. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  14659. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  14660. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  14661. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  14662. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  14663. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  14664. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  14665. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  14666. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  14667. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  14668. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  14669. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  14670. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  14671. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  14672. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  14673. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  14674. do { \
  14675. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  14676. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  14677. } while (0)
  14678. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  14679. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  14680. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  14681. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  14682. do { \
  14683. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  14684. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  14685. } while (0)
  14686. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  14687. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  14688. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  14689. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  14690. do { \
  14691. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  14692. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  14693. } while (0)
  14694. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  14695. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  14696. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  14697. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  14698. do { \
  14699. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  14700. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  14701. } while (0)
  14702. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  14703. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  14704. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  14705. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  14706. do { \
  14707. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  14708. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  14709. } while (0)
  14710. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  14711. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  14712. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  14713. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  14714. do { \
  14715. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  14716. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  14717. } while (0)
  14718. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  14719. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  14720. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  14721. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  14722. do { \
  14723. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  14724. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  14725. } while (0)
  14726. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  14727. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  14728. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  14729. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  14730. do { \
  14731. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  14732. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  14733. } while (0)
  14734. /**
  14735. * @brief target -> host peer rate report message
  14736. *
  14737. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  14738. *
  14739. * @details
  14740. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  14741. * justified rate of all the peers.
  14742. *
  14743. * |31 24|23 16|15 8|7 0|
  14744. * |----------------+----------------+----------------+----------------|
  14745. * | peer_count | | msg_type |
  14746. * |-------------------------------------------------------------------|
  14747. * : Payload (variant number of peer rate report) :
  14748. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14749. * Header fields:
  14750. * - msg_type
  14751. * Bits 7:0
  14752. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  14753. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  14754. * - reserved
  14755. * Bits 15:8
  14756. * Purpose:
  14757. * value:
  14758. * - peer_count
  14759. * Bits 31:16
  14760. * Purpose: Specify how many peer rate report elements are present in the payload.
  14761. * value:
  14762. *
  14763. * Payload:
  14764. * There are variant number of peer rate report follow the first 32 bits.
  14765. * The peer rate report is defined as follows.
  14766. *
  14767. * |31 20|19 16|15 0|
  14768. * |-----------------------+---------+---------------------------------|-
  14769. * | reserved | phy | peer_id | \
  14770. * |-------------------------------------------------------------------| -> report #0
  14771. * | rate | /
  14772. * |-----------------------+---------+---------------------------------|-
  14773. * | reserved | phy | peer_id | \
  14774. * |-------------------------------------------------------------------| -> report #1
  14775. * | rate | /
  14776. * |-----------------------+---------+---------------------------------|-
  14777. * | reserved | phy | peer_id | \
  14778. * |-------------------------------------------------------------------| -> report #2
  14779. * | rate | /
  14780. * |-------------------------------------------------------------------|-
  14781. * : :
  14782. * : :
  14783. * : :
  14784. * :-------------------------------------------------------------------:
  14785. *
  14786. * - peer_id
  14787. * Bits 15:0
  14788. * Purpose: identify the peer
  14789. * value:
  14790. * - phy
  14791. * Bits 19:16
  14792. * Purpose: identify which phy is in use
  14793. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  14794. * Please see enum htt_peer_report_phy_type for detail.
  14795. * - reserved
  14796. * Bits 31:20
  14797. * Purpose:
  14798. * value:
  14799. * - rate
  14800. * Bits 31:0
  14801. * Purpose: represent the justified rate of the peer specified by peer_id
  14802. * value:
  14803. */
  14804. enum htt_peer_rate_report_phy_type {
  14805. HTT_PEER_RATE_REPORT_11B = 0,
  14806. HTT_PEER_RATE_REPORT_11A_G,
  14807. HTT_PEER_RATE_REPORT_11N,
  14808. HTT_PEER_RATE_REPORT_11AC,
  14809. };
  14810. #define HTT_PEER_RATE_REPORT_SIZE 8
  14811. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  14812. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  14813. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  14814. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  14815. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  14816. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  14817. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  14818. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  14819. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  14820. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  14821. do { \
  14822. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  14823. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  14824. } while (0)
  14825. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  14826. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  14827. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  14828. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  14829. do { \
  14830. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  14831. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  14832. } while (0)
  14833. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  14834. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  14835. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  14836. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  14837. do { \
  14838. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  14839. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  14840. } while (0)
  14841. /**
  14842. * @brief target -> host flow pool map message
  14843. *
  14844. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  14845. *
  14846. * @details
  14847. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  14848. * a flow of descriptors.
  14849. *
  14850. * This message is in TLV format and indicates the parameters to be setup a
  14851. * flow in the host. Each entry indicates that a particular flow ID is ready to
  14852. * receive descriptors from a specified pool.
  14853. *
  14854. * The message would appear as follows:
  14855. *
  14856. * |31 24|23 16|15 8|7 0|
  14857. * |----------------+----------------+----------------+----------------|
  14858. * header | reserved | num_flows | msg_type |
  14859. * |-------------------------------------------------------------------|
  14860. * | |
  14861. * : payload :
  14862. * | |
  14863. * |-------------------------------------------------------------------|
  14864. *
  14865. * The header field is one DWORD long and is interpreted as follows:
  14866. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  14867. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  14868. * this message
  14869. * b'16-31 - reserved: These bits are reserved for future use
  14870. *
  14871. * Payload:
  14872. * The payload would contain multiple objects of the following structure. Each
  14873. * object represents a flow.
  14874. *
  14875. * |31 24|23 16|15 8|7 0|
  14876. * |----------------+----------------+----------------+----------------|
  14877. * header | reserved | num_flows | msg_type |
  14878. * |-------------------------------------------------------------------|
  14879. * payload0| flow_type |
  14880. * |-------------------------------------------------------------------|
  14881. * | flow_id |
  14882. * |-------------------------------------------------------------------|
  14883. * | reserved0 | flow_pool_id |
  14884. * |-------------------------------------------------------------------|
  14885. * | reserved1 | flow_pool_size |
  14886. * |-------------------------------------------------------------------|
  14887. * | reserved2 |
  14888. * |-------------------------------------------------------------------|
  14889. * payload1| flow_type |
  14890. * |-------------------------------------------------------------------|
  14891. * | flow_id |
  14892. * |-------------------------------------------------------------------|
  14893. * | reserved0 | flow_pool_id |
  14894. * |-------------------------------------------------------------------|
  14895. * | reserved1 | flow_pool_size |
  14896. * |-------------------------------------------------------------------|
  14897. * | reserved2 |
  14898. * |-------------------------------------------------------------------|
  14899. * | . |
  14900. * | . |
  14901. * | . |
  14902. * |-------------------------------------------------------------------|
  14903. *
  14904. * Each payload is 5 DWORDS long and is interpreted as follows:
  14905. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  14906. * this flow is associated. It can be VDEV, peer,
  14907. * or tid (AC). Based on enum htt_flow_type.
  14908. *
  14909. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14910. * object. For flow_type vdev it is set to the
  14911. * vdevid, for peer it is peerid and for tid, it is
  14912. * tid_num.
  14913. *
  14914. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  14915. * in the host for this flow
  14916. * b'16:31 - reserved0: This field in reserved for the future. In case
  14917. * we have a hierarchical implementation (HCM) of
  14918. * pools, it can be used to indicate the ID of the
  14919. * parent-pool.
  14920. *
  14921. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  14922. * Descriptors for this flow will be
  14923. * allocated from this pool in the host.
  14924. * b'16:31 - reserved1: This field in reserved for the future. In case
  14925. * we have a hierarchical implementation of pools,
  14926. * it can be used to indicate the max number of
  14927. * descriptors in the pool. The b'0:15 can be used
  14928. * to indicate min number of descriptors in the
  14929. * HCM scheme.
  14930. *
  14931. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  14932. * we have a hierarchical implementation of pools,
  14933. * b'0:15 can be used to indicate the
  14934. * priority-based borrowing (PBB) threshold of
  14935. * the flow's pool. The b'16:31 are still left
  14936. * reserved.
  14937. */
  14938. enum htt_flow_type {
  14939. FLOW_TYPE_VDEV = 0,
  14940. /* Insert new flow types above this line */
  14941. };
  14942. PREPACK struct htt_flow_pool_map_payload_t {
  14943. A_UINT32 flow_type;
  14944. A_UINT32 flow_id;
  14945. A_UINT32 flow_pool_id:16,
  14946. reserved0:16;
  14947. A_UINT32 flow_pool_size:16,
  14948. reserved1:16;
  14949. A_UINT32 reserved2;
  14950. } POSTPACK;
  14951. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  14952. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  14953. (sizeof(struct htt_flow_pool_map_payload_t))
  14954. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  14955. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  14956. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  14957. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  14958. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  14959. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  14960. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  14961. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  14962. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  14963. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  14964. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  14965. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  14966. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  14967. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  14968. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  14969. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  14970. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  14971. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  14972. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  14973. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  14974. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  14975. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  14976. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  14977. do { \
  14978. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  14979. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  14980. } while (0)
  14981. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  14982. do { \
  14983. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  14984. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  14985. } while (0)
  14986. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  14987. do { \
  14988. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  14989. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  14990. } while (0)
  14991. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  14992. do { \
  14993. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  14994. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  14995. } while (0)
  14996. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  14997. do { \
  14998. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  14999. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  15000. } while (0)
  15001. /**
  15002. * @brief target -> host flow pool unmap message
  15003. *
  15004. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  15005. *
  15006. * @details
  15007. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  15008. * down a flow of descriptors.
  15009. * This message indicates that for the flow (whose ID is provided) is wanting
  15010. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  15011. * pool of descriptors from where descriptors are being allocated for this
  15012. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  15013. * be unmapped by the host.
  15014. *
  15015. * The message would appear as follows:
  15016. *
  15017. * |31 24|23 16|15 8|7 0|
  15018. * |----------------+----------------+----------------+----------------|
  15019. * | reserved0 | msg_type |
  15020. * |-------------------------------------------------------------------|
  15021. * | flow_type |
  15022. * |-------------------------------------------------------------------|
  15023. * | flow_id |
  15024. * |-------------------------------------------------------------------|
  15025. * | reserved1 | flow_pool_id |
  15026. * |-------------------------------------------------------------------|
  15027. *
  15028. * The message is interpreted as follows:
  15029. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  15030. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  15031. * b'8:31 - reserved0: Reserved for future use
  15032. *
  15033. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  15034. * this flow is associated. It can be VDEV, peer,
  15035. * or tid (AC). Based on enum htt_flow_type.
  15036. *
  15037. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  15038. * object. For flow_type vdev it is set to the
  15039. * vdevid, for peer it is peerid and for tid, it is
  15040. * tid_num.
  15041. *
  15042. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  15043. * used in the host for this flow
  15044. * b'16:31 - reserved0: This field in reserved for the future.
  15045. *
  15046. */
  15047. PREPACK struct htt_flow_pool_unmap_t {
  15048. A_UINT32 msg_type:8,
  15049. reserved0:24;
  15050. A_UINT32 flow_type;
  15051. A_UINT32 flow_id;
  15052. A_UINT32 flow_pool_id:16,
  15053. reserved1:16;
  15054. } POSTPACK;
  15055. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  15056. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  15057. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  15058. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  15059. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  15060. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  15061. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  15062. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  15063. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  15064. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  15065. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  15066. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  15067. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  15068. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  15069. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  15070. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  15071. do { \
  15072. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  15073. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  15074. } while (0)
  15075. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  15076. do { \
  15077. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  15078. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  15079. } while (0)
  15080. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  15081. do { \
  15082. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  15083. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  15084. } while (0)
  15085. /**
  15086. * @brief target -> host SRING setup done message
  15087. *
  15088. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  15089. *
  15090. * @details
  15091. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  15092. * SRNG ring setup is done
  15093. *
  15094. * This message indicates whether the last setup operation is successful.
  15095. * It will be sent to host when host set respose_required bit in
  15096. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  15097. * The message would appear as follows:
  15098. *
  15099. * |31 24|23 16|15 8|7 0|
  15100. * |--------------- +----------------+----------------+----------------|
  15101. * | setup_status | ring_id | pdev_id | msg_type |
  15102. * |-------------------------------------------------------------------|
  15103. *
  15104. * The message is interpreted as follows:
  15105. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  15106. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  15107. * b'8:15 - pdev_id:
  15108. * 0 (for rings at SOC/UMAC level),
  15109. * 1/2/3 mac id (for rings at LMAC level)
  15110. * b'16:23 - ring_id: Identify the ring which is set up
  15111. * More details can be got from enum htt_srng_ring_id
  15112. * b'24:31 - setup_status: Indicate status of setup operation
  15113. * Refer to htt_ring_setup_status
  15114. */
  15115. PREPACK struct htt_sring_setup_done_t {
  15116. A_UINT32 msg_type: 8,
  15117. pdev_id: 8,
  15118. ring_id: 8,
  15119. setup_status: 8;
  15120. } POSTPACK;
  15121. enum htt_ring_setup_status {
  15122. htt_ring_setup_status_ok = 0,
  15123. htt_ring_setup_status_error,
  15124. };
  15125. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  15126. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  15127. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  15128. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  15129. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  15130. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  15131. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  15132. do { \
  15133. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  15134. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  15135. } while (0)
  15136. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  15137. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  15138. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  15139. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  15140. HTT_SRING_SETUP_DONE_RING_ID_S)
  15141. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  15142. do { \
  15143. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  15144. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  15145. } while (0)
  15146. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  15147. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  15148. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  15149. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  15150. HTT_SRING_SETUP_DONE_STATUS_S)
  15151. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  15152. do { \
  15153. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  15154. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  15155. } while (0)
  15156. /**
  15157. * @brief target -> flow map flow info
  15158. *
  15159. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  15160. *
  15161. * @details
  15162. * HTT TX map flow entry with tqm flow pointer
  15163. * Sent from firmware to host to add tqm flow pointer in corresponding
  15164. * flow search entry. Flow metadata is replayed back to host as part of this
  15165. * struct to enable host to find the specific flow search entry
  15166. *
  15167. * The message would appear as follows:
  15168. *
  15169. * |31 28|27 18|17 14|13 8|7 0|
  15170. * |-------+------------------------------------------+----------------|
  15171. * | rsvd0 | fse_hsh_idx | msg_type |
  15172. * |-------------------------------------------------------------------|
  15173. * | rsvd1 | tid | peer_id |
  15174. * |-------------------------------------------------------------------|
  15175. * | tqm_flow_pntr_lo |
  15176. * |-------------------------------------------------------------------|
  15177. * | tqm_flow_pntr_hi |
  15178. * |-------------------------------------------------------------------|
  15179. * | fse_meta_data |
  15180. * |-------------------------------------------------------------------|
  15181. *
  15182. * The message is interpreted as follows:
  15183. *
  15184. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  15185. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  15186. *
  15187. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  15188. * for this flow entry
  15189. *
  15190. * dword0 - b'28:31 - rsvd0: Reserved for future use
  15191. *
  15192. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  15193. *
  15194. * dword1 - b'14:17 - tid
  15195. *
  15196. * dword1 - b'18:31 - rsvd1: Reserved for future use
  15197. *
  15198. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  15199. *
  15200. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  15201. *
  15202. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  15203. * given by host
  15204. */
  15205. PREPACK struct htt_tx_map_flow_info {
  15206. A_UINT32
  15207. msg_type: 8,
  15208. fse_hsh_idx: 20,
  15209. rsvd0: 4;
  15210. A_UINT32
  15211. peer_id: 14,
  15212. tid: 4,
  15213. rsvd1: 14;
  15214. A_UINT32 tqm_flow_pntr_lo;
  15215. A_UINT32 tqm_flow_pntr_hi;
  15216. struct htt_tx_flow_metadata fse_meta_data;
  15217. } POSTPACK;
  15218. /* DWORD 0 */
  15219. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  15220. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  15221. /* DWORD 1 */
  15222. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  15223. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  15224. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  15225. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  15226. /* DWORD 0 */
  15227. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  15228. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  15229. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  15230. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  15231. do { \
  15232. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  15233. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  15234. } while (0)
  15235. /* DWORD 1 */
  15236. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  15237. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  15238. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  15239. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  15240. do { \
  15241. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  15242. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  15243. } while (0)
  15244. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  15245. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  15246. HTT_TX_MAP_FLOW_INFO_TID_S)
  15247. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  15248. do { \
  15249. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  15250. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  15251. } while (0)
  15252. /*
  15253. * htt_dbg_ext_stats_status -
  15254. * present - The requested stats have been delivered in full.
  15255. * This indicates that either the stats information was contained
  15256. * in its entirety within this message, or else this message
  15257. * completes the delivery of the requested stats info that was
  15258. * partially delivered through earlier STATS_CONF messages.
  15259. * partial - The requested stats have been delivered in part.
  15260. * One or more subsequent STATS_CONF messages with the same
  15261. * cookie value will be sent to deliver the remainder of the
  15262. * information.
  15263. * error - The requested stats could not be delivered, for example due
  15264. * to a shortage of memory to construct a message holding the
  15265. * requested stats.
  15266. * invalid - The requested stat type is either not recognized, or the
  15267. * target is configured to not gather the stats type in question.
  15268. */
  15269. enum htt_dbg_ext_stats_status {
  15270. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  15271. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  15272. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  15273. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  15274. };
  15275. /**
  15276. * @brief target -> host ppdu stats upload
  15277. *
  15278. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  15279. *
  15280. * @details
  15281. * The following field definitions describe the format of the HTT target
  15282. * to host ppdu stats indication message.
  15283. *
  15284. *
  15285. * |31 16|15 12|11 10|9 8|7 0 |
  15286. * |----------------------------------------------------------------------|
  15287. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  15288. * |----------------------------------------------------------------------|
  15289. * | ppdu_id |
  15290. * |----------------------------------------------------------------------|
  15291. * | Timestamp in us |
  15292. * |----------------------------------------------------------------------|
  15293. * | reserved |
  15294. * |----------------------------------------------------------------------|
  15295. * | type-specific stats info |
  15296. * | (see htt_ppdu_stats.h) |
  15297. * |----------------------------------------------------------------------|
  15298. * Header fields:
  15299. * - MSG_TYPE
  15300. * Bits 7:0
  15301. * Purpose: Identifies this is a PPDU STATS indication
  15302. * message.
  15303. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  15304. * - mac_id
  15305. * Bits 9:8
  15306. * Purpose: mac_id of this ppdu_id
  15307. * Value: 0-3
  15308. * - pdev_id
  15309. * Bits 11:10
  15310. * Purpose: pdev_id of this ppdu_id
  15311. * Value: 0-3
  15312. * 0 (for rings at SOC level),
  15313. * 1/2/3 PDEV -> 0/1/2
  15314. * - payload_size
  15315. * Bits 31:16
  15316. * Purpose: total tlv size
  15317. * Value: payload_size in bytes
  15318. */
  15319. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  15320. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  15321. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  15322. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  15323. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  15324. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  15325. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  15326. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  15327. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  15328. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  15329. do { \
  15330. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  15331. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  15332. } while (0)
  15333. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  15334. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  15335. HTT_T2H_PPDU_STATS_MAC_ID_S)
  15336. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  15337. do { \
  15338. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  15339. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  15340. } while (0)
  15341. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  15342. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  15343. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  15344. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  15345. do { \
  15346. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  15347. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  15348. } while (0)
  15349. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  15350. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  15351. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  15352. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  15353. do { \
  15354. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  15355. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  15356. } while (0)
  15357. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  15358. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  15359. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  15360. /* htt_t2h_ppdu_stats_ind_hdr_t
  15361. * This struct contains the fields within the header of the
  15362. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  15363. * stats info.
  15364. * This struct assumes little-endian layout, and thus is only
  15365. * suitable for use within processors known to be little-endian
  15366. * (such as the target).
  15367. * In contrast, the above macros provide endian-portable methods
  15368. * to get and set the bitfields within this PPDU_STATS_IND header.
  15369. */
  15370. typedef struct {
  15371. A_UINT32 msg_type: 8, /* bits 7:0 */
  15372. mac_id: 2, /* bits 9:8 */
  15373. pdev_id: 2, /* bits 11:10 */
  15374. reserved1: 4, /* bits 15:12 */
  15375. payload_size: 16; /* bits 31:16 */
  15376. A_UINT32 ppdu_id;
  15377. A_UINT32 timestamp_us;
  15378. A_UINT32 reserved2;
  15379. } htt_t2h_ppdu_stats_ind_hdr_t;
  15380. /**
  15381. * @brief target -> host extended statistics upload
  15382. *
  15383. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  15384. *
  15385. * @details
  15386. * The following field definitions describe the format of the HTT target
  15387. * to host stats upload confirmation message.
  15388. * The message contains a cookie echoed from the HTT host->target stats
  15389. * upload request, which identifies which request the confirmation is
  15390. * for, and a single stats can span over multiple HTT stats indication
  15391. * due to the HTT message size limitation so every HTT ext stats indication
  15392. * will have tag-length-value stats information elements.
  15393. * The tag-length header for each HTT stats IND message also includes a
  15394. * status field, to indicate whether the request for the stat type in
  15395. * question was fully met, partially met, unable to be met, or invalid
  15396. * (if the stat type in question is disabled in the target).
  15397. * A Done bit 1's indicate the end of the of stats info elements.
  15398. *
  15399. *
  15400. * |31 16|15 12|11|10 8|7 5|4 0|
  15401. * |--------------------------------------------------------------|
  15402. * | reserved | msg type |
  15403. * |--------------------------------------------------------------|
  15404. * | cookie LSBs |
  15405. * |--------------------------------------------------------------|
  15406. * | cookie MSBs |
  15407. * |--------------------------------------------------------------|
  15408. * | stats entry length | rsvd | D| S | stat type |
  15409. * |--------------------------------------------------------------|
  15410. * | type-specific stats info |
  15411. * | (see htt_stats.h) |
  15412. * |--------------------------------------------------------------|
  15413. * Header fields:
  15414. * - MSG_TYPE
  15415. * Bits 7:0
  15416. * Purpose: Identifies this is a extended statistics upload confirmation
  15417. * message.
  15418. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  15419. * - COOKIE_LSBS
  15420. * Bits 31:0
  15421. * Purpose: Provide a mechanism to match a target->host stats confirmation
  15422. * message with its preceding host->target stats request message.
  15423. * Value: LSBs of the opaque cookie specified by the host-side requestor
  15424. * - COOKIE_MSBS
  15425. * Bits 31:0
  15426. * Purpose: Provide a mechanism to match a target->host stats confirmation
  15427. * message with its preceding host->target stats request message.
  15428. * Value: MSBs of the opaque cookie specified by the host-side requestor
  15429. *
  15430. * Stats Information Element tag-length header fields:
  15431. * - STAT_TYPE
  15432. * Bits 7:0
  15433. * Purpose: identifies the type of statistics info held in the
  15434. * following information element
  15435. * Value: htt_dbg_ext_stats_type
  15436. * - STATUS
  15437. * Bits 10:8
  15438. * Purpose: indicate whether the requested stats are present
  15439. * Value: htt_dbg_ext_stats_status
  15440. * - DONE
  15441. * Bits 11
  15442. * Purpose:
  15443. * Indicates the completion of the stats entry, this will be the last
  15444. * stats conf HTT segment for the requested stats type.
  15445. * Value:
  15446. * 0 -> the stats retrieval is ongoing
  15447. * 1 -> the stats retrieval is complete
  15448. * - LENGTH
  15449. * Bits 31:16
  15450. * Purpose: indicate the stats information size
  15451. * Value: This field specifies the number of bytes of stats information
  15452. * that follows the element tag-length header.
  15453. * It is expected but not required that this length is a multiple of
  15454. * 4 bytes.
  15455. */
  15456. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  15457. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  15458. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  15459. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  15460. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  15461. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  15462. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  15463. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  15464. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  15465. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  15466. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  15467. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  15468. do { \
  15469. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  15470. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  15471. } while (0)
  15472. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  15473. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  15474. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  15475. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  15476. do { \
  15477. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  15478. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  15479. } while (0)
  15480. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  15481. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  15482. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  15483. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  15484. do { \
  15485. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  15486. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  15487. } while (0)
  15488. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  15489. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  15490. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  15491. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  15492. do { \
  15493. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  15494. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  15495. } while (0)
  15496. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  15497. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  15498. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  15499. /**
  15500. * @brief target -> host streaming statistics upload
  15501. *
  15502. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  15503. *
  15504. * @details
  15505. * The following field definitions describe the format of the HTT target
  15506. * to host streaming stats upload indication message.
  15507. * The host can use a STREAMING_STATS_REQ message to enable the target to
  15508. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  15509. * use the STREAMING_STATS_REQ message to halt the target's production of
  15510. * STREAMING_STATS_IND messages.
  15511. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  15512. * the stats enabled by the host's STREAMING_STATS_REQ message.
  15513. *
  15514. * |31 8|7 0|
  15515. * |--------------------------------------------------------------|
  15516. * | reserved | msg type |
  15517. * |--------------------------------------------------------------|
  15518. * | type-specific stats info |
  15519. * | (see htt_stats.h) |
  15520. * |--------------------------------------------------------------|
  15521. * Header fields:
  15522. * - MSG_TYPE
  15523. * Bits 7:0
  15524. * Purpose: Identifies this as a streaming statistics upload indication
  15525. * message.
  15526. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  15527. */
  15528. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  15529. typedef enum {
  15530. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  15531. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  15532. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  15533. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  15534. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  15535. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  15536. /* Reserved from 128 - 255 for target internal use.*/
  15537. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  15538. } HTT_PEER_TYPE;
  15539. /** macro to convert MAC address from char array to HTT word format */
  15540. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  15541. (phtt_mac_addr)->mac_addr31to0 = \
  15542. (((c_macaddr)[0] << 0) | \
  15543. ((c_macaddr)[1] << 8) | \
  15544. ((c_macaddr)[2] << 16) | \
  15545. ((c_macaddr)[3] << 24)); \
  15546. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  15547. } while (0)
  15548. /**
  15549. * @brief target -> host monitor mac header indication message
  15550. *
  15551. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  15552. *
  15553. * @details
  15554. * The following diagram shows the format of the monitor mac header message
  15555. * sent from the target to the host.
  15556. * This message is primarily sent when promiscuous rx mode is enabled.
  15557. * One message is sent per rx PPDU.
  15558. *
  15559. * |31 24|23 16|15 8|7 0|
  15560. * |-------------------------------------------------------------|
  15561. * | peer_id | reserved0 | msg_type |
  15562. * |-------------------------------------------------------------|
  15563. * | reserved1 | num_mpdu |
  15564. * |-------------------------------------------------------------|
  15565. * | struct hw_rx_desc |
  15566. * | (see wal_rx_desc.h) |
  15567. * |-------------------------------------------------------------|
  15568. * | struct ieee80211_frame_addr4 |
  15569. * | (see ieee80211_defs.h) |
  15570. * |-------------------------------------------------------------|
  15571. * | struct ieee80211_frame_addr4 |
  15572. * | (see ieee80211_defs.h) |
  15573. * |-------------------------------------------------------------|
  15574. * | ...... |
  15575. * |-------------------------------------------------------------|
  15576. *
  15577. * Header fields:
  15578. * - msg_type
  15579. * Bits 7:0
  15580. * Purpose: Identifies this is a monitor mac header indication message.
  15581. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  15582. * - peer_id
  15583. * Bits 31:16
  15584. * Purpose: Software peer id given by host during association,
  15585. * During promiscuous mode, the peer ID will be invalid (0xFF)
  15586. * for rx PPDUs received from unassociated peers.
  15587. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  15588. * - num_mpdu
  15589. * Bits 15:0
  15590. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  15591. * delivered within the message.
  15592. * Value: 1 to 32
  15593. * num_mpdu is limited to a maximum value of 32, due to buffer
  15594. * size limits. For PPDUs with more than 32 MPDUs, only the
  15595. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  15596. * the PPDU will be provided.
  15597. */
  15598. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  15599. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  15600. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  15601. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  15602. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  15603. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  15604. do { \
  15605. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  15606. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  15607. } while (0)
  15608. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  15609. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  15610. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  15611. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  15612. do { \
  15613. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  15614. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  15615. } while (0)
  15616. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  15617. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  15618. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  15619. /**
  15620. * @brief target -> host flow pool resize Message
  15621. *
  15622. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  15623. *
  15624. * @details
  15625. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  15626. * the flow pool associated with the specified ID is resized
  15627. *
  15628. * The message would appear as follows:
  15629. *
  15630. * |31 16|15 8|7 0|
  15631. * |---------------------------------+----------------+----------------|
  15632. * | reserved0 | Msg type |
  15633. * |-------------------------------------------------------------------|
  15634. * | flow pool new size | flow pool ID |
  15635. * |-------------------------------------------------------------------|
  15636. *
  15637. * The message is interpreted as follows:
  15638. * b'0:7 - msg_type: This will be set to 0x21
  15639. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  15640. *
  15641. * b'0:15 - flow pool ID: Existing flow pool ID
  15642. *
  15643. * b'16:31 - flow pool new size: new pool size for existing flow pool ID
  15644. *
  15645. */
  15646. PREPACK struct htt_flow_pool_resize_t {
  15647. A_UINT32 msg_type:8,
  15648. reserved0:24;
  15649. A_UINT32 flow_pool_id:16,
  15650. flow_pool_new_size:16;
  15651. } POSTPACK;
  15652. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  15653. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  15654. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  15655. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  15656. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  15657. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  15658. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  15659. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  15660. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  15661. do { \
  15662. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  15663. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  15664. } while (0)
  15665. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  15666. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  15667. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  15668. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  15669. do { \
  15670. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  15671. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  15672. } while (0)
  15673. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  15674. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  15675. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  15676. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  15677. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  15678. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  15679. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  15680. /*
  15681. * The read and write indices point to the data within the host buffer.
  15682. * Because the first 4 bytes of the host buffer is used for the read index and
  15683. * the next 4 bytes for the write index, the data itself starts at offset 8.
  15684. * The read index and write index are the byte offsets from the base of the
  15685. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  15686. * Refer the ASCII text picture below.
  15687. */
  15688. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  15689. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  15690. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  15691. /*
  15692. ***************************************************************************
  15693. *
  15694. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15695. *
  15696. ***************************************************************************
  15697. *
  15698. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  15699. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  15700. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  15701. * written into the Host memory region mentioned below.
  15702. *
  15703. * Read index is updated by the Host. At any point of time, the read index will
  15704. * indicate the index that will next be read by the Host. The read index is
  15705. * in units of bytes offset from the base of the meta-data buffer.
  15706. *
  15707. * Write index is updated by the FW. At any point of time, the write index will
  15708. * indicate from where the FW can start writing any new data. The write index is
  15709. * in units of bytes offset from the base of the meta-data buffer.
  15710. *
  15711. * If the Host is not fast enough in reading the CFR data, any new capture data
  15712. * would be dropped if there is no space left to write the new captures.
  15713. *
  15714. * The last 4 bytes of the memory region will have the magic pattern
  15715. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  15716. * not overrun the host buffer.
  15717. *
  15718. * ,--------------------. read and write indices store the
  15719. * | | byte offset from the base of the
  15720. * | ,--------+--------. meta-data buffer to the next
  15721. * | | | | location within the data buffer
  15722. * | | v v that will be read / written
  15723. * ************************************************************************
  15724. * * Read * Write * * Magic *
  15725. * * index * index * CFR data1 ...... CFR data N * pattern *
  15726. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  15727. * ************************************************************************
  15728. * |<---------- data buffer ---------->|
  15729. *
  15730. * |<----------------- meta-data buffer allocated in Host ----------------|
  15731. *
  15732. * Note:
  15733. * - Considering the 4 bytes needed to store the Read index (R) and the
  15734. * Write index (W), the initial value is as follows:
  15735. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  15736. * - Buffer empty condition:
  15737. * R = W
  15738. *
  15739. * Regarding CFR data format:
  15740. * --------------------------
  15741. *
  15742. * Each CFR tone is stored in HW as 16-bits with the following format:
  15743. * {bits[15:12], bits[11:6], bits[5:0]} =
  15744. * {unsigned exponent (4 bits),
  15745. * signed mantissa_real (6 bits),
  15746. * signed mantissa_imag (6 bits)}
  15747. *
  15748. * CFR_real = mantissa_real * 2^(exponent-5)
  15749. * CFR_imag = mantissa_imag * 2^(exponent-5)
  15750. *
  15751. *
  15752. * The CFR data is written to the 16-bit unsigned output array (buff) in
  15753. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  15754. *
  15755. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  15756. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  15757. * .
  15758. * .
  15759. * .
  15760. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  15761. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  15762. */
  15763. /* Bandwidth of peer CFR captures */
  15764. typedef enum {
  15765. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  15766. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  15767. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  15768. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  15769. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  15770. HTT_PEER_CFR_CAPTURE_BW_MAX,
  15771. } HTT_PEER_CFR_CAPTURE_BW;
  15772. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  15773. * was captured
  15774. */
  15775. typedef enum {
  15776. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  15777. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  15778. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  15779. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  15780. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  15781. } HTT_PEER_CFR_CAPTURE_MODE;
  15782. typedef enum {
  15783. /* This message type is currently used for the below purpose:
  15784. *
  15785. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  15786. * wmi_peer_cfr_capture_cmd.
  15787. * If payload_present bit is set to 0 then the associated memory region
  15788. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  15789. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  15790. * message; the CFR dump will be present at the end of the message,
  15791. * after the chan_phy_mode.
  15792. */
  15793. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  15794. /* Always keep this last */
  15795. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  15796. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  15797. /**
  15798. * @brief target -> host CFR dump completion indication message definition
  15799. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  15800. *
  15801. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  15802. *
  15803. * @details
  15804. * The following diagram shows the format of the Channel Frequency Response
  15805. * (CFR) dump completion indication. This inidcation is sent to the Host when
  15806. * the channel capture of a peer is copied by Firmware into the Host memory
  15807. *
  15808. * **************************************************************************
  15809. *
  15810. * Message format when the CFR capture message type is
  15811. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15812. *
  15813. * **************************************************************************
  15814. *
  15815. * |31 16|15 |8|7 0|
  15816. * |----------------------------------------------------------------|
  15817. * header: | reserved |P| msg_type |
  15818. * word 0 | | | |
  15819. * |----------------------------------------------------------------|
  15820. * payload: | cfr_capture_msg_type |
  15821. * word 1 | |
  15822. * |----------------------------------------------------------------|
  15823. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  15824. * word 2 | | | | | | | | |
  15825. * |----------------------------------------------------------------|
  15826. * | mac_addr31to0 |
  15827. * word 3 | |
  15828. * |----------------------------------------------------------------|
  15829. * | unused / reserved | mac_addr47to32 |
  15830. * word 4 | | |
  15831. * |----------------------------------------------------------------|
  15832. * | index |
  15833. * word 5 | |
  15834. * |----------------------------------------------------------------|
  15835. * | length |
  15836. * word 6 | |
  15837. * |----------------------------------------------------------------|
  15838. * | timestamp |
  15839. * word 7 | |
  15840. * |----------------------------------------------------------------|
  15841. * | counter |
  15842. * word 8 | |
  15843. * |----------------------------------------------------------------|
  15844. * | chan_mhz |
  15845. * word 9 | |
  15846. * |----------------------------------------------------------------|
  15847. * | band_center_freq1 |
  15848. * word 10 | |
  15849. * |----------------------------------------------------------------|
  15850. * | band_center_freq2 |
  15851. * word 11 | |
  15852. * |----------------------------------------------------------------|
  15853. * | chan_phy_mode |
  15854. * word 12 | |
  15855. * |----------------------------------------------------------------|
  15856. * where,
  15857. * P - payload present bit (payload_present explained below)
  15858. * req_id - memory request id (mem_req_id explained below)
  15859. * S - status field (status explained below)
  15860. * capbw - capture bandwidth (capture_bw explained below)
  15861. * mode - mode of capture (mode explained below)
  15862. * sts - space time streams (sts_count explained below)
  15863. * chbw - channel bandwidth (channel_bw explained below)
  15864. * captype - capture type (cap_type explained below)
  15865. *
  15866. * The following field definitions describe the format of the CFR dump
  15867. * completion indication sent from the target to the host
  15868. *
  15869. * Header fields:
  15870. *
  15871. * Word 0
  15872. * - msg_type
  15873. * Bits 7:0
  15874. * Purpose: Identifies this as CFR TX completion indication
  15875. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  15876. * - payload_present
  15877. * Bit 8
  15878. * Purpose: Identifies how CFR data is sent to host
  15879. * Value: 0 - If CFR Payload is written to host memory
  15880. * 1 - If CFR Payload is sent as part of HTT message
  15881. * (This is the requirement for SDIO/USB where it is
  15882. * not possible to write CFR data to host memory)
  15883. * - reserved
  15884. * Bits 31:9
  15885. * Purpose: Reserved
  15886. * Value: 0
  15887. *
  15888. * Payload fields:
  15889. *
  15890. * Word 1
  15891. * - cfr_capture_msg_type
  15892. * Bits 31:0
  15893. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  15894. * to specify the format used for the remainder of the message
  15895. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15896. * (currently only MSG_TYPE_1 is defined)
  15897. *
  15898. * Word 2
  15899. * - mem_req_id
  15900. * Bits 6:0
  15901. * Purpose: Contain the mem request id of the region where the CFR capture
  15902. * has been stored - of type WMI_HOST_MEM_REQ_ID
  15903. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  15904. this value is invalid)
  15905. * - status
  15906. * Bit 7
  15907. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  15908. * Value: 1 (True) - Successful; 0 (False) - Not successful
  15909. * - capture_bw
  15910. * Bits 10:8
  15911. * Purpose: Carry the bandwidth of the CFR capture
  15912. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  15913. * - mode
  15914. * Bits 13:11
  15915. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  15916. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  15917. * - sts_count
  15918. * Bits 16:14
  15919. * Purpose: Carry the number of space time streams
  15920. * Value: Number of space time streams
  15921. * - channel_bw
  15922. * Bits 19:17
  15923. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  15924. * measurement
  15925. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  15926. * - cap_type
  15927. * Bits 23:20
  15928. * Purpose: Carry the type of the capture
  15929. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  15930. * - vdev_id
  15931. * Bits 31:24
  15932. * Purpose: Carry the virtual device id
  15933. * Value: vdev ID
  15934. *
  15935. * Word 3
  15936. * - mac_addr31to0
  15937. * Bits 31:0
  15938. * Purpose: Contain the bits 31:0 of the peer MAC address
  15939. * Value: Bits 31:0 of the peer MAC address
  15940. *
  15941. * Word 4
  15942. * - mac_addr47to32
  15943. * Bits 15:0
  15944. * Purpose: Contain the bits 47:32 of the peer MAC address
  15945. * Value: Bits 47:32 of the peer MAC address
  15946. *
  15947. * Word 5
  15948. * - index
  15949. * Bits 31:0
  15950. * Purpose: Contain the index at which this CFR dump was written in the Host
  15951. * allocated memory. This index is the number of bytes from the base address.
  15952. * Value: Index position
  15953. *
  15954. * Word 6
  15955. * - length
  15956. * Bits 31:0
  15957. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  15958. * Value: Length of the CFR capture of the peer
  15959. *
  15960. * Word 7
  15961. * - timestamp
  15962. * Bits 31:0
  15963. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  15964. * clock used for this timestamp is private to the target and not visible to
  15965. * the host i.e., Host can interpret only the relative timestamp deltas from
  15966. * one message to the next, but can't interpret the absolute timestamp from a
  15967. * single message.
  15968. * Value: Timestamp in microseconds
  15969. *
  15970. * Word 8
  15971. * - counter
  15972. * Bits 31:0
  15973. * Purpose: Carry the count of the current CFR capture from FW. This is
  15974. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  15975. * in host memory)
  15976. * Value: Count of the current CFR capture
  15977. *
  15978. * Word 9
  15979. * - chan_mhz
  15980. * Bits 31:0
  15981. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  15982. * Value: Primary 20 channel frequency
  15983. *
  15984. * Word 10
  15985. * - band_center_freq1
  15986. * Bits 31:0
  15987. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  15988. * Value: Center frequency 1 in MHz
  15989. *
  15990. * Word 11
  15991. * - band_center_freq2
  15992. * Bits 31:0
  15993. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  15994. * the VDEV
  15995. * 80plus80 mode
  15996. * Value: Center frequency 2 in MHz
  15997. *
  15998. * Word 12
  15999. * - chan_phy_mode
  16000. * Bits 31:0
  16001. * Purpose: Carry the phy mode of the channel, of the VDEV
  16002. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  16003. */
  16004. PREPACK struct htt_cfr_dump_ind_type_1 {
  16005. A_UINT32 mem_req_id:7,
  16006. status:1,
  16007. capture_bw:3,
  16008. mode:3,
  16009. sts_count:3,
  16010. channel_bw:3,
  16011. cap_type:4,
  16012. vdev_id:8;
  16013. htt_mac_addr addr;
  16014. A_UINT32 index;
  16015. A_UINT32 length;
  16016. A_UINT32 timestamp;
  16017. A_UINT32 counter;
  16018. struct htt_chan_change_msg chan;
  16019. } POSTPACK;
  16020. PREPACK struct htt_cfr_dump_compl_ind {
  16021. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  16022. union {
  16023. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  16024. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  16025. /* If there is a need to change the memory layout and its associated
  16026. * HTT indication format, a new CFR capture message type can be
  16027. * introduced and added into this union.
  16028. */
  16029. };
  16030. } POSTPACK;
  16031. /*
  16032. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  16033. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  16034. */
  16035. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  16036. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  16037. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  16038. do { \
  16039. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  16040. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  16041. } while(0)
  16042. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  16043. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  16044. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  16045. /*
  16046. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  16047. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  16048. */
  16049. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  16050. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  16051. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  16052. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  16053. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  16054. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  16055. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  16056. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  16057. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  16058. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  16059. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  16060. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  16061. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  16062. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  16063. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  16064. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  16065. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  16066. do { \
  16067. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  16068. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  16069. } while (0)
  16070. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  16071. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  16072. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  16073. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  16074. do { \
  16075. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  16076. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  16077. } while (0)
  16078. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  16079. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  16080. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  16081. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  16082. do { \
  16083. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  16084. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  16085. } while (0)
  16086. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  16087. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  16088. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  16089. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  16090. do { \
  16091. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  16092. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  16093. } while (0)
  16094. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  16095. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  16096. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  16097. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  16098. do { \
  16099. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  16100. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  16101. } while (0)
  16102. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  16103. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  16104. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  16105. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  16106. do { \
  16107. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  16108. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  16109. } while (0)
  16110. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  16111. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  16112. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  16113. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  16114. do { \
  16115. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  16116. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  16117. } while (0)
  16118. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  16119. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  16120. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  16121. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  16122. do { \
  16123. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  16124. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  16125. } while (0)
  16126. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  16127. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  16128. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  16129. /**
  16130. * @brief target -> host peer (PPDU) stats message
  16131. *
  16132. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  16133. *
  16134. * @details
  16135. * This message is generated by FW when FW is sending stats to host
  16136. * about one or more PPDUs that the FW has transmitted to one or more peers.
  16137. * This message is sent autonomously by the target rather than upon request
  16138. * by the host.
  16139. * The following field definitions describe the format of the HTT target
  16140. * to host peer stats indication message.
  16141. *
  16142. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  16143. * or more PPDU stats records.
  16144. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  16145. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  16146. * then the message would start with the
  16147. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  16148. * below.
  16149. *
  16150. * |31 16|15|14|13 11|10 9|8|7 0|
  16151. * |-------------------------------------------------------------|
  16152. * | reserved |MSG_TYPE |
  16153. * |-------------------------------------------------------------|
  16154. * rec 0 | TLV header |
  16155. * rec 0 |-------------------------------------------------------------|
  16156. * rec 0 | ppdu successful bytes |
  16157. * rec 0 |-------------------------------------------------------------|
  16158. * rec 0 | ppdu retry bytes |
  16159. * rec 0 |-------------------------------------------------------------|
  16160. * rec 0 | ppdu failed bytes |
  16161. * rec 0 |-------------------------------------------------------------|
  16162. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  16163. * rec 0 |-------------------------------------------------------------|
  16164. * rec 0 | retried MSDUs | successful MSDUs |
  16165. * rec 0 |-------------------------------------------------------------|
  16166. * rec 0 | TX duration | failed MSDUs |
  16167. * rec 0 |-------------------------------------------------------------|
  16168. * ...
  16169. * |-------------------------------------------------------------|
  16170. * rec N | TLV header |
  16171. * rec N |-------------------------------------------------------------|
  16172. * rec N | ppdu successful bytes |
  16173. * rec N |-------------------------------------------------------------|
  16174. * rec N | ppdu retry bytes |
  16175. * rec N |-------------------------------------------------------------|
  16176. * rec N | ppdu failed bytes |
  16177. * rec N |-------------------------------------------------------------|
  16178. * rec N | peer id | S|SG| BW | BA |A|rate code|
  16179. * rec N |-------------------------------------------------------------|
  16180. * rec N | retried MSDUs | successful MSDUs |
  16181. * rec N |-------------------------------------------------------------|
  16182. * rec N | TX duration | failed MSDUs |
  16183. * rec N |-------------------------------------------------------------|
  16184. *
  16185. * where:
  16186. * A = is A-MPDU flag
  16187. * BA = block-ack failure flags
  16188. * BW = bandwidth spec
  16189. * SG = SGI enabled spec
  16190. * S = skipped rate ctrl
  16191. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  16192. *
  16193. * Header
  16194. * ------
  16195. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  16196. * dword0 - b'8:31 - reserved : Reserved for future use
  16197. *
  16198. * payload include below peer_stats information
  16199. * --------------------------------------------
  16200. * @TLV : HTT_PPDU_STATS_INFO_TLV
  16201. * @tx_success_bytes : total successful bytes in the PPDU.
  16202. * @tx_retry_bytes : total retried bytes in the PPDU.
  16203. * @tx_failed_bytes : total failed bytes in the PPDU.
  16204. * @tx_ratecode : rate code used for the PPDU.
  16205. * @is_ampdu : Indicates PPDU is AMPDU or not.
  16206. * @ba_ack_failed : BA/ACK failed for this PPDU
  16207. * b00 -> BA received
  16208. * b01 -> BA failed once
  16209. * b10 -> BA failed twice, when HW retry is enabled.
  16210. * @bw : BW
  16211. * b00 -> 20 MHz
  16212. * b01 -> 40 MHz
  16213. * b10 -> 80 MHz
  16214. * b11 -> 160 MHz (or 80+80)
  16215. * @sg : SGI enabled
  16216. * @s : skipped ratectrl
  16217. * @peer_id : peer id
  16218. * @tx_success_msdus : successful MSDUs
  16219. * @tx_retry_msdus : retried MSDUs
  16220. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  16221. * @tx_duration : Tx duration for the PPDU (microsecond units)
  16222. */
  16223. /**
  16224. * @brief target -> host backpressure event
  16225. *
  16226. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  16227. *
  16228. * @details
  16229. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  16230. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  16231. * This message will only be sent if the backpressure condition has existed
  16232. * continuously for an initial period (100 ms).
  16233. * Repeat messages with updated information will be sent after each
  16234. * subsequent period (100 ms) as long as the backpressure remains unabated.
  16235. * This message indicates the ring id along with current head and tail index
  16236. * locations (i.e. write and read indices).
  16237. * The backpressure time indicates the time in ms for which continuous
  16238. * backpressure has been observed in the ring.
  16239. *
  16240. * The message format is as follows:
  16241. *
  16242. * |31 24|23 16|15 8|7 0|
  16243. * |----------------+----------------+----------------+----------------|
  16244. * | ring_id | ring_type | pdev_id | msg_type |
  16245. * |-------------------------------------------------------------------|
  16246. * | tail_idx | head_idx |
  16247. * |-------------------------------------------------------------------|
  16248. * | backpressure_time_ms |
  16249. * |-------------------------------------------------------------------|
  16250. *
  16251. * The message is interpreted as follows:
  16252. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  16253. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  16254. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  16255. * 1, 2, 3 indicates pdev_id 0,1,2 and
  16256. * the msg is for LMAC ring.
  16257. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  16258. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  16259. * htt_backpressure_lmac_ring_id. This represents
  16260. * the ring id for which continuous backpressure
  16261. * is seen
  16262. *
  16263. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  16264. * the ring indicated by the ring_id
  16265. *
  16266. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  16267. * the ring indicated by the ring id
  16268. *
  16269. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continuous
  16270. * backpressure has been seen in the ring
  16271. * indicated by the ring_id.
  16272. * Units = milliseconds
  16273. */
  16274. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  16275. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  16276. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  16277. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  16278. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  16279. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  16280. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  16281. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  16282. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  16283. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  16284. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  16285. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  16286. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  16287. do { \
  16288. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  16289. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  16290. } while (0)
  16291. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  16292. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  16293. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  16294. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  16295. do { \
  16296. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  16297. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  16298. } while (0)
  16299. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  16300. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  16301. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  16302. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  16303. do { \
  16304. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  16305. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  16306. } while (0)
  16307. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  16308. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  16309. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  16310. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  16311. do { \
  16312. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  16313. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  16314. } while (0)
  16315. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  16316. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  16317. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  16318. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  16319. do { \
  16320. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  16321. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  16322. } while (0)
  16323. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  16324. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  16325. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  16326. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  16327. do { \
  16328. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  16329. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  16330. } while (0)
  16331. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  16332. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  16333. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  16334. enum htt_backpressure_ring_type {
  16335. HTT_SW_RING_TYPE_UMAC,
  16336. HTT_SW_RING_TYPE_LMAC,
  16337. HTT_SW_RING_TYPE_MAX,
  16338. };
  16339. /* Ring id for which the message is sent to host */
  16340. enum htt_backpressure_umac_ringid {
  16341. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  16342. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  16343. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  16344. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  16345. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  16346. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  16347. HTT_SW_RING_IDX_REO_REO2FW_RING,
  16348. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  16349. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  16350. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  16351. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  16352. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  16353. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  16354. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  16355. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  16356. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  16357. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  16358. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  16359. HTT_SW_UMAC_RING_IDX_MAX,
  16360. };
  16361. enum htt_backpressure_lmac_ringid {
  16362. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  16363. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  16364. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  16365. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  16366. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  16367. HTT_SW_RING_IDX_RXDMA2FW_RING,
  16368. HTT_SW_RING_IDX_RXDMA2SW_RING,
  16369. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  16370. HTT_SW_RING_IDX_RXDMA2REO_RING,
  16371. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  16372. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  16373. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  16374. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  16375. HTT_SW_LMAC_RING_IDX_MAX,
  16376. };
  16377. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  16378. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  16379. pdev_id: 8,
  16380. ring_type: 8, /* htt_backpressure_ring_type */
  16381. /*
  16382. * ring_id holds an enum value from either
  16383. * htt_backpressure_umac_ringid or
  16384. * htt_backpressure_lmac_ringid, based on
  16385. * the ring_type setting.
  16386. */
  16387. ring_id: 8;
  16388. A_UINT16 head_idx;
  16389. A_UINT16 tail_idx;
  16390. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  16391. } POSTPACK;
  16392. /*
  16393. * Defines two 32 bit words that can be used by the target to indicate a per
  16394. * user RU allocation and rate information.
  16395. *
  16396. * This information is currently provided in the "sw_response_reference_ptr"
  16397. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  16398. * "rx_ppdu_end_user_stats" TLV.
  16399. *
  16400. * VALID:
  16401. * The consumer of these words must explicitly check the valid bit,
  16402. * and only attempt interpretation of any of the remaining fields if
  16403. * the valid bit is set to 1.
  16404. *
  16405. * VERSION:
  16406. * The consumer of these words must also explicitly check the version bit,
  16407. * and only use the V0 definition if the VERSION field is set to 0.
  16408. *
  16409. * Version 1 is currently undefined, with the exception of the VALID and
  16410. * VERSION fields.
  16411. *
  16412. * Version 0:
  16413. *
  16414. * The fields below are duplicated per BW.
  16415. *
  16416. * The consumer must determine which BW field to use, based on the UL OFDMA
  16417. * PPDU BW indicated by HW.
  16418. *
  16419. * RU_START: RU26 start index for the user.
  16420. * Note that this is always using the RU26 index, regardless
  16421. * of the actual RU assigned to the user
  16422. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  16423. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  16424. *
  16425. * For example, 20MHz (the value in the top row is RU_START)
  16426. *
  16427. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  16428. * RU Size 1 (52): | | | | | |
  16429. * RU Size 2 (106): | | | |
  16430. * RU Size 3 (242): | |
  16431. *
  16432. * RU_SIZE: Indicates the RU size, as defined by enum
  16433. * htt_ul_ofdma_user_info_ru_size.
  16434. *
  16435. * LDPC: LDPC enabled (if 0, BCC is used)
  16436. *
  16437. * DCM: DCM enabled
  16438. *
  16439. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  16440. * |---------------------------------+--------------------------------|
  16441. * |Ver|Valid| FW internal |
  16442. * |---------------------------------+--------------------------------|
  16443. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  16444. * |---------------------------------+--------------------------------|
  16445. */
  16446. enum htt_ul_ofdma_user_info_ru_size {
  16447. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  16448. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  16449. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  16450. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  16451. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  16452. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  16453. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  16454. };
  16455. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  16456. struct htt_ul_ofdma_user_info_v0 {
  16457. A_UINT32 word0;
  16458. A_UINT32 word1;
  16459. };
  16460. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  16461. A_UINT32 w0_fw_rsvd:30; \
  16462. A_UINT32 w0_valid:1; \
  16463. A_UINT32 w0_version:1;
  16464. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  16465. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  16466. };
  16467. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  16468. A_UINT32 w1_nss:3; \
  16469. A_UINT32 w1_mcs:4; \
  16470. A_UINT32 w1_ldpc:1; \
  16471. A_UINT32 w1_dcm:1; \
  16472. A_UINT32 w1_ru_start:7; \
  16473. A_UINT32 w1_ru_size:3; \
  16474. A_UINT32 w1_trig_type:4; \
  16475. A_UINT32 w1_unused:9;
  16476. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  16477. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  16478. };
  16479. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  16480. A_UINT32 w0_fw_rsvd:27; \
  16481. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  16482. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  16483. 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) */
  16484. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  16485. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  16486. };
  16487. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  16488. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  16489. A_UINT32 w1_trig_type:4; \
  16490. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  16491. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  16492. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  16493. };
  16494. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  16495. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  16496. union {
  16497. A_UINT32 word0;
  16498. struct {
  16499. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  16500. };
  16501. };
  16502. union {
  16503. A_UINT32 word1;
  16504. struct {
  16505. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  16506. };
  16507. };
  16508. } POSTPACK;
  16509. /*
  16510. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  16511. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  16512. * this should be picked.
  16513. */
  16514. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  16515. union {
  16516. A_UINT32 word0;
  16517. struct {
  16518. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  16519. };
  16520. };
  16521. union {
  16522. A_UINT32 word1;
  16523. struct {
  16524. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  16525. };
  16526. };
  16527. } POSTPACK;
  16528. enum HTT_UL_OFDMA_TRIG_TYPE {
  16529. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  16530. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  16531. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  16532. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  16533. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  16534. };
  16535. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  16536. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  16537. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  16538. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  16539. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  16540. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  16541. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  16542. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  16543. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  16544. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  16545. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  16546. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  16547. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  16548. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  16549. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  16550. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  16551. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  16552. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  16553. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  16554. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  16555. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  16556. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  16557. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  16558. /*--- word 0 ---*/
  16559. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  16560. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  16561. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  16562. do { \
  16563. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  16564. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  16565. } while (0)
  16566. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  16567. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  16568. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  16569. do { \
  16570. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  16571. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  16572. } while (0)
  16573. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  16574. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  16575. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  16576. do { \
  16577. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  16578. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  16579. } while (0)
  16580. /*--- word 1 ---*/
  16581. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  16582. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  16583. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  16584. do { \
  16585. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  16586. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  16587. } while (0)
  16588. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  16589. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  16590. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  16591. do { \
  16592. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  16593. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  16594. } while (0)
  16595. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  16596. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  16597. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  16598. do { \
  16599. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  16600. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  16601. } while (0)
  16602. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  16603. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  16604. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  16605. do { \
  16606. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  16607. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  16608. } while (0)
  16609. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  16610. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  16611. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  16612. do { \
  16613. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  16614. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  16615. } while (0)
  16616. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  16617. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  16618. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  16619. do { \
  16620. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  16621. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  16622. } while (0)
  16623. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  16624. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  16625. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  16626. do { \
  16627. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  16628. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  16629. } while (0)
  16630. /**
  16631. * @brief target -> host channel calibration data message
  16632. *
  16633. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  16634. *
  16635. * @brief host -> target channel calibration data message
  16636. *
  16637. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  16638. *
  16639. * @details
  16640. * The following field definitions describe the format of the channel
  16641. * calibration data message sent from the target to the host when
  16642. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  16643. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  16644. * The message is defined as htt_chan_caldata_msg followed by a variable
  16645. * number of 32-bit character values.
  16646. *
  16647. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  16648. * |------------------------------------------------------------------|
  16649. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  16650. * |------------------------------------------------------------------|
  16651. * | payload size | mhz |
  16652. * |------------------------------------------------------------------|
  16653. * | center frequency 2 | center frequency 1 |
  16654. * |------------------------------------------------------------------|
  16655. * | check sum |
  16656. * |------------------------------------------------------------------|
  16657. * | payload |
  16658. * |------------------------------------------------------------------|
  16659. * message info field:
  16660. * - MSG_TYPE
  16661. * Bits 7:0
  16662. * Purpose: identifies this as a channel calibration data message
  16663. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  16664. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  16665. * - SUB_TYPE
  16666. * Bits 11:8
  16667. * Purpose: T2H: indicates whether target is providing chan cal data
  16668. * to the host to store, or requesting that the host
  16669. * download previously-stored data.
  16670. * H2T: indicates whether the host is providing the requested
  16671. * channel cal data, or if it is rejecting the data
  16672. * request because it does not have the requested data.
  16673. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  16674. * - CHKSUM_VALID
  16675. * Bit 12
  16676. * Purpose: indicates if the checksum field is valid
  16677. * value:
  16678. * - FRAG
  16679. * Bit 19:16
  16680. * Purpose: indicates the fragment index for message
  16681. * value: 0 for first fragment, 1 for second fragment, ...
  16682. * - APPEND
  16683. * Bit 20
  16684. * Purpose: indicates if this is the last fragment
  16685. * value: 0 = final fragment, 1 = more fragments will be appended
  16686. *
  16687. * channel and payload size field
  16688. * - MHZ
  16689. * Bits 15:0
  16690. * Purpose: indicates the channel primary frequency
  16691. * Value:
  16692. * - PAYLOAD_SIZE
  16693. * Bits 31:16
  16694. * Purpose: indicates the bytes of calibration data in payload
  16695. * Value:
  16696. *
  16697. * center frequency field
  16698. * - CENTER FREQUENCY 1
  16699. * Bits 15:0
  16700. * Purpose: indicates the channel center frequency
  16701. * Value: channel center frequency, in MHz units
  16702. * - CENTER FREQUENCY 2
  16703. * Bits 31:16
  16704. * Purpose: indicates the secondary channel center frequency,
  16705. * only for 11acvht 80plus80 mode
  16706. * Value: secondary channel center frequency, in MHz units, if applicable
  16707. *
  16708. * checksum field
  16709. * - CHECK_SUM
  16710. * Bits 31:0
  16711. * Purpose: check the payload data, it is just for this fragment.
  16712. * This is intended for the target to check that the channel
  16713. * calibration data returned by the host is the unmodified data
  16714. * that was previously provided to the host by the target.
  16715. * value: checksum of fragment payload
  16716. */
  16717. PREPACK struct htt_chan_caldata_msg {
  16718. /* DWORD 0: message info */
  16719. A_UINT32
  16720. msg_type: 8,
  16721. sub_type: 4 ,
  16722. chksum_valid: 1, /** 1:valid, 0:invalid */
  16723. reserved1: 3,
  16724. frag_idx: 4, /** fragment index for calibration data */
  16725. appending: 1, /** 0: no fragment appending,
  16726. * 1: extra fragment appending */
  16727. reserved2: 11;
  16728. /* DWORD 1: channel and payload size */
  16729. A_UINT32
  16730. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  16731. payload_size: 16; /** unit: bytes */
  16732. /* DWORD 2: center frequency */
  16733. A_UINT32
  16734. band_center_freq1: 16, /** Center frequency 1 in MHz */
  16735. band_center_freq2: 16; /** Center frequency 2 in MHz,
  16736. * valid only for 11acvht 80plus80 mode */
  16737. /* DWORD 3: check sum */
  16738. A_UINT32 chksum;
  16739. /* variable length for calibration data */
  16740. A_UINT32 payload[1/* or more */];
  16741. } POSTPACK;
  16742. /* T2H SUBTYPE */
  16743. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  16744. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  16745. /* H2T SUBTYPE */
  16746. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  16747. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  16748. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  16749. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  16750. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  16751. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  16752. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  16753. do { \
  16754. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  16755. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  16756. } while (0)
  16757. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  16758. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  16759. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  16760. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  16761. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  16762. do { \
  16763. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  16764. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  16765. } while (0)
  16766. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  16767. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  16768. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  16769. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  16770. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  16771. do { \
  16772. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  16773. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  16774. } while (0)
  16775. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  16776. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  16777. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  16778. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  16779. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  16780. do { \
  16781. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  16782. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  16783. } while (0)
  16784. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  16785. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  16786. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  16787. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  16788. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  16789. do { \
  16790. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  16791. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  16792. } while (0)
  16793. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  16794. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  16795. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  16796. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  16797. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  16798. do { \
  16799. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  16800. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  16801. } while (0)
  16802. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  16803. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  16804. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  16805. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  16806. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  16807. do { \
  16808. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  16809. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  16810. } while (0)
  16811. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  16812. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  16813. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  16814. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  16815. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  16816. do { \
  16817. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  16818. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  16819. } while (0)
  16820. /**
  16821. * @brief target -> host FSE CMEM based send
  16822. *
  16823. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  16824. *
  16825. * @details
  16826. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  16827. * FSE placement in CMEM is enabled.
  16828. *
  16829. * This message sends the non-secure CMEM base address.
  16830. * It will be sent to host in response to message
  16831. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  16832. * The message would appear as follows:
  16833. *
  16834. * |31 24|23 16|15 8|7 0|
  16835. * |----------------+----------------+----------------+----------------|
  16836. * | reserved | num_entries | msg_type |
  16837. * |----------------+----------------+----------------+----------------|
  16838. * | base_address_lo |
  16839. * |----------------+----------------+----------------+----------------|
  16840. * | base_address_hi |
  16841. * |-------------------------------------------------------------------|
  16842. *
  16843. * The message is interpreted as follows:
  16844. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  16845. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  16846. * b'8:15 - number_entries: Indicated the number of entries
  16847. * programmed.
  16848. * b'16:31 - reserved.
  16849. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  16850. * CMEM base address
  16851. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  16852. * CMEM base address
  16853. */
  16854. PREPACK struct htt_cmem_base_send_t {
  16855. A_UINT32 msg_type: 8,
  16856. num_entries: 8,
  16857. reserved: 16;
  16858. A_UINT32 base_address_lo;
  16859. A_UINT32 base_address_hi;
  16860. } POSTPACK;
  16861. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  16862. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  16863. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  16864. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  16865. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  16866. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  16867. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  16868. do { \
  16869. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  16870. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  16871. } while (0)
  16872. /**
  16873. * @brief - HTT PPDU ID format
  16874. *
  16875. * @details
  16876. * The following field definitions describe the format of the PPDU ID.
  16877. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  16878. *
  16879. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  16880. * +--------------------------------------------------------------------------
  16881. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  16882. * +--------------------------------------------------------------------------
  16883. *
  16884. * sch id :Schedule command id
  16885. * Bits [11 : 0] : monotonically increasing counter to track the
  16886. * PPDU posted to a specific transmit queue.
  16887. *
  16888. * hwq_id: Hardware Queue ID.
  16889. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  16890. *
  16891. * mac_id: MAC ID
  16892. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  16893. *
  16894. * seq_idx: Sequence index.
  16895. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  16896. * a particular TXOP.
  16897. *
  16898. * tqm_cmd: HWSCH/TQM flag.
  16899. * Bit [23] : Always set to 0.
  16900. *
  16901. * seq_cmd_type: Sequence command type.
  16902. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  16903. * Refer to enum HTT_STATS_FTYPE for values.
  16904. */
  16905. PREPACK struct htt_ppdu_id {
  16906. A_UINT32
  16907. sch_id: 12,
  16908. hwq_id: 5,
  16909. mac_id: 2,
  16910. seq_idx: 2,
  16911. reserved1: 2,
  16912. tqm_cmd: 1,
  16913. seq_cmd_type: 6,
  16914. reserved2: 2;
  16915. } POSTPACK;
  16916. #define HTT_PPDU_ID_SCH_ID_S 0
  16917. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  16918. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  16919. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  16920. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  16921. do { \
  16922. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  16923. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  16924. } while (0)
  16925. #define HTT_PPDU_ID_HWQ_ID_S 12
  16926. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  16927. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  16928. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  16929. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  16930. do { \
  16931. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  16932. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  16933. } while (0)
  16934. #define HTT_PPDU_ID_MAC_ID_S 17
  16935. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  16936. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  16937. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  16938. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  16939. do { \
  16940. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  16941. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  16942. } while (0)
  16943. #define HTT_PPDU_ID_SEQ_IDX_S 19
  16944. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  16945. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  16946. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  16947. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  16948. do { \
  16949. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  16950. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  16951. } while (0)
  16952. #define HTT_PPDU_ID_TQM_CMD_S 23
  16953. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  16954. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  16955. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  16956. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  16957. do { \
  16958. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  16959. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  16960. } while (0)
  16961. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  16962. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  16963. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  16964. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  16965. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  16966. do { \
  16967. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  16968. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  16969. } while (0)
  16970. /**
  16971. * @brief target -> RX PEER METADATA V0 format
  16972. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16973. * message from target, and will confirm to the target which peer metadata
  16974. * version to use in the wmi_init message.
  16975. *
  16976. * The following diagram shows the format of the RX PEER METADATA.
  16977. *
  16978. * |31 24|23 16|15 8|7 0|
  16979. * |-----------------------------------------------------------------------|
  16980. * | Reserved | VDEV ID | PEER ID |
  16981. * |-----------------------------------------------------------------------|
  16982. */
  16983. PREPACK struct htt_rx_peer_metadata_v0 {
  16984. A_UINT32
  16985. peer_id: 16,
  16986. vdev_id: 8,
  16987. reserved1: 8;
  16988. } POSTPACK;
  16989. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  16990. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  16991. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  16992. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  16993. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  16994. do { \
  16995. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  16996. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  16997. } while (0)
  16998. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  16999. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  17000. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  17001. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  17002. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  17003. do { \
  17004. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  17005. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  17006. } while (0)
  17007. /**
  17008. * @brief target -> RX PEER METADATA V1 format
  17009. * Host will know the peer metadata version from the wmi_service_ready_ext2
  17010. * message from target, and will confirm to the target which peer metadata
  17011. * version to use in the wmi_init message.
  17012. *
  17013. * The following diagram shows the format of the RX PEER METADATA V1 format.
  17014. *
  17015. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  17016. * |---------------------------------------------------------------------------|
  17017. * |Rsvd2|CHIP ID|LMAC ID|VDEV ID|logical_link_id|ML PEER|SW PEER ID/ML PEER ID|
  17018. * |---------------------------------------------------------------------------|
  17019. */
  17020. PREPACK struct htt_rx_peer_metadata_v1 {
  17021. A_UINT32
  17022. peer_id: 13,
  17023. ml_peer_valid: 1,
  17024. logical_link_id: 2,
  17025. vdev_id: 8,
  17026. lmac_id: 2,
  17027. chip_id: 3,
  17028. reserved2: 3;
  17029. } POSTPACK;
  17030. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  17031. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  17032. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  17033. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  17034. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  17035. do { \
  17036. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  17037. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  17038. } while (0)
  17039. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  17040. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  17041. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  17042. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  17043. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  17044. do { \
  17045. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  17046. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  17047. } while (0)
  17048. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  17049. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  17050. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  17051. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  17052. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S 14
  17053. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M 0x0000c000
  17054. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_GET(_var) \
  17055. (((_var) & HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M) >> HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)
  17056. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_SET(_var, _val) \
  17057. do { \
  17058. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID, _val); \
  17059. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)); \
  17060. } while (0)
  17061. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  17062. do { \
  17063. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  17064. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  17065. } while (0)
  17066. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  17067. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  17068. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  17069. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  17070. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  17071. do { \
  17072. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  17073. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  17074. } while (0)
  17075. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  17076. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  17077. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  17078. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  17079. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  17080. do { \
  17081. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  17082. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  17083. } while (0)
  17084. /*
  17085. * In some systems, the host SW wants to specify priorities between
  17086. * different MSDU / flow queues within the same peer-TID.
  17087. * The below enums are used for the host to identify to the target
  17088. * which MSDU queue's priority it wants to adjust.
  17089. */
  17090. /*
  17091. * The MSDUQ index describe index of TCL HW, where each index is
  17092. * used for queuing particular types of MSDUs.
  17093. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  17094. */
  17095. enum HTT_MSDUQ_INDEX {
  17096. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  17097. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  17098. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  17099. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  17100. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  17101. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  17102. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  17103. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  17104. HTT_MSDUQ_MAX_INDEX,
  17105. };
  17106. /* MSDU qtype definition */
  17107. enum HTT_MSDU_QTYPE {
  17108. /*
  17109. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  17110. * relative priority. Instead, the relative priority of CRIT_0 versus
  17111. * CRIT_1 is controlled by the FW, through the configuration parameters
  17112. * it applies to the queues.
  17113. */
  17114. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  17115. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  17116. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  17117. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  17118. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  17119. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  17120. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  17121. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  17122. /* New MSDU_QTYPE should be added above this line */
  17123. /*
  17124. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  17125. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  17126. * any host/target message definitions. The QTYPE_MAX value can
  17127. * only be used internally within the host or within the target.
  17128. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  17129. * it must regard the unexpected value as a default qtype value,
  17130. * or ignore it.
  17131. */
  17132. HTT_MSDU_QTYPE_MAX,
  17133. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  17134. };
  17135. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  17136. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  17137. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  17138. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  17139. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  17140. };
  17141. /**
  17142. * @brief target -> host mlo timestamp offset indication
  17143. *
  17144. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  17145. *
  17146. * @details
  17147. * The following field definitions describe the format of the HTT target
  17148. * to host mlo timestamp offset indication message.
  17149. *
  17150. *
  17151. * |31 16|15 12|11 10|9 8|7 0 |
  17152. * |----------------------------------------------------------------------|
  17153. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  17154. * |----------------------------------------------------------------------|
  17155. * | Sync time stamp lo in us |
  17156. * |----------------------------------------------------------------------|
  17157. * | Sync time stamp hi in us |
  17158. * |----------------------------------------------------------------------|
  17159. * | mlo time stamp offset lo in us |
  17160. * |----------------------------------------------------------------------|
  17161. * | mlo time stamp offset hi in us |
  17162. * |----------------------------------------------------------------------|
  17163. * | mlo time stamp offset clocks in clock ticks |
  17164. * |----------------------------------------------------------------------|
  17165. * |31 26|25 16|15 0 |
  17166. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  17167. * | | compensation in clks | |
  17168. * |----------------------------------------------------------------------|
  17169. * |31 22|21 0 |
  17170. * | rsvd 3 | mlo time stamp comp timer period |
  17171. * |----------------------------------------------------------------------|
  17172. * The message is interpreted as follows:
  17173. *
  17174. * dword0 - b'0:7 - msg_type: This will be set to
  17175. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  17176. * value: 0x28
  17177. *
  17178. * dword0 - b'9:8 - pdev_id
  17179. *
  17180. * dword0 - b'11:10 - chip_id
  17181. *
  17182. * dword0 - b'15:12 - rsvd1: Reserved for future use
  17183. *
  17184. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  17185. *
  17186. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  17187. * which last sync interrupt was received
  17188. *
  17189. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  17190. * which last sync interrupt was received
  17191. *
  17192. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  17193. *
  17194. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  17195. *
  17196. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  17197. *
  17198. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  17199. *
  17200. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  17201. * for sub us resolution
  17202. *
  17203. * dword6 - b'31:26 - rsvd2: Reserved for future use
  17204. *
  17205. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  17206. * is applied, in us
  17207. *
  17208. * dword7 - b'31:22 - rsvd3: Reserved for future use
  17209. */
  17210. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  17211. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  17212. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  17213. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  17214. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  17215. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  17216. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  17217. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  17218. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  17219. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  17220. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  17221. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  17222. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  17223. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  17224. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  17225. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  17226. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  17227. do { \
  17228. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  17229. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  17230. } while (0)
  17231. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  17232. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  17233. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  17234. do { \
  17235. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  17236. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  17237. } while (0)
  17238. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  17239. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  17240. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  17241. do { \
  17242. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  17243. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  17244. } while (0)
  17245. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  17246. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  17247. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  17248. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  17249. do { \
  17250. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  17251. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  17252. } while (0)
  17253. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  17254. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  17255. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  17256. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  17257. do { \
  17258. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  17259. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  17260. } while (0)
  17261. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  17262. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  17263. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  17264. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  17265. do { \
  17266. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  17267. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  17268. } while (0)
  17269. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  17270. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  17271. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  17272. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  17273. do { \
  17274. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  17275. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  17276. } while (0)
  17277. typedef struct {
  17278. A_UINT32 msg_type: 8, /* bits 7:0 */
  17279. pdev_id: 2, /* bits 9:8 */
  17280. chip_id: 2, /* bits 11:10 */
  17281. reserved1: 4, /* bits 15:12 */
  17282. mac_clk_freq_mhz: 16; /* bits 31:16 */
  17283. A_UINT32 sync_timestamp_lo_us;
  17284. A_UINT32 sync_timestamp_hi_us;
  17285. A_UINT32 mlo_timestamp_offset_lo_us;
  17286. A_UINT32 mlo_timestamp_offset_hi_us;
  17287. A_UINT32 mlo_timestamp_offset_clks;
  17288. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  17289. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  17290. reserved2: 6; /* bits 31:26 */
  17291. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  17292. reserved3: 10; /* bits 31:22 */
  17293. } htt_t2h_mlo_offset_ind_t;
  17294. /*
  17295. * @brief target -> host VDEV TX RX STATS
  17296. *
  17297. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  17298. *
  17299. * @details
  17300. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  17301. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  17302. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  17303. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  17304. * periodically by target even in the absence of any further HTT request
  17305. * messages from host.
  17306. *
  17307. * The message is formatted as follows:
  17308. *
  17309. * |31 16|15 8|7 0|
  17310. * |---------------------------------+----------------+----------------|
  17311. * | payload_size | pdev_id | msg_type |
  17312. * |---------------------------------+----------------+----------------|
  17313. * | reserved0 |
  17314. * |-------------------------------------------------------------------|
  17315. * | reserved1 |
  17316. * |-------------------------------------------------------------------|
  17317. * | reserved2 |
  17318. * |-------------------------------------------------------------------|
  17319. * | |
  17320. * | VDEV specific Tx Rx stats info |
  17321. * | |
  17322. * |-------------------------------------------------------------------|
  17323. *
  17324. * The message is interpreted as follows:
  17325. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  17326. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  17327. * b'8:15 - pdev_id
  17328. * b'16:31 - size in bytes of the payload that follows the 16-byte
  17329. * message header fields (msg_type through reserved2)
  17330. * dword1 - b'0:31 - reserved0.
  17331. * dword2 - b'0:31 - reserved1.
  17332. * dword3 - b'0:31 - reserved2.
  17333. */
  17334. typedef struct {
  17335. A_UINT32 msg_type: 8,
  17336. pdev_id: 8,
  17337. payload_size: 16;
  17338. A_UINT32 reserved0;
  17339. A_UINT32 reserved1;
  17340. A_UINT32 reserved2;
  17341. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  17342. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  17343. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  17344. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  17345. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  17346. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  17347. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  17348. do { \
  17349. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  17350. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  17351. } while (0)
  17352. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  17353. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  17354. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  17355. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  17356. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  17357. do { \
  17358. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  17359. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  17360. } while (0)
  17361. /* SOC related stats */
  17362. typedef struct {
  17363. htt_tlv_hdr_t tlv_hdr;
  17364. /* When TQM is not able to find the peers during Tx, then it drops the packets
  17365. * This can be due to either the peer is deleted or deletion is ongoing
  17366. * */
  17367. A_UINT32 inv_peers_msdu_drop_count_lo;
  17368. A_UINT32 inv_peers_msdu_drop_count_hi;
  17369. } htt_t2h_soc_txrx_stats_common_tlv;
  17370. /* VDEV HW Tx/Rx stats */
  17371. typedef struct {
  17372. htt_tlv_hdr_t tlv_hdr;
  17373. A_UINT32 vdev_id;
  17374. /* Rx msdu byte cnt */
  17375. A_UINT32 rx_msdu_byte_cnt_lo;
  17376. A_UINT32 rx_msdu_byte_cnt_hi;
  17377. /* Rx msdu cnt */
  17378. A_UINT32 rx_msdu_cnt_lo;
  17379. A_UINT32 rx_msdu_cnt_hi;
  17380. /* tx msdu byte cnt */
  17381. A_UINT32 tx_msdu_byte_cnt_lo;
  17382. A_UINT32 tx_msdu_byte_cnt_hi;
  17383. /* tx msdu cnt */
  17384. A_UINT32 tx_msdu_cnt_lo;
  17385. A_UINT32 tx_msdu_cnt_hi;
  17386. /* tx excessive retry discarded msdu cnt */
  17387. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  17388. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  17389. /* TX congestion ctrl msdu drop cnt */
  17390. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  17391. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  17392. /* discarded tx msdus cnt coz of time to live expiry */
  17393. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  17394. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  17395. /* tx excessive retry discarded msdu byte cnt */
  17396. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  17397. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  17398. /* TX congestion ctrl msdu drop byte cnt */
  17399. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  17400. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  17401. /* discarded tx msdus byte cnt coz of time to live expiry */
  17402. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  17403. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  17404. /* TQM bypass frame cnt */
  17405. A_UINT32 tqm_bypass_frame_cnt_lo;
  17406. A_UINT32 tqm_bypass_frame_cnt_hi;
  17407. /* TQM bypass byte cnt */
  17408. A_UINT32 tqm_bypass_byte_cnt_lo;
  17409. A_UINT32 tqm_bypass_byte_cnt_hi;
  17410. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  17411. /*
  17412. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  17413. *
  17414. * @details
  17415. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  17416. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  17417. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  17418. * the default MSDU queues of each of the specified TIDs for the peer
  17419. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  17420. * If the default MSDU queues of a given TID within the peer are not linked
  17421. * to a service class, the svc_class_id field for that TID will have a
  17422. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  17423. * queues for that TID are not mapped to any service class.
  17424. *
  17425. * |31 16|15 8|7 0|
  17426. * |------------------------------+--------------+--------------|
  17427. * | peer ID | reserved | msg type |
  17428. * |------------------------------+--------------+------+-------|
  17429. * | reserved | svc class ID | TID |
  17430. * |------------------------------------------------------------|
  17431. * ...
  17432. * |------------------------------------------------------------|
  17433. * | reserved | svc class ID | TID |
  17434. * |------------------------------------------------------------|
  17435. * Header fields:
  17436. * dword0 - b'7:0 - msg_type: This will be set to
  17437. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  17438. * b'31:16 - peer ID
  17439. * dword1 - b'7:0 - TID
  17440. * b'15:8 - svc class ID
  17441. * (dword2, etc. same format as dword1)
  17442. */
  17443. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  17444. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  17445. A_UINT32 msg_type :8,
  17446. reserved0 :8,
  17447. peer_id :16;
  17448. struct {
  17449. A_UINT32 tid :8,
  17450. svc_class_id :8,
  17451. reserved1 :16;
  17452. } tid_reports[1/*or more*/];
  17453. } POSTPACK;
  17454. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  17455. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  17456. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  17457. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  17458. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  17459. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  17460. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  17461. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  17462. do { \
  17463. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  17464. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  17465. } while (0)
  17466. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  17467. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  17468. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  17469. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  17470. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  17471. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  17472. do { \
  17473. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  17474. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  17475. } while (0)
  17476. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  17477. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  17478. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  17479. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  17480. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  17481. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  17482. do { \
  17483. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  17484. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  17485. } while (0)
  17486. /*
  17487. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  17488. *
  17489. * @details
  17490. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  17491. * flow if the flow is seen the associated service class is conveyed to the
  17492. * target via TCL Data Command. Target on the other hand internally creates the
  17493. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  17494. * of the newly created MSDUQ and some other identifiers to uniquely identity
  17495. * the newly created MSDUQ
  17496. *
  17497. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  17498. * |------------------------------+------------------------+--------------|
  17499. * | peer ID | HTT qtype | msg type |
  17500. * |---------------------------------+--------------+--+---+-------+------|
  17501. * | reserved |AST list index|FO|WC | HLOS | remap|
  17502. * | | | | | TID | TID |
  17503. * |---------------------+------------------------------------------------|
  17504. * | reserved1 | tgt_opaque_id |
  17505. * |---------------------+------------------------------------------------|
  17506. *
  17507. * Header fields:
  17508. *
  17509. * dword0 - b'7:0 - msg_type: This will be set to
  17510. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  17511. * b'15:8 - HTT qtype
  17512. * b'31:16 - peer ID
  17513. *
  17514. * dword1 - b'3:0 - remap TID, as assigned in firmware
  17515. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  17516. * hlos_tid : Common to Lithium and Beryllium
  17517. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  17518. * TCL Data Command : Beryllium
  17519. * b10 - flow_override (FO), as sent by host in
  17520. * TCL Data Command: Beryllium
  17521. * b11:14 - ast_list_idx
  17522. * Array index into the list of extension AST entries
  17523. * (not the actual AST 16-bit index).
  17524. * The ast_list_idx is one-based, with the following
  17525. * range of values:
  17526. * - legacy targets supporting 16 user-defined
  17527. * MSDU queues: 1-2
  17528. * - legacy targets supporting 48 user-defined
  17529. * MSDU queues: 1-6
  17530. * - new targets: 0 (peer_id is used instead)
  17531. * Note that since ast_list_idx is one-based,
  17532. * the host will need to subtract 1 to use it as an
  17533. * index into a list of extension AST entries.
  17534. * b15:31 - reserved
  17535. *
  17536. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  17537. * unique MSDUQ id in firmware
  17538. * b'24:31 - reserved1
  17539. */
  17540. PREPACK struct htt_t2h_sawf_msduq_event {
  17541. A_UINT32 msg_type : 8,
  17542. htt_qtype : 8,
  17543. peer_id :16;
  17544. A_UINT32 remap_tid : 4,
  17545. hlos_tid : 4,
  17546. who_classify_info_sel : 2,
  17547. flow_override : 1,
  17548. ast_list_idx : 4,
  17549. reserved :17;
  17550. A_UINT32 tgt_opaque_id :24,
  17551. reserved1 : 8;
  17552. } POSTPACK;
  17553. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  17554. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  17555. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  17556. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  17557. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  17558. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  17559. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  17560. do { \
  17561. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  17562. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  17563. } while (0)
  17564. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  17565. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  17566. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  17567. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  17568. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  17569. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  17570. do { \
  17571. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  17572. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  17573. } while (0)
  17574. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  17575. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  17576. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  17577. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  17578. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  17579. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  17580. do { \
  17581. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  17582. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  17583. } while (0)
  17584. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  17585. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  17586. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  17587. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  17588. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  17589. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  17590. do { \
  17591. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  17592. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  17593. } while (0)
  17594. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  17595. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  17596. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  17597. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  17598. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  17599. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  17600. do { \
  17601. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  17602. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  17603. } while (0)
  17604. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  17605. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  17606. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  17607. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  17608. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  17609. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  17610. do { \
  17611. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  17612. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  17613. } while (0)
  17614. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  17615. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  17616. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  17617. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  17618. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  17619. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  17620. do { \
  17621. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  17622. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  17623. } while (0)
  17624. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  17625. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  17626. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  17627. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  17628. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  17629. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  17630. do { \
  17631. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  17632. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  17633. } while (0)
  17634. /**
  17635. * @brief target -> PPDU id format indication
  17636. *
  17637. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  17638. *
  17639. * @details
  17640. * The following field definitions describe the format of the HTT target
  17641. * to host PPDU ID format indication message.
  17642. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  17643. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  17644. * seq_idx :- Sequence control index of this PPDU.
  17645. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  17646. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  17647. * tqm_cmd:-
  17648. *
  17649. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  17650. * |--------------------------------------------------+------------------------|
  17651. * | rsvd0 | msg type |
  17652. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17653. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  17654. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17655. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  17656. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17657. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  17658. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17659. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  17660. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17661. * Where: OF = bit offset, NB = number of bits, V = valid
  17662. * The message is interpreted as follows:
  17663. *
  17664. * dword0 - b'7:0 - msg_type: This will be set to
  17665. * HTT_T2H_PPDU_ID_FMT_IND
  17666. * value: 0x30
  17667. *
  17668. * dword0 - b'31:8 - reserved
  17669. *
  17670. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  17671. *
  17672. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  17673. *
  17674. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  17675. *
  17676. * dword1 - b'15:11 - reserved for future use
  17677. *
  17678. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  17679. *
  17680. * dword1 - b'21:17 - number of bits in ring_id
  17681. *
  17682. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  17683. *
  17684. * dword1 - b'31:27 - reserved for future use
  17685. *
  17686. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  17687. *
  17688. * dword2 - b'5:1 - number of bits in sequence index
  17689. *
  17690. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  17691. *
  17692. * dword2 - b'15:11 - reserved for future use
  17693. *
  17694. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  17695. *
  17696. * dword2 - b'21:17 - number of bits in link_id
  17697. *
  17698. * dword2 - b'26:22 - offset of link_id (in number of bits)
  17699. *
  17700. * dword2 - b'31:27 - reserved for future use
  17701. *
  17702. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  17703. *
  17704. * dword3 - b'5:1 - number of bits in seq_cmd_type
  17705. *
  17706. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  17707. *
  17708. * dword3 - b'15:11 - reserved for future use
  17709. *
  17710. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  17711. *
  17712. * dword3 - b'21:17 - number of bits in tqm_cmd
  17713. *
  17714. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  17715. *
  17716. * dword3 - b'31:27 - reserved for future use
  17717. *
  17718. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  17719. *
  17720. * dword4 - b'5:1 - number of bits in mac_id
  17721. *
  17722. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  17723. *
  17724. * dword4 - b'15:11 - reserved for future use
  17725. *
  17726. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  17727. *
  17728. * dword4 - b'21:17 - number of bits in crc
  17729. *
  17730. * dword4 - b'26:22 - offset of crc (in number of bits)
  17731. *
  17732. * dword4 - b'31:27 - reserved for future use
  17733. *
  17734. */
  17735. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  17736. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  17737. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  17738. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  17739. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  17740. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  17741. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  17742. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  17743. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  17744. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  17745. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  17746. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  17747. /* macros for accessing lower 16 bits in dword */
  17748. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  17749. do { \
  17750. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  17751. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  17752. } while (0)
  17753. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  17754. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  17755. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  17756. do { \
  17757. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  17758. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  17759. } while (0)
  17760. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  17761. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  17762. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  17763. do { \
  17764. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  17765. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  17766. } while (0)
  17767. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  17768. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  17769. /* macros for accessing upper 16 bits in dword */
  17770. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  17771. do { \
  17772. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  17773. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  17774. } while (0)
  17775. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  17776. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  17777. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  17778. do { \
  17779. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  17780. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  17781. } while (0)
  17782. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  17783. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  17784. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  17785. do { \
  17786. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  17787. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  17788. } while (0)
  17789. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  17790. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  17791. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  17792. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17793. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  17794. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17795. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  17796. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17797. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  17798. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17799. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  17800. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17801. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  17802. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17803. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  17804. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17805. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  17806. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17807. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  17808. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17809. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  17810. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17811. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  17812. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17813. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  17814. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17815. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  17816. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17817. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  17818. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17819. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  17820. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17821. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  17822. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17823. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  17824. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17825. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  17826. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17827. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  17828. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17829. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  17830. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17831. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  17832. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17833. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  17834. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17835. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  17836. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17837. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  17838. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17839. /* offsets in number dwords */
  17840. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  17841. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  17842. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  17843. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  17844. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  17845. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  17846. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  17847. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  17848. typedef struct {
  17849. A_UINT32 msg_type: 8, /* bits 7:0 */
  17850. rsvd0: 24;/* bits 31:8 */
  17851. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  17852. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  17853. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  17854. rsvd1: 5, /* bits 15:11 */
  17855. ring_id_valid: 1, /* bits 16:16 */
  17856. ring_id_bits: 5, /* bits 21:17 */
  17857. ring_id_offset: 5, /* bits 26:22 */
  17858. rsvd2: 5; /* bits 31:27 */
  17859. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  17860. seq_idx_bits: 5, /* bits 5:1 */
  17861. seq_idx_offset: 5, /* bits 10:6 */
  17862. rsvd3: 5, /* bits 15:11 */
  17863. link_id_valid: 1, /* bits 16:16 */
  17864. link_id_bits: 5, /* bits 21:17 */
  17865. link_id_offset: 5, /* bits 26:22 */
  17866. rsvd4: 5; /* bits 31:27 */
  17867. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  17868. seq_cmd_type_bits: 5, /* bits 5:1 */
  17869. seq_cmd_type_offset: 5, /* bits 10:6 */
  17870. rsvd5: 5, /* bits 15:11 */
  17871. tqm_cmd_valid: 1, /* bits 16:16 */
  17872. tqm_cmd_bits: 5, /* bits 21:17 */
  17873. tqm_cmd_offset: 5, /* bits 26:12 */
  17874. rsvd6: 5; /* bits 31:27 */
  17875. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  17876. mac_id_bits: 5, /* bits 5:1 */
  17877. mac_id_offset: 5, /* bits 10:6 */
  17878. rsvd8: 5, /* bits 15:11 */
  17879. crc_valid: 1, /* bits 16:16 */
  17880. crc_bits: 5, /* bits 21:17 */
  17881. crc_offset: 5, /* bits 26:12 */
  17882. rsvd9: 5; /* bits 31:27 */
  17883. } htt_t2h_ppdu_id_fmt_ind_t;
  17884. /**
  17885. * @brief target -> host RX_CCE_SUPER_RULE setup done message
  17886. *
  17887. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE
  17888. *
  17889. * @details
  17890. * HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE message is sent by the target
  17891. * when RX_CCE_SUPER_RULE setup is done
  17892. *
  17893. * This message shows the configuration results after the setup operation.
  17894. * It will always be sent to host.
  17895. * The message would appear as follows:
  17896. *
  17897. * |31 24|23 16|15 8|7 0|
  17898. * |-----------------+-----------------+----------------+----------------|
  17899. * | result | response_type | vdev_id | msg_type |
  17900. * |---------------------------------------------------------------------|
  17901. *
  17902. * The message is interpreted as follows:
  17903. * dword0 - b'0:7 - msg_type: This will be set to 0x33
  17904. * (HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE)
  17905. * b'8:15 - vdev_id: Identify which vdev RX_CCE_SUPER_RULE is setup on
  17906. * b'16:23 - response_type: Indicate the response type of this setup
  17907. * done msg
  17908. * 0: HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE,
  17909. * response to HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST
  17910. * 1: HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE,
  17911. * response to HTT_RX_CCE_SUPER_RULE_INSTALL
  17912. * 2: HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE,
  17913. * response to HTT_RX_CCE_SUPER_RULE_RELEASE
  17914. * b'24:31 - result: Indicate result of setup operation
  17915. * For HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE:
  17916. * b'24 - is_rule_enough: indicate if there are
  17917. * enough free cce rule slots
  17918. * 0: not enough
  17919. * 1: enough
  17920. * b'25:31 - avail_rule_num: indicate the number of
  17921. * remaining free cce rule slots, only makes sense
  17922. * when is_rule_enough = 0
  17923. * For HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE:
  17924. * b'24 - cfg_result_0: indicate the config result
  17925. * of RX_CCE_SUPER_RULE_0
  17926. * 0: Install/Uninstall fails
  17927. * 1: Install/Uninstall succeeds
  17928. * b'25 - cfg_result_1: indicate the config result
  17929. * of RX_CCE_SUPER_RULE_1
  17930. * 0: Install/Uninstall fails
  17931. * 1: Install/Uninstall succeeds
  17932. * b'26:31 - reserved
  17933. * For HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE:
  17934. * b'24 - cfg_result_0: indicate the config result
  17935. * of RX_CCE_SUPER_RULE_0
  17936. * 0: Release fails
  17937. * 1: Release succeeds
  17938. * b'25 - cfg_result_1: indicate the config result
  17939. * of RX_CCE_SUPER_RULE_1
  17940. * 0: Release fails
  17941. * 1: Release succeeds
  17942. * b'26:31 - reserved
  17943. */
  17944. enum htt_rx_cce_super_rule_setup_done_response_type {
  17945. HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE = 0,
  17946. HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE,
  17947. HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE,
  17948. /*All reply type should be before this*/
  17949. HTT_RX_CCE_SUPER_RULE_SETUP_INVALID_RESPONSE,
  17950. };
  17951. PREPACK struct htt_rx_cce_super_rule_setup_done_t {
  17952. A_UINT8 msg_type;
  17953. A_UINT8 vdev_id;
  17954. A_UINT8 response_type;
  17955. union {
  17956. struct {
  17957. /* For HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE */
  17958. A_UINT8 is_rule_enough: 1,
  17959. avail_rule_num: 7;
  17960. };
  17961. struct {
  17962. /*
  17963. * For HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE and
  17964. * HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE
  17965. */
  17966. A_UINT8 cfg_result_0: 1,
  17967. cfg_result_1: 1,
  17968. rsvd: 6;
  17969. };
  17970. } result;
  17971. } POSTPACK;
  17972. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_SZ (sizeof(struct htt_rx_cce_super_rule_setup_done_t))
  17973. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_M 0x0000ff00
  17974. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_S 8
  17975. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_GET(_var) \
  17976. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_M) >> \
  17977. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_S)
  17978. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_SET(_var, _val) \
  17979. do { \
  17980. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID, _val); \
  17981. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_S)); \
  17982. } while (0)
  17983. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_M 0x00ff0000
  17984. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S 16
  17985. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_GET(_var) \
  17986. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_M) >> \
  17987. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S)
  17988. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_SET(_var, _val) \
  17989. do { \
  17990. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE, _val); \
  17991. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S)); \
  17992. } while (0)
  17993. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_M 0xff000000
  17994. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S 24
  17995. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_GET(_var) \
  17996. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_M) >> \
  17997. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S)
  17998. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_SET(_var, _val) \
  17999. do { \
  18000. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT, _val); \
  18001. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S)); \
  18002. } while (0)
  18003. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_M 0x01000000
  18004. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S 24
  18005. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_GET(_var) \
  18006. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_M) >> \
  18007. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S)
  18008. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_SET(_var, _val) \
  18009. do { \
  18010. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH, _val); \
  18011. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S)); \
  18012. } while (0)
  18013. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_M 0xFE000000
  18014. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S 25
  18015. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_GET(_var) \
  18016. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_M) >> \
  18017. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S)
  18018. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_SET(_var, _val) \
  18019. do { \
  18020. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM, _val); \
  18021. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S)); \
  18022. } while (0)
  18023. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_M 0x01000000
  18024. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S 24
  18025. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_GET(_var) \
  18026. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_M) >> \
  18027. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S)
  18028. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_SET(_var, _val) \
  18029. do { \
  18030. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0, _val); \
  18031. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S)); \
  18032. } while (0)
  18033. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_M 0x02000000
  18034. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S 25
  18035. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_GET(_var) \
  18036. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_M) >> \
  18037. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S)
  18038. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_SET(_var, _val) \
  18039. do { \
  18040. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1, _val); \
  18041. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S)); \
  18042. } while (0)
  18043. /**
  18044. * @brief target -> host CoDel MSDU queue latencies array configuration
  18045. *
  18046. * MSG_TYPE => HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND
  18047. *
  18048. * @details
  18049. * The HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND message is used
  18050. * by the target to inform the host of the location and size of the DDR array of
  18051. * per MSDU queue latency metrics. This array is updated by the host and
  18052. * read by the target. The target uses these metric values to determine
  18053. * which MSDU queues have latencies exceeding their CoDel latency target.
  18054. *
  18055. * |31 16|15 8|7 0|
  18056. * |-------------------------------------------+----------|
  18057. * | number of array elements | reserved | MSG_TYPE |
  18058. * |-------------------------------------------+----------|
  18059. * | array physical address, low bits |
  18060. * |------------------------------------------------------|
  18061. * | array physical address, high bits |
  18062. * |------------------------------------------------------|
  18063. * Header fields:
  18064. * - MSG_TYPE
  18065. * Bits 7:0
  18066. * Purpose: Identifies this as a CoDel MSDU queue latencies
  18067. * array configuration message.
  18068. * Value: (HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND)
  18069. * - NUM_ELEM
  18070. * Bits 31:16
  18071. * Purpose: Inform the host of the length of the MSDU queue latencies array.
  18072. * Value: Specifies the number of elements in the MSDU queue latency
  18073. * metrics array. This value is the same as the maximum number of
  18074. * MSDU queues supported by the target.
  18075. * Since each array element is 16 bits, the size in bytes of the
  18076. * MSDU queue latency metrics array is twice the number of elements.
  18077. * - PADDR_LOW
  18078. * Bits 31:0
  18079. * Purpose: Inform the host of the MSDU queue latencies array's location.
  18080. * Value: Lower 32 bits of the physical address of the MSDU queue latency
  18081. * metrics array.
  18082. * - PADDR_HIGH
  18083. * Bits 31:0
  18084. * Purpose: Inform the host of the MSDU queue latencies array's location.
  18085. * Value: Upper 32 bits of the physical address of the MSDU queue latency
  18086. * metrics array.
  18087. */
  18088. typedef struct {
  18089. A_UINT32 msg_type: 8, /* bits 7:0 */
  18090. reserved: 8, /* bits 15:8 */
  18091. num_elem: 16; /* bits 31:16 */
  18092. A_UINT32 paddr_low;
  18093. A_UINT32 paddr_high;
  18094. } htt_t2h_codel_msduq_latencies_array_cfg_int_t;
  18095. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_SIZE 12 /* bytes */
  18096. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_M 0xffff0000
  18097. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_S 16
  18098. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_GET(_var) \
  18099. (((_var) & HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_M) >> \
  18100. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_S)
  18101. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_SET(_var, _val) \
  18102. do { \
  18103. HTT_CHECK_SET_VAL( \
  18104. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM, _val); \
  18105. ((_var) |= ((_val) << \
  18106. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_S)); \
  18107. } while (0)
  18108. /*
  18109. * This CoDel MSDU queue latencies array whose location and number of
  18110. * elements are specified by this HTT_T2H message consists of 16-bit elements
  18111. * that each specify a statistical summary (min) of a MSDU queue's latency,
  18112. * using microseconds units.
  18113. */
  18114. #define HTT_CODEL_MSDUQ_LATENCIES_ARRAY_ELEM_BYTES 2
  18115. #endif