htt.h 922 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918
  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. */
  239. #define HTT_CURRENT_VERSION_MAJOR 3
  240. #define HTT_CURRENT_VERSION_MINOR 116
  241. #define HTT_NUM_TX_FRAG_DESC 1024
  242. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  243. #define HTT_CHECK_SET_VAL(field, val) \
  244. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  245. /* macros to assist in sign-extending fields from HTT messages */
  246. #define HTT_SIGN_BIT_MASK(field) \
  247. ((field ## _M + (1 << field ## _S)) >> 1)
  248. #define HTT_SIGN_BIT(_val, field) \
  249. (_val & HTT_SIGN_BIT_MASK(field))
  250. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  251. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  252. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  253. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  254. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  255. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  256. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  257. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  258. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  259. /*
  260. * TEMPORARY:
  261. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  262. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  263. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  264. * updated.
  265. */
  266. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  267. /*
  268. * TEMPORARY:
  269. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  270. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  271. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  272. * updated.
  273. */
  274. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  275. /**
  276. * htt_dbg_stats_type -
  277. * bit positions for each stats type within a stats type bitmask
  278. * The bitmask contains 24 bits.
  279. */
  280. enum htt_dbg_stats_type {
  281. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  282. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  283. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  284. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  285. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  286. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  287. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  288. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  289. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  290. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  291. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  292. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  293. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  294. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  295. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  296. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  297. /* bits 16-23 currently reserved */
  298. /* keep this last */
  299. HTT_DBG_NUM_STATS
  300. };
  301. /*=== HTT option selection TLVs ===
  302. * Certain HTT messages have alternatives or options.
  303. * For such cases, the host and target need to agree on which option to use.
  304. * Option specification TLVs can be appended to the VERSION_REQ and
  305. * VERSION_CONF messages to select options other than the default.
  306. * These TLVs are entirely optional - if they are not provided, there is a
  307. * well-defined default for each option. If they are provided, they can be
  308. * provided in any order. Each TLV can be present or absent independent of
  309. * the presence / absence of other TLVs.
  310. *
  311. * The HTT option selection TLVs use the following format:
  312. * |31 16|15 8|7 0|
  313. * |---------------------------------+----------------+----------------|
  314. * | value (payload) | length | tag |
  315. * |-------------------------------------------------------------------|
  316. * The value portion need not be only 2 bytes; it can be extended by any
  317. * integer number of 4-byte units. The total length of the TLV, including
  318. * the tag and length fields, must be a multiple of 4 bytes. The length
  319. * field specifies the total TLV size in 4-byte units. Thus, the typical
  320. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  321. * field, would store 0x1 in its length field, to show that the TLV occupies
  322. * a single 4-byte unit.
  323. */
  324. /*--- TLV header format - applies to all HTT option TLVs ---*/
  325. enum HTT_OPTION_TLV_TAGS {
  326. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  327. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  328. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  329. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  330. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  331. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  332. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  333. };
  334. #define HTT_TCL_METADATA_VER_SZ 4
  335. PREPACK struct htt_option_tlv_header_t {
  336. A_UINT8 tag;
  337. A_UINT8 length;
  338. } POSTPACK;
  339. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  340. #define HTT_OPTION_TLV_TAG_S 0
  341. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  342. #define HTT_OPTION_TLV_LENGTH_S 8
  343. /*
  344. * value0 - 16 bit value field stored in word0
  345. * The TLV's value field may be longer than 2 bytes, in which case
  346. * the remainder of the value is stored in word1, word2, etc.
  347. */
  348. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  349. #define HTT_OPTION_TLV_VALUE0_S 16
  350. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  351. do { \
  352. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  353. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  354. } while (0)
  355. #define HTT_OPTION_TLV_TAG_GET(word) \
  356. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  357. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  358. do { \
  359. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  360. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  361. } while (0)
  362. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  363. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  364. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  365. do { \
  366. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  367. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  368. } while (0)
  369. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  370. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  371. /*--- format of specific HTT option TLVs ---*/
  372. /*
  373. * HTT option TLV for specifying LL bus address size
  374. * Some chips require bus addresses used by the target to access buffers
  375. * within the host's memory to be 32 bits; others require bus addresses
  376. * used by the target to access buffers within the host's memory to be
  377. * 64 bits.
  378. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  379. * a suffix to the VERSION_CONF message to specify which bus address format
  380. * the target requires.
  381. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  382. * default to providing bus addresses to the target in 32-bit format.
  383. */
  384. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  385. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  386. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  387. };
  388. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  389. struct htt_option_tlv_header_t hdr;
  390. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  391. } POSTPACK;
  392. /*
  393. * HTT option TLV for specifying whether HL systems should indicate
  394. * over-the-air tx completion for individual frames, or should instead
  395. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  396. * requests an OTA tx completion for a particular tx frame.
  397. * This option does not apply to LL systems, where the TX_COMPL_IND
  398. * is mandatory.
  399. * This option is primarily intended for HL systems in which the tx frame
  400. * downloads over the host --> target bus are as slow as or slower than
  401. * the transmissions over the WLAN PHY. For cases where the bus is faster
  402. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  403. * and consequently will send one TX_COMPL_IND message that covers several
  404. * tx frames. For cases where the WLAN PHY is faster than the bus,
  405. * the target will end up transmitting very short A-MPDUs, and consequently
  406. * sending many TX_COMPL_IND messages, which each cover a very small number
  407. * of tx frames.
  408. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  409. * a suffix to the VERSION_REQ message to request whether the host desires to
  410. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  411. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  412. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  413. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  414. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  415. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  416. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  417. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  418. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  419. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  420. * TLV.
  421. */
  422. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  423. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  424. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  425. };
  426. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  427. struct htt_option_tlv_header_t hdr;
  428. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  429. } POSTPACK;
  430. /*
  431. * HTT option TLV for specifying how many tx queue groups the target
  432. * may establish.
  433. * This TLV specifies the maximum value the target may send in the
  434. * txq_group_id field of any TXQ_GROUP information elements sent by
  435. * the target to the host. This allows the host to pre-allocate an
  436. * appropriate number of tx queue group structs.
  437. *
  438. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  439. * a suffix to the VERSION_REQ message to specify whether the host supports
  440. * tx queue groups at all, and if so if there is any limit on the number of
  441. * tx queue groups that the host supports.
  442. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  443. * a suffix to the VERSION_CONF message. If the host has specified in the
  444. * VER_REQ message a limit on the number of tx queue groups the host can
  445. * support, the target shall limit its specification of the maximum tx groups
  446. * to be no larger than this host-specified limit.
  447. *
  448. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  449. * shall preallocate 4 tx queue group structs, and the target shall not
  450. * specify a txq_group_id larger than 3.
  451. */
  452. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  453. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  454. /*
  455. * values 1 through N specify the max number of tx queue groups
  456. * the sender supports
  457. */
  458. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  459. };
  460. /* TEMPORARY backwards-compatibility alias for a typo fix -
  461. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  462. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  463. * to support the old name (with the typo) until all references to the
  464. * old name are replaced with the new name.
  465. */
  466. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  467. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  468. struct htt_option_tlv_header_t hdr;
  469. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  470. } POSTPACK;
  471. /*
  472. * HTT option TLV for specifying whether the target supports an extended
  473. * version of the HTT tx descriptor. If the target provides this TLV
  474. * and specifies in the TLV that the target supports an extended version
  475. * of the HTT tx descriptor, the target must check the "extension" bit in
  476. * the HTT tx descriptor, and if the extension bit is set, to expect a
  477. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  478. * descriptor. Furthermore, the target must provide room for the HTT
  479. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  480. * This option is intended for systems where the host needs to explicitly
  481. * control the transmission parameters such as tx power for individual
  482. * tx frames.
  483. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  484. * as a suffix to the VERSION_CONF message to explicitly specify whether
  485. * the target supports the HTT tx MSDU extension descriptor.
  486. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  487. * by the host as lack of target support for the HTT tx MSDU extension
  488. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  489. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  490. * the HTT tx MSDU extension descriptor.
  491. * The host is not required to provide the HTT tx MSDU extension descriptor
  492. * just because the target supports it; the target must check the
  493. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  494. * extension descriptor is present.
  495. */
  496. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  497. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  498. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  499. };
  500. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  501. struct htt_option_tlv_header_t hdr;
  502. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  503. } POSTPACK;
  504. /*
  505. * For the tcl data command V2 and higher support added a new
  506. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  507. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  508. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  509. * HTT option TLV for specifying which version of the TCL metadata struct
  510. * should be used:
  511. * V1 -> use htt_tx_tcl_metadata struct
  512. * V2 -> use htt_tx_tcl_metadata_v2 struct
  513. * Old FW will only support V1.
  514. * New FW will support V2. New FW will still support V1, at least during
  515. * a transition period.
  516. * Similarly, old host will only support V1, and new host will support V1 + V2.
  517. *
  518. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  519. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  520. * of TCL metadata the host supports. If the host doesn't provide a
  521. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  522. * is implicitly understood that the host only supports V1.
  523. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  524. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  525. * the host shall use. The target shall only select one of the versions
  526. * supported by the host. If the target doesn't provide a
  527. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  528. * is implicitly understood that the V1 TCL metadata shall be used.
  529. */
  530. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  531. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  532. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  533. };
  534. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  535. struct htt_option_tlv_header_t hdr;
  536. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  537. } POSTPACK;
  538. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  539. HTT_OPTION_TLV_VALUE0_SET(word, value)
  540. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  541. HTT_OPTION_TLV_VALUE0_GET(word)
  542. typedef struct {
  543. union {
  544. /* BIT [11 : 0] :- tag
  545. * BIT [23 : 12] :- length
  546. * BIT [31 : 24] :- reserved
  547. */
  548. A_UINT32 tag__length;
  549. /*
  550. * The following struct is not endian-portable.
  551. * It is suitable for use within the target, which is known to be
  552. * little-endian.
  553. * The host should use the above endian-portable macros to access
  554. * the tag and length bitfields in an endian-neutral manner.
  555. */
  556. struct {
  557. A_UINT32 tag : 12, /* BIT [11 : 0] */
  558. length : 12, /* BIT [23 : 12] */
  559. reserved : 8; /* BIT [31 : 24] */
  560. };
  561. };
  562. } htt_tlv_hdr_t;
  563. /** HTT stats TLV tag values */
  564. typedef enum {
  565. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  566. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  567. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  568. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  569. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  570. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  571. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  572. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  573. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  574. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  575. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  576. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  577. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  578. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  579. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  580. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  581. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  582. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  583. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  584. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  585. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  586. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  587. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  588. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  589. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  590. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  591. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  592. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  593. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  594. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  595. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  596. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  597. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  598. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  599. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  600. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  601. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  602. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  603. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  604. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  605. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  606. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  607. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  608. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  609. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  610. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  611. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  612. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  613. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  614. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  615. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  616. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  617. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  618. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  619. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  620. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  621. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  622. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  623. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  624. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  625. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  626. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  627. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  628. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  629. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  630. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  631. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  632. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  633. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  634. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  635. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  636. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  637. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  638. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  639. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  640. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  641. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  642. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  643. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  644. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  645. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  646. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  647. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  648. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  649. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  650. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  651. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  652. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  653. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  654. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  655. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  656. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  657. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  658. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  659. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  660. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  661. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  662. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  663. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  664. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  665. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  666. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  667. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  668. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  669. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  670. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  671. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  672. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  673. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  674. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  675. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  676. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  677. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  678. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv - DEPRECATED */
  679. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv - DEPRECATED */
  680. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv - DEPRECATED */
  681. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv - DEPRECATED */
  682. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  683. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  684. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  685. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  686. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  687. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  688. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  689. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  690. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  691. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  692. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  693. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  694. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  695. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  696. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  697. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  698. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  699. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  700. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  701. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  702. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  703. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  704. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  705. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  706. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  707. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  708. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  709. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  710. HTT_STATS_STRM_GEN_MPDUS_TAG = 145, /* htt_stats_strm_gen_mpdus_tlv_t */
  711. HTT_STATS_STRM_GEN_MPDUS_DETAILS_TAG = 146, /* htt_stats_strm_gen_mpdus_details_tlv_t */
  712. HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG = 147, /* htt_txbf_ofdma_ax_ndpa_stats_tlv */
  713. HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG = 148, /* htt_txbf_ofdma_ax_ndp_stats_tlv */
  714. HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG = 149, /* htt_txbf_ofdma_ax_brp_stats_tlv */
  715. HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG = 150, /* htt_txbf_ofdma_ax_steer_stats_tlv */
  716. HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG = 151, /* htt_txbf_ofdma_be_ndpa_stats_tlv */
  717. HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG = 152, /* htt_txbf_ofdma_be_ndp_stats_tlv */
  718. HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG = 153, /* htt_txbf_ofdma_be_brp_stats_tlv */
  719. HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG = 154, /* htt_txbf_ofdma_be_steer_stats_tlv */
  720. HTT_STATS_DMAC_RESET_STATS_TAG = 155, /* htt_dmac_reset_stats_tlv */
  721. HTT_STATS_RX_PDEV_BE_UL_OFDMA_USER_STATS_TAG = 156, /* htt_rx_pdev_be_ul_ofdma_user_stats_tlv */
  722. HTT_STATS_PHY_TPC_STATS_TAG = 157, /* htt_phy_tpc_stats_tlv */
  723. HTT_STATS_PDEV_PUNCTURE_STATS_TAG = 158, /* htt_pdev_puncture_stats_tlv */
  724. HTT_STATS_ML_PEER_DETAILS_TAG = 159, /* htt_ml_peer_details_tlv */
  725. HTT_STATS_ML_PEER_EXT_DETAILS_TAG = 160, /* htt_ml_peer_ext_details_tlv */
  726. HTT_STATS_ML_LINK_INFO_DETAILS_TAG = 161, /* htt_ml_link_info_tlv */
  727. HTT_STATS_TX_PDEV_PPDU_DUR_TAG = 162, /* htt_tx_pdev_ppdu_dur_stats_tlv */
  728. HTT_STATS_RX_PDEV_PPDU_DUR_TAG = 163, /* htt_rx_pdev_ppdu_dur_stats_tlv */
  729. HTT_STATS_ODD_PDEV_MANDATORY_TAG = 164, /* htt_odd_mandatory_pdev_stats_tlv */
  730. HTT_STATS_PDEV_SCHED_ALGO_OFDMA_STATS_TAG = 165, /* htt_pdev_sched_algo_ofdma_stats_tlv */
  731. HTT_DBG_ODD_MANDATORY_MUMIMO_TAG = 166, /* htt_odd_mandatory_mumimo_pdev_stats_tlv */
  732. HTT_DBG_ODD_MANDATORY_MUOFDMA_TAG = 167, /* htt_odd_mandatory_muofdma_pdev_stats_tlv */
  733. HTT_STATS_LATENCY_PROF_CAL_STATS_TAG = 168, /* htt_latency_prof_cal_stats_tlv */
  734. HTT_STATS_TX_PDEV_MUEDCA_PARAMS_STATS_TAG = 169, /* htt_tx_pdev_muedca_params_stats_tlv_v - DEPRECATED */
  735. HTT_STATS_PDEV_BW_MGR_STATS_TAG = 170, /* htt_pdev_bw_mgr_stats_tlv */
  736. HTT_STATS_TX_PDEV_AP_EDCA_PARAMS_STATS_TAG = 171, /* htt_tx_pdev_ap_edca_params_stats_tlv_v */
  737. HTT_STATS_TXBF_OFDMA_AX_STEER_MPDU_STATS_TAG = 172, /* htt_txbf_ofdma_ax_steer_mpdu_stats_tlv */
  738. HTT_STATS_TXBF_OFDMA_BE_STEER_MPDU_STATS_TAG = 173, /* htt_txbf_ofdma_be_steer_mpdu_stats_tlv */
  739. HTT_STATS_PEER_AX_OFDMA_STATS_TAG = 174, /* htt_peer_ax_ofdma_stats_tlv */
  740. HTT_STATS_TX_PDEV_MU_EDCA_PARAMS_STATS_TAG = 175, /* htt_tx_pdev_mu_edca_params_stats_tlv_v */
  741. HTT_STATS_PDEV_MBSSID_CTRL_FRAME_STATS_TAG = 176, /* htt_pdev_mbssid_ctrl_frame_stats_tlv */
  742. HTT_STATS_TX_PDEV_MLO_ABORT_TAG = 177, /* htt_tx_pdev_stats_mlo_abort_tlv_v */
  743. HTT_STATS_TX_PDEV_MLO_TXOP_ABORT_TAG = 178, /* htt_tx_pdev_stats_mlo_txop_abort_tlv_v */
  744. HTT_STATS_MAX_TAG,
  745. } htt_stats_tlv_tag_t;
  746. /* retain deprecated enum name as an alias for the current enum name */
  747. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  748. #define HTT_STATS_TLV_TAG_M 0x00000fff
  749. #define HTT_STATS_TLV_TAG_S 0
  750. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  751. #define HTT_STATS_TLV_LENGTH_S 12
  752. #define HTT_STATS_TLV_TAG_GET(_var) \
  753. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  754. HTT_STATS_TLV_TAG_S)
  755. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  756. do { \
  757. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  758. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  759. } while (0)
  760. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  761. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  762. HTT_STATS_TLV_LENGTH_S)
  763. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  764. do { \
  765. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  766. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  767. } while (0)
  768. /*=== host -> target messages ===============================================*/
  769. enum htt_h2t_msg_type {
  770. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  771. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  772. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  773. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  774. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  775. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  776. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  777. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  778. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  779. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  780. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  781. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  782. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  783. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  784. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  785. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  786. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  787. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  788. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  789. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  790. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  791. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  792. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  793. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  794. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  795. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  796. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  797. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  798. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  799. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  800. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  801. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  802. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  803. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP = 0x21,
  804. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET = 0x22,
  805. HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP = 0x23,
  806. /* keep this last */
  807. HTT_H2T_NUM_MSGS
  808. };
  809. /*
  810. * HTT host to target message type -
  811. * stored in bits 7:0 of the first word of the message
  812. */
  813. #define HTT_H2T_MSG_TYPE_M 0xff
  814. #define HTT_H2T_MSG_TYPE_S 0
  815. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  816. do { \
  817. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  818. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  819. } while (0)
  820. #define HTT_H2T_MSG_TYPE_GET(word) \
  821. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  822. /**
  823. * @brief host -> target version number request message definition
  824. *
  825. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  826. *
  827. *
  828. * |31 24|23 16|15 8|7 0|
  829. * |----------------+----------------+----------------+----------------|
  830. * | reserved | msg type |
  831. * |-------------------------------------------------------------------|
  832. * : option request TLV (optional) |
  833. * :...................................................................:
  834. *
  835. * The VER_REQ message may consist of a single 4-byte word, or may be
  836. * extended with TLVs that specify which HTT options the host is requesting
  837. * from the target.
  838. * The following option TLVs may be appended to the VER_REQ message:
  839. * - HL_SUPPRESS_TX_COMPL_IND
  840. * - HL_MAX_TX_QUEUE_GROUPS
  841. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  842. * may be appended to the VER_REQ message (but only one TLV of each type).
  843. *
  844. * Header fields:
  845. * - MSG_TYPE
  846. * Bits 7:0
  847. * Purpose: identifies this as a version number request message
  848. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  849. */
  850. #define HTT_VER_REQ_BYTES 4
  851. /* TBDXXX: figure out a reasonable number */
  852. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  853. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  854. /**
  855. * @brief HTT tx MSDU descriptor
  856. *
  857. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  858. *
  859. * @details
  860. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  861. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  862. * the target firmware needs for the FW's tx processing, particularly
  863. * for creating the HW msdu descriptor.
  864. * The same HTT tx descriptor is used for HL and LL systems, though
  865. * a few fields within the tx descriptor are used only by LL or
  866. * only by HL.
  867. * The HTT tx descriptor is defined in two manners: by a struct with
  868. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  869. * definitions.
  870. * The target should use the struct def, for simplicitly and clarity,
  871. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  872. * neutral. Specifically, the host shall use the get/set macros built
  873. * around the mask + shift defs.
  874. */
  875. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  876. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  877. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  878. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  879. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  880. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  881. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  882. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  883. #define HTT_TX_VDEV_ID_WORD 0
  884. #define HTT_TX_VDEV_ID_MASK 0x3f
  885. #define HTT_TX_VDEV_ID_SHIFT 16
  886. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  887. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  888. #define HTT_TX_MSDU_LEN_DWORD 1
  889. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  890. /*
  891. * HTT_VAR_PADDR macros
  892. * Allow physical / bus addresses to be either a single 32-bit value,
  893. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  894. */
  895. #define HTT_VAR_PADDR32(var_name) \
  896. A_UINT32 var_name
  897. #define HTT_VAR_PADDR64_LE(var_name) \
  898. struct { \
  899. /* little-endian: lo precedes hi */ \
  900. A_UINT32 lo; \
  901. A_UINT32 hi; \
  902. } var_name
  903. /*
  904. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  905. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  906. * addresses are stored in a XXX-bit field.
  907. * This macro is used to define both htt_tx_msdu_desc32_t and
  908. * htt_tx_msdu_desc64_t structs.
  909. */
  910. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  911. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  912. { \
  913. /* DWORD 0: flags and meta-data */ \
  914. A_UINT32 \
  915. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  916. \
  917. /* pkt_subtype - \
  918. * Detailed specification of the tx frame contents, extending the \
  919. * general specification provided by pkt_type. \
  920. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  921. * pkt_type | pkt_subtype \
  922. * ============================================================== \
  923. * 802.3 | bit 0:3 - Reserved \
  924. * | bit 4: 0x0 - Copy-Engine Classification Results \
  925. * | not appended to the HTT message \
  926. * | 0x1 - Copy-Engine Classification Results \
  927. * | appended to the HTT message in the \
  928. * | format: \
  929. * | [HTT tx desc, frame header, \
  930. * | CE classification results] \
  931. * | The CE classification results begin \
  932. * | at the next 4-byte boundary after \
  933. * | the frame header. \
  934. * ------------+------------------------------------------------- \
  935. * Eth2 | bit 0:3 - Reserved \
  936. * | bit 4: 0x0 - Copy-Engine Classification Results \
  937. * | not appended to the HTT message \
  938. * | 0x1 - Copy-Engine Classification Results \
  939. * | appended to the HTT message. \
  940. * | See the above specification of the \
  941. * | CE classification results location. \
  942. * ------------+------------------------------------------------- \
  943. * native WiFi | bit 0:3 - Reserved \
  944. * | bit 4: 0x0 - Copy-Engine Classification Results \
  945. * | not appended to the HTT message \
  946. * | 0x1 - Copy-Engine Classification Results \
  947. * | appended to the HTT message. \
  948. * | See the above specification of the \
  949. * | CE classification results location. \
  950. * ------------+------------------------------------------------- \
  951. * mgmt | 0x0 - 802.11 MAC header absent \
  952. * | 0x1 - 802.11 MAC header present \
  953. * ------------+------------------------------------------------- \
  954. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  955. * | 0x1 - 802.11 MAC header present \
  956. * | bit 1: 0x0 - allow aggregation \
  957. * | 0x1 - don't allow aggregation \
  958. * | bit 2: 0x0 - perform encryption \
  959. * | 0x1 - don't perform encryption \
  960. * | bit 3: 0x0 - perform tx classification / queuing \
  961. * | 0x1 - don't perform tx classification; \
  962. * | insert the frame into the "misc" \
  963. * | tx queue \
  964. * | bit 4: 0x0 - Copy-Engine Classification Results \
  965. * | not appended to the HTT message \
  966. * | 0x1 - Copy-Engine Classification Results \
  967. * | appended to the HTT message. \
  968. * | See the above specification of the \
  969. * | CE classification results location. \
  970. */ \
  971. pkt_subtype: 5, \
  972. \
  973. /* pkt_type - \
  974. * General specification of the tx frame contents. \
  975. * The htt_pkt_type enum should be used to specify and check the \
  976. * value of this field. \
  977. */ \
  978. pkt_type: 3, \
  979. \
  980. /* vdev_id - \
  981. * ID for the vdev that is sending this tx frame. \
  982. * For certain non-standard packet types, e.g. pkt_type == raw \
  983. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  984. * This field is used primarily for determining where to queue \
  985. * broadcast and multicast frames. \
  986. */ \
  987. vdev_id: 6, \
  988. /* ext_tid - \
  989. * The extended traffic ID. \
  990. * If the TID is unknown, the extended TID is set to \
  991. * HTT_TX_EXT_TID_INVALID. \
  992. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  993. * value of the QoS TID. \
  994. * If the tx frame is non-QoS data, then the extended TID is set to \
  995. * HTT_TX_EXT_TID_NON_QOS. \
  996. * If the tx frame is multicast or broadcast, then the extended TID \
  997. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  998. */ \
  999. ext_tid: 5, \
  1000. \
  1001. /* postponed - \
  1002. * This flag indicates whether the tx frame has been downloaded to \
  1003. * the target before but discarded by the target, and now is being \
  1004. * downloaded again; or if this is a new frame that is being \
  1005. * downloaded for the first time. \
  1006. * This flag allows the target to determine the correct order for \
  1007. * transmitting new vs. old frames. \
  1008. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  1009. * This flag only applies to HL systems, since in LL systems, \
  1010. * the tx flow control is handled entirely within the target. \
  1011. */ \
  1012. postponed: 1, \
  1013. \
  1014. /* extension - \
  1015. * This flag indicates whether a HTT tx MSDU extension descriptor \
  1016. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  1017. * \
  1018. * 0x0 - no extension MSDU descriptor is present \
  1019. * 0x1 - an extension MSDU descriptor immediately follows the \
  1020. * regular MSDU descriptor \
  1021. */ \
  1022. extension: 1, \
  1023. \
  1024. /* cksum_offload - \
  1025. * This flag indicates whether checksum offload is enabled or not \
  1026. * for this frame. Target FW use this flag to turn on HW checksumming \
  1027. * 0x0 - No checksum offload \
  1028. * 0x1 - L3 header checksum only \
  1029. * 0x2 - L4 checksum only \
  1030. * 0x3 - L3 header checksum + L4 checksum \
  1031. */ \
  1032. cksum_offload: 2, \
  1033. \
  1034. /* tx_comp_req - \
  1035. * This flag indicates whether Tx Completion \
  1036. * from fw is required or not. \
  1037. * This flag is only relevant if tx completion is not \
  1038. * universally enabled. \
  1039. * For all LL systems, tx completion is mandatory, \
  1040. * so this flag will be irrelevant. \
  1041. * For HL systems tx completion is optional, but HL systems in which \
  1042. * the bus throughput exceeds the WLAN throughput will \
  1043. * probably want to always use tx completion, and thus \
  1044. * would not check this flag. \
  1045. * This flag is required when tx completions are not used universally, \
  1046. * but are still required for certain tx frames for which \
  1047. * an OTA delivery acknowledgment is needed by the host. \
  1048. * In practice, this would be for HL systems in which the \
  1049. * bus throughput is less than the WLAN throughput. \
  1050. * \
  1051. * 0x0 - Tx Completion Indication from Fw not required \
  1052. * 0x1 - Tx Completion Indication from Fw is required \
  1053. */ \
  1054. tx_compl_req: 1; \
  1055. \
  1056. \
  1057. /* DWORD 1: MSDU length and ID */ \
  1058. A_UINT32 \
  1059. len: 16, /* MSDU length, in bytes */ \
  1060. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1061. * and this id is used to calculate fragmentation \
  1062. * descriptor pointer inside the target based on \
  1063. * the base address, configured inside the target. \
  1064. */ \
  1065. \
  1066. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1067. /* frags_desc_ptr - \
  1068. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1069. * where the tx frame's fragments reside in memory. \
  1070. * This field only applies to LL systems, since in HL systems the \
  1071. * (degenerate single-fragment) fragmentation descriptor is created \
  1072. * within the target. \
  1073. */ \
  1074. _paddr__frags_desc_ptr_; \
  1075. \
  1076. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1077. /* \
  1078. * Peer ID : Target can use this value to know which peer-id packet \
  1079. * destined to. \
  1080. * It's intended to be specified by host in case of NAWDS. \
  1081. */ \
  1082. A_UINT16 peerid; \
  1083. \
  1084. /* \
  1085. * Channel frequency: This identifies the desired channel \
  1086. * frequency (in mhz) for tx frames. This is used by FW to help \
  1087. * determine when it is safe to transmit or drop frames for \
  1088. * off-channel operation. \
  1089. * The default value of zero indicates to FW that the corresponding \
  1090. * VDEV's home channel (if there is one) is the desired channel \
  1091. * frequency. \
  1092. */ \
  1093. A_UINT16 chanfreq; \
  1094. \
  1095. /* Reason reserved is commented is increasing the htt structure size \
  1096. * leads to some weird issues. \
  1097. * A_UINT32 reserved_dword3_bits0_31; \
  1098. */ \
  1099. } POSTPACK
  1100. /* define a htt_tx_msdu_desc32_t type */
  1101. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1102. /* define a htt_tx_msdu_desc64_t type */
  1103. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1104. /*
  1105. * Make htt_tx_msdu_desc_t be an alias for either
  1106. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1107. */
  1108. #if HTT_PADDR64
  1109. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1110. #else
  1111. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1112. #endif
  1113. /* decriptor information for Management frame*/
  1114. /*
  1115. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1116. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1117. */
  1118. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1119. extern A_UINT32 mgmt_hdr_len;
  1120. PREPACK struct htt_mgmt_tx_desc_t {
  1121. A_UINT32 msg_type;
  1122. #if HTT_PADDR64
  1123. A_UINT64 frag_paddr; /* DMAble address of the data */
  1124. #else
  1125. A_UINT32 frag_paddr; /* DMAble address of the data */
  1126. #endif
  1127. A_UINT32 desc_id; /* returned to host during completion
  1128. * to free the meory*/
  1129. A_UINT32 len; /* Fragment length */
  1130. A_UINT32 vdev_id; /* virtual device ID*/
  1131. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1132. } POSTPACK;
  1133. PREPACK struct htt_mgmt_tx_compl_ind {
  1134. A_UINT32 desc_id;
  1135. A_UINT32 status;
  1136. } POSTPACK;
  1137. /*
  1138. * This SDU header size comes from the summation of the following:
  1139. * 1. Max of:
  1140. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1141. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1142. * b. 802.11 header, for raw frames: 36 bytes
  1143. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1144. * QoS header, HT header)
  1145. * c. 802.3 header, for ethernet frames: 14 bytes
  1146. * (destination address, source address, ethertype / length)
  1147. * 2. Max of:
  1148. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1149. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1150. * 3. 802.1Q VLAN header: 4 bytes
  1151. * 4. LLC/SNAP header: 8 bytes
  1152. */
  1153. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1154. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1155. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1156. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1157. A_COMPILE_TIME_ASSERT(
  1158. htt_encap_hdr_size_max_check_nwifi,
  1159. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1160. A_COMPILE_TIME_ASSERT(
  1161. htt_encap_hdr_size_max_check_enet,
  1162. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1163. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1164. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1165. #define HTT_TX_HDR_SIZE_802_1Q 4
  1166. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1167. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1168. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1169. HTT_TX_HDR_SIZE_802_1Q + \
  1170. HTT_TX_HDR_SIZE_LLC_SNAP)
  1171. #define HTT_HL_TX_FRM_HDR_LEN \
  1172. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1173. #define HTT_LL_TX_FRM_HDR_LEN \
  1174. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1175. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1176. /* dword 0 */
  1177. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1178. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1179. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1180. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1181. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1182. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1183. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1184. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1185. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1186. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1187. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1188. #define HTT_TX_DESC_PKT_TYPE_S 13
  1189. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1190. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1191. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1192. #define HTT_TX_DESC_VDEV_ID_S 16
  1193. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1194. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1195. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1196. #define HTT_TX_DESC_EXT_TID_S 22
  1197. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1198. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1199. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1200. #define HTT_TX_DESC_POSTPONED_S 27
  1201. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1202. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1203. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1204. #define HTT_TX_DESC_EXTENSION_S 28
  1205. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1206. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1207. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1208. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1209. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1210. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1211. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1212. #define HTT_TX_DESC_TX_COMP_S 31
  1213. /* dword 1 */
  1214. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1215. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1216. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1217. #define HTT_TX_DESC_FRM_LEN_S 0
  1218. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1219. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1220. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1221. #define HTT_TX_DESC_FRM_ID_S 16
  1222. /* dword 2 */
  1223. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1224. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1225. /* for systems using 64-bit format for bus addresses */
  1226. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1227. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1228. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1229. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1230. /* for systems using 32-bit format for bus addresses */
  1231. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1232. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1233. /* dword 3 */
  1234. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1235. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1236. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1237. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1238. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1239. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1240. #if HTT_PADDR64
  1241. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1242. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1243. #else
  1244. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1245. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1246. #endif
  1247. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1248. #define HTT_TX_DESC_PEER_ID_S 0
  1249. /*
  1250. * TEMPORARY:
  1251. * The original definitions for the PEER_ID fields contained typos
  1252. * (with _DESC_PADDR appended to this PEER_ID field name).
  1253. * Retain deprecated original names for PEER_ID fields until all code that
  1254. * refers to them has been updated.
  1255. */
  1256. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1257. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1258. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1259. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1260. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1261. HTT_TX_DESC_PEER_ID_M
  1262. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1263. HTT_TX_DESC_PEER_ID_S
  1264. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1265. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1266. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1267. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1268. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1269. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1270. #if HTT_PADDR64
  1271. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1272. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1273. #else
  1274. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1275. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1276. #endif
  1277. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1278. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1279. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1280. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1281. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1282. do { \
  1283. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1284. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1285. } while (0)
  1286. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1287. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1288. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1289. do { \
  1290. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1291. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1292. } while (0)
  1293. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1294. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1295. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1296. do { \
  1297. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1298. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1299. } while (0)
  1300. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1301. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1302. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1303. do { \
  1304. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1305. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1306. } while (0)
  1307. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1308. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1309. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1310. do { \
  1311. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1312. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1313. } while (0)
  1314. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1315. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1316. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1317. do { \
  1318. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1319. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1320. } while (0)
  1321. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1322. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1323. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1324. do { \
  1325. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1326. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1327. } while (0)
  1328. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1329. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1330. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1331. do { \
  1332. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1333. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1334. } while (0)
  1335. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1336. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1337. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1338. do { \
  1339. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1340. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1341. } while (0)
  1342. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1343. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1344. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1345. do { \
  1346. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1347. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1348. } while (0)
  1349. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1350. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1351. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1352. do { \
  1353. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1354. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1355. } while (0)
  1356. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1357. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1358. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1359. do { \
  1360. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1361. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1362. } while (0)
  1363. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1364. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1365. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1366. do { \
  1367. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1368. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1369. } while (0)
  1370. /* enums used in the HTT tx MSDU extension descriptor */
  1371. enum {
  1372. htt_tx_guard_interval_regular = 0,
  1373. htt_tx_guard_interval_short = 1,
  1374. };
  1375. enum {
  1376. htt_tx_preamble_type_ofdm = 0,
  1377. htt_tx_preamble_type_cck = 1,
  1378. htt_tx_preamble_type_ht = 2,
  1379. htt_tx_preamble_type_vht = 3,
  1380. };
  1381. enum {
  1382. htt_tx_bandwidth_5MHz = 0,
  1383. htt_tx_bandwidth_10MHz = 1,
  1384. htt_tx_bandwidth_20MHz = 2,
  1385. htt_tx_bandwidth_40MHz = 3,
  1386. htt_tx_bandwidth_80MHz = 4,
  1387. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1388. };
  1389. /**
  1390. * @brief HTT tx MSDU extension descriptor
  1391. * @details
  1392. * If the target supports HTT tx MSDU extension descriptors, the host has
  1393. * the option of appending the following struct following the regular
  1394. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1395. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1396. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1397. * tx specs for each frame.
  1398. */
  1399. PREPACK struct htt_tx_msdu_desc_ext_t {
  1400. /* DWORD 0: flags */
  1401. A_UINT32
  1402. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1403. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1404. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1405. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1406. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1407. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1408. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1409. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1410. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1411. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1412. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1413. /* DWORD 1: tx power, tx rate, tx BW */
  1414. A_UINT32
  1415. /* pwr -
  1416. * Specify what power the tx frame needs to be transmitted at.
  1417. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1418. * The value needs to be appropriately sign-extended when extracting
  1419. * the value from the message and storing it in a variable that is
  1420. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1421. * automatically handles this sign-extension.)
  1422. * If the transmission uses multiple tx chains, this power spec is
  1423. * the total transmit power, assuming incoherent combination of
  1424. * per-chain power to produce the total power.
  1425. */
  1426. pwr: 8,
  1427. /* mcs_mask -
  1428. * Specify the allowable values for MCS index (modulation and coding)
  1429. * to use for transmitting the frame.
  1430. *
  1431. * For HT / VHT preamble types, this mask directly corresponds to
  1432. * the HT or VHT MCS indices that are allowed. For each bit N set
  1433. * within the mask, MCS index N is allowed for transmitting the frame.
  1434. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1435. * rates versus OFDM rates, so the host has the option of specifying
  1436. * that the target must transmit the frame with CCK or OFDM rates
  1437. * (not HT or VHT), but leaving the decision to the target whether
  1438. * to use CCK or OFDM.
  1439. *
  1440. * For CCK and OFDM, the bits within this mask are interpreted as
  1441. * follows:
  1442. * bit 0 -> CCK 1 Mbps rate is allowed
  1443. * bit 1 -> CCK 2 Mbps rate is allowed
  1444. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1445. * bit 3 -> CCK 11 Mbps rate is allowed
  1446. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1447. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1448. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1449. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1450. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1451. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1452. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1453. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1454. *
  1455. * The MCS index specification needs to be compatible with the
  1456. * bandwidth mask specification. For example, a MCS index == 9
  1457. * specification is inconsistent with a preamble type == VHT,
  1458. * Nss == 1, and channel bandwidth == 20 MHz.
  1459. *
  1460. * Furthermore, the host has only a limited ability to specify to
  1461. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1462. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1463. */
  1464. mcs_mask: 12,
  1465. /* nss_mask -
  1466. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1467. * Each bit in this mask corresponds to a Nss value:
  1468. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1469. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1470. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1471. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1472. * The values in the Nss mask must be suitable for the recipient, e.g.
  1473. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1474. * recipient which only supports 2x2 MIMO.
  1475. */
  1476. nss_mask: 4,
  1477. /* guard_interval -
  1478. * Specify a htt_tx_guard_interval enum value to indicate whether
  1479. * the transmission should use a regular guard interval or a
  1480. * short guard interval.
  1481. */
  1482. guard_interval: 1,
  1483. /* preamble_type_mask -
  1484. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1485. * may choose from for transmitting this frame.
  1486. * The bits in this mask correspond to the values in the
  1487. * htt_tx_preamble_type enum. For example, to allow the target
  1488. * to transmit the frame as either CCK or OFDM, this field would
  1489. * be set to
  1490. * (1 << htt_tx_preamble_type_ofdm) |
  1491. * (1 << htt_tx_preamble_type_cck)
  1492. */
  1493. preamble_type_mask: 4,
  1494. reserved1_31_29: 3; /* unused, set to 0x0 */
  1495. /* DWORD 2: tx chain mask, tx retries */
  1496. A_UINT32
  1497. /* chain_mask - specify which chains to transmit from */
  1498. chain_mask: 4,
  1499. /* retry_limit -
  1500. * Specify the maximum number of transmissions, including the
  1501. * initial transmission, to attempt before giving up if no ack
  1502. * is received.
  1503. * If the tx rate is specified, then all retries shall use the
  1504. * same rate as the initial transmission.
  1505. * If no tx rate is specified, the target can choose whether to
  1506. * retain the original rate during the retransmissions, or to
  1507. * fall back to a more robust rate.
  1508. */
  1509. retry_limit: 4,
  1510. /* bandwidth_mask -
  1511. * Specify what channel widths may be used for the transmission.
  1512. * A value of zero indicates "don't care" - the target may choose
  1513. * the transmission bandwidth.
  1514. * The bits within this mask correspond to the htt_tx_bandwidth
  1515. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1516. * The bandwidth_mask must be consistent with the preamble_type_mask
  1517. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1518. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1519. */
  1520. bandwidth_mask: 6,
  1521. reserved2_31_14: 18; /* unused, set to 0x0 */
  1522. /* DWORD 3: tx expiry time (TSF) LSBs */
  1523. A_UINT32 expire_tsf_lo;
  1524. /* DWORD 4: tx expiry time (TSF) MSBs */
  1525. A_UINT32 expire_tsf_hi;
  1526. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1527. } POSTPACK;
  1528. /* DWORD 0 */
  1529. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1530. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1531. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1532. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1533. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1534. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1535. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1536. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1537. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1538. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1539. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1540. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1541. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1542. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1543. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1544. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1545. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1546. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1547. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1548. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1549. /* DWORD 1 */
  1550. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1551. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1552. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1553. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1554. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1555. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1556. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1557. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1558. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1559. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1560. /* DWORD 2 */
  1561. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1562. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1563. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1564. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1565. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1566. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1567. /* DWORD 0 */
  1568. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1569. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1570. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1571. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1572. do { \
  1573. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1574. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1575. } while (0)
  1576. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1577. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1578. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1579. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1580. do { \
  1581. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1582. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1583. } while (0)
  1584. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1585. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1586. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1587. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1588. do { \
  1589. HTT_CHECK_SET_VAL( \
  1590. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1591. ((_var) |= ((_val) \
  1592. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1593. } while (0)
  1594. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1595. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1596. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1597. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1598. do { \
  1599. HTT_CHECK_SET_VAL( \
  1600. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1601. ((_var) |= ((_val) \
  1602. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1603. } while (0)
  1604. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1605. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1606. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1607. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1608. do { \
  1609. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1610. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1611. } while (0)
  1612. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1613. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1614. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1615. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1616. do { \
  1617. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1618. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1619. } while (0)
  1620. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1621. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1622. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1623. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1624. do { \
  1625. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1626. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1627. } while (0)
  1628. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1629. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1630. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1631. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1632. do { \
  1633. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1634. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1635. } while (0)
  1636. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1637. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1638. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1639. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1640. do { \
  1641. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1642. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1643. } while (0)
  1644. /* DWORD 1 */
  1645. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1646. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1647. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1648. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1649. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1650. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1651. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1652. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1653. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1654. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1655. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1656. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1657. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1658. do { \
  1659. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1660. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1661. } while (0)
  1662. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1663. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1664. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1665. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1666. do { \
  1667. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1668. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1669. } while (0)
  1670. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1671. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1672. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1673. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1674. do { \
  1675. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1676. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1677. } while (0)
  1678. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1679. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1680. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1681. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1682. do { \
  1683. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1684. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1685. } while (0)
  1686. /* DWORD 2 */
  1687. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1688. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1689. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1690. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1691. do { \
  1692. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1693. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1694. } while (0)
  1695. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1696. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1697. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1698. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1699. do { \
  1700. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1701. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1702. } while (0)
  1703. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1704. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1705. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1706. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1707. do { \
  1708. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1709. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1710. } while (0)
  1711. typedef enum {
  1712. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1713. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1714. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1715. } htt_11ax_ltf_subtype_t;
  1716. typedef enum {
  1717. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1718. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1719. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1720. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1721. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1722. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1723. } htt_tx_ext2_preamble_type_t;
  1724. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1725. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1726. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1727. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1728. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1729. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1730. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1731. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1732. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1733. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1734. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1735. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1736. /**
  1737. * @brief HTT tx MSDU extension descriptor v2
  1738. * @details
  1739. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1740. * is received as tcl_exit_base->host_meta_info in firmware.
  1741. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1742. * are already part of tcl_exit_base.
  1743. */
  1744. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1745. /* DWORD 0: flags */
  1746. A_UINT32
  1747. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1748. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1749. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1750. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1751. valid_retries : 1, /* if set, tx retries spec is valid */
  1752. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1753. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1754. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1755. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1756. valid_key_flags : 1, /* if set, key flags is valid */
  1757. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1758. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1759. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1760. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1761. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1762. 1 = ENCRYPT,
  1763. 2 ~ 3 - Reserved */
  1764. /* retry_limit -
  1765. * Specify the maximum number of transmissions, including the
  1766. * initial transmission, to attempt before giving up if no ack
  1767. * is received.
  1768. * If the tx rate is specified, then all retries shall use the
  1769. * same rate as the initial transmission.
  1770. * If no tx rate is specified, the target can choose whether to
  1771. * retain the original rate during the retransmissions, or to
  1772. * fall back to a more robust rate.
  1773. */
  1774. retry_limit : 4,
  1775. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1776. * Valid only for 11ax preamble types HE_SU
  1777. * and HE_EXT_SU
  1778. */
  1779. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1780. * Valid only for 11ax preamble types HE_SU
  1781. * and HE_EXT_SU
  1782. */
  1783. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1784. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1785. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1786. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1787. */
  1788. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1789. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1790. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1791. * Use cases:
  1792. * Any time firmware uses TQM-BYPASS for Data
  1793. * TID, firmware expect host to set this bit.
  1794. */
  1795. /* DWORD 1: tx power, tx rate */
  1796. A_UINT32
  1797. power : 8, /* unit of the power field is 0.5 dbm
  1798. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1799. * signed value ranging from -64dbm to 63.5 dbm
  1800. */
  1801. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1802. * Setting more than one MCS isn't currently
  1803. * supported by the target (but is supported
  1804. * in the interface in case in the future
  1805. * the target supports specifications of
  1806. * a limited set of MCS values.
  1807. */
  1808. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1809. * Setting more than one Nss isn't currently
  1810. * supported by the target (but is supported
  1811. * in the interface in case in the future
  1812. * the target supports specifications of
  1813. * a limited set of Nss values.
  1814. */
  1815. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1816. update_peer_cache : 1; /* When set these custom values will be
  1817. * used for all packets, until the next
  1818. * update via this ext header.
  1819. * This is to make sure not all packets
  1820. * need to include this header.
  1821. */
  1822. /* DWORD 2: tx chain mask, tx retries */
  1823. A_UINT32
  1824. /* chain_mask - specify which chains to transmit from */
  1825. chain_mask : 8,
  1826. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1827. * TODO: Update Enum values for key_flags
  1828. */
  1829. /*
  1830. * Channel frequency: This identifies the desired channel
  1831. * frequency (in MHz) for tx frames. This is used by FW to help
  1832. * determine when it is safe to transmit or drop frames for
  1833. * off-channel operation.
  1834. * The default value of zero indicates to FW that the corresponding
  1835. * VDEV's home channel (if there is one) is the desired channel
  1836. * frequency.
  1837. */
  1838. chanfreq : 16;
  1839. /* DWORD 3: tx expiry time (TSF) LSBs */
  1840. A_UINT32 expire_tsf_lo;
  1841. /* DWORD 4: tx expiry time (TSF) MSBs */
  1842. A_UINT32 expire_tsf_hi;
  1843. /* DWORD 5: flags to control routing / processing of the MSDU */
  1844. A_UINT32
  1845. /* learning_frame
  1846. * When this flag is set, this frame will be dropped by FW
  1847. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1848. */
  1849. learning_frame : 1,
  1850. /* send_as_standalone
  1851. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1852. * i.e. with no A-MSDU or A-MPDU aggregation.
  1853. * The scope is extended to other use-cases.
  1854. */
  1855. send_as_standalone : 1,
  1856. /* is_host_opaque_valid
  1857. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1858. * with valid information.
  1859. */
  1860. is_host_opaque_valid : 1,
  1861. traffic_end_indication: 1,
  1862. rsvd0 : 28;
  1863. /* DWORD 6 : Host opaque cookie for special frames */
  1864. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1865. rsvd1 : 16;
  1866. /*
  1867. * This structure can be expanded further up to 40 bytes
  1868. * by adding further DWORDs as needed.
  1869. */
  1870. } POSTPACK;
  1871. /* DWORD 0 */
  1872. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1880. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1881. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1882. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1883. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1884. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1885. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1886. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1887. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1888. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1889. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1890. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1891. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1892. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1893. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1894. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1895. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1896. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1897. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1898. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1899. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1900. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1901. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1902. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1903. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1904. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1905. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1906. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1907. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1908. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1909. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1910. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1911. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1912. /* DWORD 1 */
  1913. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1914. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1915. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1916. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1917. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1918. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1919. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1920. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1921. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1922. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1923. /* DWORD 2 */
  1924. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1925. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1926. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1927. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1928. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1929. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1930. /* DWORD 5 */
  1931. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1932. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1933. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1934. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1935. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1936. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1937. /* DWORD 6 */
  1938. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1939. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1940. /* DWORD 0 */
  1941. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1942. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1943. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1944. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1945. do { \
  1946. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1947. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1948. } while (0)
  1949. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1950. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1951. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1952. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1953. do { \
  1954. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1955. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1956. } while (0)
  1957. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1958. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1959. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1960. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1961. do { \
  1962. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1963. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1964. } while (0)
  1965. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1966. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1967. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1968. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1969. do { \
  1970. HTT_CHECK_SET_VAL( \
  1971. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1972. ((_var) |= ((_val) \
  1973. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1974. } while (0)
  1975. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1976. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1977. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1978. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1979. do { \
  1980. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1981. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1982. } while (0)
  1983. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1984. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1985. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1986. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1987. do { \
  1988. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1989. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1990. } while (0)
  1991. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1992. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1993. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1994. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1995. do { \
  1996. HTT_CHECK_SET_VAL( \
  1997. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1998. ((_var) |= ((_val) \
  1999. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  2000. } while (0)
  2001. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  2002. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  2003. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  2004. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  2005. do { \
  2006. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  2007. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  2008. } while (0)
  2009. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  2010. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  2011. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  2012. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  2013. do { \
  2014. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  2015. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  2016. } while (0)
  2017. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  2018. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  2019. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  2020. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  2021. do { \
  2022. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  2023. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  2024. } while (0)
  2025. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  2026. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  2027. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  2028. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  2029. do { \
  2030. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  2031. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  2032. } while (0)
  2033. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2034. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2035. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2036. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2037. do { \
  2038. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2039. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2040. } while (0)
  2041. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2042. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2043. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2044. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2045. do { \
  2046. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2047. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2048. } while (0)
  2049. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2050. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2051. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2052. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2053. do { \
  2054. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2055. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2056. } while (0)
  2057. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2058. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2059. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2060. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2061. do { \
  2062. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2063. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2064. } while (0)
  2065. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2066. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2067. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2068. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2069. do { \
  2070. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2071. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2072. } while (0)
  2073. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2074. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2075. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2076. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2077. do { \
  2078. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2079. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2080. } while (0)
  2081. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2082. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2083. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2084. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2085. do { \
  2086. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2087. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2088. } while (0)
  2089. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2090. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2091. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2092. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2093. do { \
  2094. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2095. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2096. } while (0)
  2097. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2098. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2099. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2100. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2101. do { \
  2102. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2103. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2104. } while (0)
  2105. /* DWORD 1 */
  2106. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2107. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2108. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2109. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2110. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2111. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2112. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2113. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2114. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2115. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2116. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2117. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2118. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2119. do { \
  2120. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2121. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2122. } while (0)
  2123. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2124. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2125. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2126. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2127. do { \
  2128. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2129. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2130. } while (0)
  2131. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2132. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2133. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2134. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2135. do { \
  2136. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2137. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2138. } while (0)
  2139. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2140. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2141. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2142. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2143. do { \
  2144. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2145. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2146. } while (0)
  2147. /* DWORD 2 */
  2148. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2149. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2150. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2151. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2152. do { \
  2153. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2154. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2155. } while (0)
  2156. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2157. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2158. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2159. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2160. do { \
  2161. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2162. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2163. } while (0)
  2164. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2165. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2166. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2167. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2168. do { \
  2169. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2170. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2171. } while (0)
  2172. /* DWORD 5 */
  2173. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2174. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2175. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2176. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2177. do { \
  2178. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2179. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2180. } while (0)
  2181. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2182. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2183. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2184. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2185. do { \
  2186. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2187. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2188. } while (0)
  2189. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2190. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2191. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2192. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2193. do { \
  2194. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2195. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2196. } while (0)
  2197. /* DWORD 6 */
  2198. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2199. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2200. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2201. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2202. do { \
  2203. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2204. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2205. } while (0)
  2206. typedef enum {
  2207. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2208. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2209. } htt_tcl_metadata_type;
  2210. /**
  2211. * @brief HTT TCL command number format
  2212. * @details
  2213. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2214. * available to firmware as tcl_exit_base->tcl_status_number.
  2215. * For regular / multicast packets host will send vdev and mac id and for
  2216. * NAWDS packets, host will send peer id.
  2217. * A_UINT32 is used to avoid endianness conversion problems.
  2218. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2219. */
  2220. typedef struct {
  2221. A_UINT32
  2222. type: 1, /* vdev_id based or peer_id based */
  2223. rsvd: 31;
  2224. } htt_tx_tcl_vdev_or_peer_t;
  2225. typedef struct {
  2226. A_UINT32
  2227. type: 1, /* vdev_id based or peer_id based */
  2228. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2229. vdev_id: 8,
  2230. pdev_id: 2,
  2231. host_inspected:1,
  2232. rsvd: 19;
  2233. } htt_tx_tcl_vdev_metadata;
  2234. typedef struct {
  2235. A_UINT32
  2236. type: 1, /* vdev_id based or peer_id based */
  2237. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2238. peer_id: 14,
  2239. rsvd: 16;
  2240. } htt_tx_tcl_peer_metadata;
  2241. PREPACK struct htt_tx_tcl_metadata {
  2242. union {
  2243. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2244. htt_tx_tcl_vdev_metadata vdev_meta;
  2245. htt_tx_tcl_peer_metadata peer_meta;
  2246. };
  2247. } POSTPACK;
  2248. /* DWORD 0 */
  2249. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2250. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2251. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2252. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2253. /* VDEV metadata */
  2254. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2255. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2256. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2257. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2258. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2259. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2260. /* PEER metadata */
  2261. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2262. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2263. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2264. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2265. HTT_TX_TCL_METADATA_TYPE_S)
  2266. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2267. do { \
  2268. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2269. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2270. } while (0)
  2271. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2272. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2273. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2274. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2275. do { \
  2276. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2277. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2278. } while (0)
  2279. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2280. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2281. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2282. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2283. do { \
  2284. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2285. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2286. } while (0)
  2287. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2288. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2289. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2290. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2291. do { \
  2292. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2293. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2294. } while (0)
  2295. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2296. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2297. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2298. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2299. do { \
  2300. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2301. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2302. } while (0)
  2303. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2304. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2305. HTT_TX_TCL_METADATA_PEER_ID_S)
  2306. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2307. do { \
  2308. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2309. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2310. } while (0)
  2311. /*------------------------------------------------------------------
  2312. * V2 Version of TCL Data Command
  2313. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2314. * MLO global_seq all flavours of TCL Data Cmd.
  2315. *-----------------------------------------------------------------*/
  2316. typedef enum {
  2317. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2318. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2319. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2320. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2321. } htt_tcl_metadata_type_v2;
  2322. /**
  2323. * @brief HTT TCL command number format
  2324. * @details
  2325. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2326. * available to firmware as tcl_exit_base->tcl_status_number.
  2327. * A_UINT32 is used to avoid endianness conversion problems.
  2328. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2329. */
  2330. typedef struct {
  2331. A_UINT32
  2332. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2333. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2334. vdev_id: 8,
  2335. pdev_id: 2,
  2336. host_inspected:1,
  2337. rsvd: 2,
  2338. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2339. } htt_tx_tcl_vdev_metadata_v2;
  2340. typedef struct {
  2341. A_UINT32
  2342. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2343. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2344. peer_id: 13,
  2345. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2346. } htt_tx_tcl_peer_metadata_v2;
  2347. typedef struct {
  2348. A_UINT32
  2349. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2350. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2351. svc_class_id: 8,
  2352. rsvd: 5,
  2353. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2354. } htt_tx_tcl_svc_class_id_metadata;
  2355. typedef struct {
  2356. A_UINT32
  2357. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2358. host_inspected: 1,
  2359. global_seq_no: 12,
  2360. rsvd: 1,
  2361. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2362. } htt_tx_tcl_global_seq_metadata;
  2363. PREPACK struct htt_tx_tcl_metadata_v2 {
  2364. union {
  2365. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2366. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2367. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2368. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2369. };
  2370. } POSTPACK;
  2371. /* DWORD 0 */
  2372. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2373. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2374. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2375. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2376. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2377. /* VDEV V2 metadata */
  2378. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2379. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2380. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2381. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2382. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2383. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2384. /* PEER V2 metadata */
  2385. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2386. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2387. /* SVC_CLASS_ID metadata */
  2388. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2389. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2390. /* Global Seq no metadata */
  2391. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2392. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2393. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2394. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2395. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2396. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2397. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2398. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2399. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2400. do { \
  2401. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2402. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2403. } while (0)
  2404. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2405. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2406. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2407. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2408. do { \
  2409. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2410. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2411. } while (0)
  2412. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2413. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2414. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2415. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2416. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2417. do { \
  2418. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2419. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2420. } while (0)
  2421. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2422. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2423. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2424. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2425. do { \
  2426. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2427. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2428. } while (0)
  2429. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2430. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2431. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2432. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2433. do { \
  2434. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2435. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2436. } while (0)
  2437. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2438. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2439. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2440. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2441. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2442. do { \
  2443. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2444. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2445. } while (0)
  2446. /*----- Get and Set V2 type field in Service Class fields ----*/
  2447. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2448. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2449. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2450. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2451. do { \
  2452. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2453. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2454. } while (0)
  2455. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2456. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2457. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2458. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2459. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2460. do { \
  2461. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2462. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2463. } while (0)
  2464. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2465. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2466. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2467. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2468. do { \
  2469. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2470. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2471. } while (0)
  2472. /*------------------------------------------------------------------
  2473. * End V2 Version of TCL Data Command
  2474. *-----------------------------------------------------------------*/
  2475. typedef enum {
  2476. HTT_TX_FW2WBM_TX_STATUS_OK,
  2477. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2478. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2479. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2480. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2481. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2482. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2483. HTT_TX_FW2WBM_TX_STATUS_MAX
  2484. } htt_tx_fw2wbm_tx_status_t;
  2485. typedef enum {
  2486. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2487. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2488. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2489. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2490. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2491. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2492. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2493. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2494. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2495. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2496. } htt_tx_fw2wbm_reinject_reason_t;
  2497. /**
  2498. * @brief HTT TX WBM Completion from firmware to host
  2499. * @details
  2500. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2501. * DWORD 3 and 4 for software based completions (Exception frames and
  2502. * TQM bypass frames)
  2503. * For software based completions, wbm_release_ring->release_source_module will
  2504. * be set to release_source_fw
  2505. */
  2506. PREPACK struct htt_tx_wbm_completion {
  2507. A_UINT32
  2508. sch_cmd_id: 24,
  2509. exception_frame: 1, /* If set, this packet was queued via exception path */
  2510. rsvd0_31_25: 7;
  2511. A_UINT32
  2512. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2513. * reception of an ACK or BA, this field indicates
  2514. * the RSSI of the received ACK or BA frame.
  2515. * When the frame is removed as result of a direct
  2516. * remove command from the SW, this field is set
  2517. * to 0x0 (which is never a valid value when real
  2518. * RSSI is available).
  2519. * Units: dB w.r.t noise floor
  2520. */
  2521. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2522. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2523. rsvd1_31_16: 16;
  2524. } POSTPACK;
  2525. /* DWORD 0 */
  2526. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2527. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2528. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2529. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2530. /* DWORD 1 */
  2531. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2532. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2533. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2534. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2535. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2536. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2537. /* DWORD 0 */
  2538. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2539. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2540. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2541. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2542. do { \
  2543. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2544. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2545. } while (0)
  2546. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2547. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2548. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2549. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2550. do { \
  2551. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2552. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2553. } while (0)
  2554. /* DWORD 1 */
  2555. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2556. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2557. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2558. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2559. do { \
  2560. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2561. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2562. } while (0)
  2563. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2564. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2565. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2566. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2567. do { \
  2568. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2569. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2570. } while (0)
  2571. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2572. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2573. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2574. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2575. do { \
  2576. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2577. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2578. } while (0)
  2579. /**
  2580. * @brief HTT TX WBM Completion from firmware to host
  2581. * @details
  2582. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2583. * (WBM) offload HW.
  2584. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2585. * For software based completions, release_source_module will
  2586. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2587. * struct wbm_release_ring and then switch to this after looking at
  2588. * release_source_module.
  2589. */
  2590. PREPACK struct htt_tx_wbm_completion_v2 {
  2591. A_UINT32
  2592. used_by_hw0; /* Refer to struct wbm_release_ring */
  2593. A_UINT32
  2594. used_by_hw1; /* Refer to struct wbm_release_ring */
  2595. A_UINT32
  2596. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2597. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2598. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2599. exception_frame: 1,
  2600. rsvd0: 12, /* For future use */
  2601. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2602. rsvd1: 1; /* For future use */
  2603. A_UINT32
  2604. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2605. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2606. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2607. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2608. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2609. */
  2610. A_UINT32
  2611. data1: 32;
  2612. A_UINT32
  2613. data2: 32;
  2614. A_UINT32
  2615. used_by_hw3; /* Refer to struct wbm_release_ring */
  2616. } POSTPACK;
  2617. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2618. /* DWORD 3 */
  2619. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2620. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2621. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2622. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2623. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2624. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2625. /* DWORD 3 */
  2626. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2627. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2628. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2629. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2630. do { \
  2631. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2632. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2633. } while (0)
  2634. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2635. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2636. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2637. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2638. do { \
  2639. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2640. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2641. } while (0)
  2642. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2643. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2644. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2645. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2646. do { \
  2647. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2648. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2649. } while (0)
  2650. /**
  2651. * @brief HTT TX WBM Completion from firmware to host (V3)
  2652. * @details
  2653. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2654. * (WBM) offload HW.
  2655. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2656. * For software based completions, release_source_module will
  2657. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2658. * struct wbm_release_ring and then switch to this after looking at
  2659. * release_source_module.
  2660. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2661. * by new generations of targets.
  2662. */
  2663. PREPACK struct htt_tx_wbm_completion_v3 {
  2664. A_UINT32
  2665. used_by_hw0; /* Refer to struct wbm_release_ring */
  2666. A_UINT32
  2667. used_by_hw1; /* Refer to struct wbm_release_ring */
  2668. A_UINT32
  2669. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2670. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2671. used_by_hw3: 15;
  2672. A_UINT32
  2673. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2674. exception_frame: 1,
  2675. rsvd0: 27; /* For future use */
  2676. A_UINT32
  2677. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2678. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2679. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2680. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2681. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2682. */
  2683. A_UINT32
  2684. data1: 32;
  2685. A_UINT32
  2686. data2: 32;
  2687. A_UINT32
  2688. rsvd1: 20,
  2689. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2690. } POSTPACK;
  2691. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2692. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2693. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2694. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2695. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2696. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2697. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2698. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2699. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2700. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2701. do { \
  2702. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2703. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2704. } while (0)
  2705. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2706. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2707. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2708. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2709. do { \
  2710. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2711. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2712. } while (0)
  2713. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2714. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2715. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2716. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2717. do { \
  2718. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2719. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2720. } while (0)
  2721. typedef enum {
  2722. TX_FRAME_TYPE_UNDEFINED = 0,
  2723. TX_FRAME_TYPE_EAPOL = 1,
  2724. } htt_tx_wbm_status_frame_type;
  2725. /**
  2726. * @brief HTT TX WBM transmit status from firmware to host
  2727. * @details
  2728. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2729. * (WBM) offload HW.
  2730. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2731. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2732. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2733. */
  2734. PREPACK struct htt_tx_wbm_transmit_status {
  2735. A_UINT32
  2736. sch_cmd_id: 24,
  2737. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2738. * reception of an ACK or BA, this field indicates
  2739. * the RSSI of the received ACK or BA frame.
  2740. * When the frame is removed as result of a direct
  2741. * remove command from the SW, this field is set
  2742. * to 0x0 (which is never a valid value when real
  2743. * RSSI is available).
  2744. * Units: dB w.r.t noise floor
  2745. */
  2746. A_UINT32
  2747. sw_peer_id: 16,
  2748. tid_num: 5,
  2749. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2750. * and tid_num fields contain valid data.
  2751. * If this "valid" flag is not set, the
  2752. * sw_peer_id and tid_num fields must be ignored.
  2753. */
  2754. mcast: 1,
  2755. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2756. * contains valid data.
  2757. */
  2758. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2759. reserved: 4;
  2760. A_UINT32
  2761. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2762. * packets in the wbm completion path
  2763. */
  2764. } POSTPACK;
  2765. /* DWORD 4 */
  2766. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2767. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2768. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2769. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2770. /* DWORD 5 */
  2771. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2772. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2773. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2774. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2775. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2776. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2777. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2778. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2779. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2780. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2781. /* DWORD 4 */
  2782. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2783. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2784. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2785. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2786. do { \
  2787. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2788. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2789. } while (0)
  2790. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2791. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2792. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2793. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2794. do { \
  2795. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2796. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2797. } while (0)
  2798. /* DWORD 5 */
  2799. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2800. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2801. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2802. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2803. do { \
  2804. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2805. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2806. } while (0)
  2807. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2808. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2809. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2810. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2811. do { \
  2812. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2813. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2814. } while (0)
  2815. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2816. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2817. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2818. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2819. do { \
  2820. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2821. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2822. } while (0)
  2823. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2824. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2825. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2826. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2827. do { \
  2828. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2829. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2830. } while (0)
  2831. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2832. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2833. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2834. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2835. do { \
  2836. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2837. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2838. } while (0)
  2839. /**
  2840. * @brief HTT TX WBM reinject status from firmware to host
  2841. * @details
  2842. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2843. * (WBM) offload HW.
  2844. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2845. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2846. */
  2847. PREPACK struct htt_tx_wbm_reinject_status {
  2848. A_UINT32
  2849. reserved0: 32;
  2850. A_UINT32
  2851. reserved1: 32;
  2852. A_UINT32
  2853. reserved2: 32;
  2854. } POSTPACK;
  2855. /**
  2856. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2857. * @details
  2858. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2859. * (WBM) offload HW.
  2860. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2861. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2862. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2863. * STA side.
  2864. */
  2865. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2866. A_UINT32
  2867. mec_sa_addr_31_0;
  2868. A_UINT32
  2869. mec_sa_addr_47_32: 16,
  2870. sa_ast_index: 16;
  2871. A_UINT32
  2872. vdev_id: 8,
  2873. reserved0: 24;
  2874. } POSTPACK;
  2875. /* DWORD 4 - mec_sa_addr_31_0 */
  2876. /* DWORD 5 */
  2877. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2878. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2879. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2880. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2881. /* DWORD 6 */
  2882. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2883. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2884. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2885. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2886. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2887. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2888. do { \
  2889. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2890. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2891. } while (0)
  2892. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2893. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2894. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2895. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2896. do { \
  2897. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2898. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2899. } while (0)
  2900. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2901. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2902. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2903. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2904. do { \
  2905. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2906. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2907. } while (0)
  2908. typedef enum {
  2909. TX_FLOW_PRIORITY_BE,
  2910. TX_FLOW_PRIORITY_HIGH,
  2911. TX_FLOW_PRIORITY_LOW,
  2912. } htt_tx_flow_priority_t;
  2913. typedef enum {
  2914. TX_FLOW_LATENCY_SENSITIVE,
  2915. TX_FLOW_LATENCY_INSENSITIVE,
  2916. } htt_tx_flow_latency_t;
  2917. typedef enum {
  2918. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2919. TX_FLOW_INTERACTIVE_TRAFFIC,
  2920. TX_FLOW_PERIODIC_TRAFFIC,
  2921. TX_FLOW_BURSTY_TRAFFIC,
  2922. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2923. } htt_tx_flow_traffic_pattern_t;
  2924. /**
  2925. * @brief HTT TX Flow search metadata format
  2926. * @details
  2927. * Host will set this metadata in flow table's flow search entry along with
  2928. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2929. * firmware and TQM ring if the flow search entry wins.
  2930. * This metadata is available to firmware in that first MSDU's
  2931. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2932. * to one of the available flows for specific tid and returns the tqm flow
  2933. * pointer as part of htt_tx_map_flow_info message.
  2934. */
  2935. PREPACK struct htt_tx_flow_metadata {
  2936. A_UINT32
  2937. rsvd0_1_0: 2,
  2938. tid: 4,
  2939. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2940. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2941. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2942. * Else choose final tid based on latency, priority.
  2943. */
  2944. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2945. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2946. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2947. } POSTPACK;
  2948. /* DWORD 0 */
  2949. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2950. #define HTT_TX_FLOW_METADATA_TID_S 2
  2951. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2952. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2953. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2954. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2955. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2956. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2957. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2958. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2959. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2960. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2961. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2962. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2963. /* DWORD 0 */
  2964. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2965. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2966. HTT_TX_FLOW_METADATA_TID_S)
  2967. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2968. do { \
  2969. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2970. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2971. } while (0)
  2972. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2973. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2974. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2975. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2976. do { \
  2977. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2978. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2979. } while (0)
  2980. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2981. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2982. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2983. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2984. do { \
  2985. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2986. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2987. } while (0)
  2988. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2989. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2990. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2991. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2992. do { \
  2993. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2994. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2995. } while (0)
  2996. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2997. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2998. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2999. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  3000. do { \
  3001. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  3002. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  3003. } while (0)
  3004. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  3005. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  3006. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  3007. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  3008. do { \
  3009. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  3010. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  3011. } while (0)
  3012. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  3013. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  3014. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  3015. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  3016. do { \
  3017. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  3018. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  3019. } while (0)
  3020. /**
  3021. * @brief host -> target ADD WDS Entry
  3022. *
  3023. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  3024. *
  3025. * @brief host -> target DELETE WDS Entry
  3026. *
  3027. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  3028. *
  3029. * @details
  3030. * HTT wds entry from source port learning
  3031. * Host will learn wds entries from rx and send this message to firmware
  3032. * to enable firmware to configure/delete AST entries for wds clients.
  3033. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3034. * and when SA's entry is deleted, firmware removes this AST entry
  3035. *
  3036. * The message would appear as follows:
  3037. *
  3038. * |31 30|29 |17 16|15 8|7 0|
  3039. * |----------------+----------------+----------------+----------------|
  3040. * | rsvd0 |PDVID| vdev_id | msg_type |
  3041. * |-------------------------------------------------------------------|
  3042. * | sa_addr_31_0 |
  3043. * |-------------------------------------------------------------------|
  3044. * | | ta_peer_id | sa_addr_47_32 |
  3045. * |-------------------------------------------------------------------|
  3046. * Where PDVID = pdev_id
  3047. *
  3048. * The message is interpreted as follows:
  3049. *
  3050. * dword0 - b'0:7 - msg_type: This will be set to
  3051. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3052. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3053. *
  3054. * dword0 - b'8:15 - vdev_id
  3055. *
  3056. * dword0 - b'16:17 - pdev_id
  3057. *
  3058. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3059. *
  3060. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3061. *
  3062. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3063. *
  3064. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3065. */
  3066. PREPACK struct htt_wds_entry {
  3067. A_UINT32
  3068. msg_type: 8,
  3069. vdev_id: 8,
  3070. pdev_id: 2,
  3071. rsvd0: 14;
  3072. A_UINT32 sa_addr_31_0;
  3073. A_UINT32
  3074. sa_addr_47_32: 16,
  3075. ta_peer_id: 14,
  3076. rsvd2: 2;
  3077. } POSTPACK;
  3078. /* DWORD 0 */
  3079. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3080. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3081. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3082. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3083. /* DWORD 2 */
  3084. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3085. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3086. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3087. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3088. /* DWORD 0 */
  3089. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3090. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3091. HTT_WDS_ENTRY_VDEV_ID_S)
  3092. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3093. do { \
  3094. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3095. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3096. } while (0)
  3097. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3098. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3099. HTT_WDS_ENTRY_PDEV_ID_S)
  3100. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3101. do { \
  3102. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3103. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3104. } while (0)
  3105. /* DWORD 2 */
  3106. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3107. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3108. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3109. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3110. do { \
  3111. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3112. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3113. } while (0)
  3114. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3115. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3116. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3117. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3118. do { \
  3119. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3120. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3121. } while (0)
  3122. /**
  3123. * @brief MAC DMA rx ring setup specification
  3124. *
  3125. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3126. *
  3127. * @details
  3128. * To allow for dynamic rx ring reconfiguration and to avoid race
  3129. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3130. * it uses. Instead, it sends this message to the target, indicating how
  3131. * the rx ring used by the host should be set up and maintained.
  3132. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3133. * specifications.
  3134. *
  3135. * |31 16|15 8|7 0|
  3136. * |---------------------------------------------------------------|
  3137. * header: | reserved | num rings | msg type |
  3138. * |---------------------------------------------------------------|
  3139. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3140. #if HTT_PADDR64
  3141. * | FW_IDX shadow register physical address (bits 63:32) |
  3142. #endif
  3143. * |---------------------------------------------------------------|
  3144. * | rx ring base physical address (bits 31:0) |
  3145. #if HTT_PADDR64
  3146. * | rx ring base physical address (bits 63:32) |
  3147. #endif
  3148. * |---------------------------------------------------------------|
  3149. * | rx ring buffer size | rx ring length |
  3150. * |---------------------------------------------------------------|
  3151. * | FW_IDX initial value | enabled flags |
  3152. * |---------------------------------------------------------------|
  3153. * | MSDU payload offset | 802.11 header offset |
  3154. * |---------------------------------------------------------------|
  3155. * | PPDU end offset | PPDU start offset |
  3156. * |---------------------------------------------------------------|
  3157. * | MPDU end offset | MPDU start offset |
  3158. * |---------------------------------------------------------------|
  3159. * | MSDU end offset | MSDU start offset |
  3160. * |---------------------------------------------------------------|
  3161. * | frag info offset | rx attention offset |
  3162. * |---------------------------------------------------------------|
  3163. * payload 2, if present, has the same format as payload 1
  3164. * Header fields:
  3165. * - MSG_TYPE
  3166. * Bits 7:0
  3167. * Purpose: identifies this as an rx ring configuration message
  3168. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3169. * - NUM_RINGS
  3170. * Bits 15:8
  3171. * Purpose: indicates whether the host is setting up one rx ring or two
  3172. * Value: 1 or 2
  3173. * Payload:
  3174. * for systems using 64-bit format for bus addresses:
  3175. * - IDX_SHADOW_REG_PADDR_LO
  3176. * Bits 31:0
  3177. * Value: lower 4 bytes of physical address of the host's
  3178. * FW_IDX shadow register
  3179. * - IDX_SHADOW_REG_PADDR_HI
  3180. * Bits 31:0
  3181. * Value: upper 4 bytes of physical address of the host's
  3182. * FW_IDX shadow register
  3183. * - RING_BASE_PADDR_LO
  3184. * Bits 31:0
  3185. * Value: lower 4 bytes of physical address of the host's rx ring
  3186. * - RING_BASE_PADDR_HI
  3187. * Bits 31:0
  3188. * Value: uppper 4 bytes of physical address of the host's rx ring
  3189. * for systems using 32-bit format for bus addresses:
  3190. * - IDX_SHADOW_REG_PADDR
  3191. * Bits 31:0
  3192. * Value: physical address of the host's FW_IDX shadow register
  3193. * - RING_BASE_PADDR
  3194. * Bits 31:0
  3195. * Value: physical address of the host's rx ring
  3196. * - RING_LEN
  3197. * Bits 15:0
  3198. * Value: number of elements in the rx ring
  3199. * - RING_BUF_SZ
  3200. * Bits 31:16
  3201. * Value: size of the buffers referenced by the rx ring, in byte units
  3202. * - ENABLED_FLAGS
  3203. * Bits 15:0
  3204. * Value: 1-bit flags to show whether different rx fields are enabled
  3205. * bit 0: 802.11 header enabled (1) or disabled (0)
  3206. * bit 1: MSDU payload enabled (1) or disabled (0)
  3207. * bit 2: PPDU start enabled (1) or disabled (0)
  3208. * bit 3: PPDU end enabled (1) or disabled (0)
  3209. * bit 4: MPDU start enabled (1) or disabled (0)
  3210. * bit 5: MPDU end enabled (1) or disabled (0)
  3211. * bit 6: MSDU start enabled (1) or disabled (0)
  3212. * bit 7: MSDU end enabled (1) or disabled (0)
  3213. * bit 8: rx attention enabled (1) or disabled (0)
  3214. * bit 9: frag info enabled (1) or disabled (0)
  3215. * bit 10: unicast rx enabled (1) or disabled (0)
  3216. * bit 11: multicast rx enabled (1) or disabled (0)
  3217. * bit 12: ctrl rx enabled (1) or disabled (0)
  3218. * bit 13: mgmt rx enabled (1) or disabled (0)
  3219. * bit 14: null rx enabled (1) or disabled (0)
  3220. * bit 15: phy data rx enabled (1) or disabled (0)
  3221. * - IDX_INIT_VAL
  3222. * Bits 31:16
  3223. * Purpose: Specify the initial value for the FW_IDX.
  3224. * Value: the number of buffers initially present in the host's rx ring
  3225. * - OFFSET_802_11_HDR
  3226. * Bits 15:0
  3227. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3228. * - OFFSET_MSDU_PAYLOAD
  3229. * Bits 31:16
  3230. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3231. * - OFFSET_PPDU_START
  3232. * Bits 15:0
  3233. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3234. * - OFFSET_PPDU_END
  3235. * Bits 31:16
  3236. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3237. * - OFFSET_MPDU_START
  3238. * Bits 15:0
  3239. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3240. * - OFFSET_MPDU_END
  3241. * Bits 31:16
  3242. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3243. * - OFFSET_MSDU_START
  3244. * Bits 15:0
  3245. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3246. * - OFFSET_MSDU_END
  3247. * Bits 31:16
  3248. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3249. * - OFFSET_RX_ATTN
  3250. * Bits 15:0
  3251. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3252. * - OFFSET_FRAG_INFO
  3253. * Bits 31:16
  3254. * Value: offset in QUAD-bytes of frag info table
  3255. */
  3256. /* header fields */
  3257. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3258. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3259. /* payload fields */
  3260. /* for systems using a 64-bit format for bus addresses */
  3261. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3262. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3263. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3264. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3265. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3266. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3267. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3268. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3269. /* for systems using a 32-bit format for bus addresses */
  3270. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3271. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3272. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3273. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3274. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3275. #define HTT_RX_RING_CFG_LEN_S 0
  3276. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3277. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3278. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3279. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3280. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3281. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3282. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3283. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3284. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3285. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3286. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3287. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3288. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3289. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3290. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3291. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3292. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3293. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3294. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3295. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3296. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3297. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3298. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3299. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3300. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3301. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3302. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3303. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3304. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3305. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3306. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3307. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3308. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3309. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3310. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3311. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3312. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3313. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3314. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3315. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3316. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3317. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3318. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3319. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3320. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3321. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3322. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3323. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3324. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3325. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3326. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3327. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3328. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3329. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3330. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3331. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3332. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3333. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3334. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3335. #if HTT_PADDR64
  3336. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3337. #else
  3338. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3339. #endif
  3340. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3341. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3342. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3343. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3344. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3345. do { \
  3346. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3347. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3348. } while (0)
  3349. /* degenerate case for 32-bit fields */
  3350. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3351. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3352. ((_var) = (_val))
  3353. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3354. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3355. ((_var) = (_val))
  3356. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3357. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3358. ((_var) = (_val))
  3359. /* degenerate case for 32-bit fields */
  3360. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3361. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3362. ((_var) = (_val))
  3363. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3364. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3365. ((_var) = (_val))
  3366. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3367. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3368. ((_var) = (_val))
  3369. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3370. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3371. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3372. do { \
  3373. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3374. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3375. } while (0)
  3376. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3377. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3378. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3379. do { \
  3380. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3381. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3382. } while (0)
  3383. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3384. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3385. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3386. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3387. do { \
  3388. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3389. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3390. } while (0)
  3391. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3392. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3393. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3394. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3395. do { \
  3396. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3397. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3398. } while (0)
  3399. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3400. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3401. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3402. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3403. do { \
  3404. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3405. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3406. } while (0)
  3407. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3408. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3409. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3410. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3411. do { \
  3412. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3413. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3414. } while (0)
  3415. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3416. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3417. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3418. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3419. do { \
  3420. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3421. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3422. } while (0)
  3423. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3424. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3425. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3426. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3427. do { \
  3428. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3429. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3430. } while (0)
  3431. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3432. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3433. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3434. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3435. do { \
  3436. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3437. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3438. } while (0)
  3439. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3440. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3441. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3442. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3443. do { \
  3444. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3445. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3446. } while (0)
  3447. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3448. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3449. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3450. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3451. do { \
  3452. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3453. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3454. } while (0)
  3455. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3456. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3457. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3458. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3459. do { \
  3460. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3461. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3462. } while (0)
  3463. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3464. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3465. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3466. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3467. do { \
  3468. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3469. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3470. } while (0)
  3471. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3472. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3473. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3474. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3475. do { \
  3476. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3477. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3478. } while (0)
  3479. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3480. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3481. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3482. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3483. do { \
  3484. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3485. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3486. } while (0)
  3487. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3488. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3489. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3490. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3491. do { \
  3492. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3493. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3494. } while (0)
  3495. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3496. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3497. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3498. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3499. do { \
  3500. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3501. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3502. } while (0)
  3503. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3504. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3505. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3506. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3507. do { \
  3508. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3509. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3510. } while (0)
  3511. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3512. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3513. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3514. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3515. do { \
  3516. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3517. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3518. } while (0)
  3519. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3520. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3521. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3522. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3523. do { \
  3524. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3525. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3526. } while (0)
  3527. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3528. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3529. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3530. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3531. do { \
  3532. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3533. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3534. } while (0)
  3535. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3536. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3537. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3538. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3539. do { \
  3540. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3541. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3542. } while (0)
  3543. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3544. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3545. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3546. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3547. do { \
  3548. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3549. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3550. } while (0)
  3551. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3552. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3553. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3554. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3555. do { \
  3556. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3557. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3558. } while (0)
  3559. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3560. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3561. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3562. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3563. do { \
  3564. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3565. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3566. } while (0)
  3567. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3568. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3569. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3570. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3571. do { \
  3572. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3573. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3574. } while (0)
  3575. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3576. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3577. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3578. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3579. do { \
  3580. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3581. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3582. } while (0)
  3583. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3584. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3585. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3586. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3587. do { \
  3588. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3589. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3590. } while (0)
  3591. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3592. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3593. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3594. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3595. do { \
  3596. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3597. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3598. } while (0)
  3599. /**
  3600. * @brief host -> target FW statistics retrieve
  3601. *
  3602. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3603. *
  3604. * @details
  3605. * The following field definitions describe the format of the HTT host
  3606. * to target FW stats retrieve message. The message specifies the type of
  3607. * stats host wants to retrieve.
  3608. *
  3609. * |31 24|23 16|15 8|7 0|
  3610. * |-----------------------------------------------------------|
  3611. * | stats types request bitmask | msg type |
  3612. * |-----------------------------------------------------------|
  3613. * | stats types reset bitmask | reserved |
  3614. * |-----------------------------------------------------------|
  3615. * | stats type | config value |
  3616. * |-----------------------------------------------------------|
  3617. * | cookie LSBs |
  3618. * |-----------------------------------------------------------|
  3619. * | cookie MSBs |
  3620. * |-----------------------------------------------------------|
  3621. * Header fields:
  3622. * - MSG_TYPE
  3623. * Bits 7:0
  3624. * Purpose: identifies this is a stats upload request message
  3625. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3626. * - UPLOAD_TYPES
  3627. * Bits 31:8
  3628. * Purpose: identifies which types of FW statistics to upload
  3629. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3630. * - RESET_TYPES
  3631. * Bits 31:8
  3632. * Purpose: identifies which types of FW statistics to reset
  3633. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3634. * - CFG_VAL
  3635. * Bits 23:0
  3636. * Purpose: give an opaque configuration value to the specified stats type
  3637. * Value: stats-type specific configuration value
  3638. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3639. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3640. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3641. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3642. * - CFG_STAT_TYPE
  3643. * Bits 31:24
  3644. * Purpose: specify which stats type (if any) the config value applies to
  3645. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3646. * a valid configuration specification
  3647. * - COOKIE_LSBS
  3648. * Bits 31:0
  3649. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3650. * message with its preceding host->target stats request message.
  3651. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3652. * - COOKIE_MSBS
  3653. * Bits 31:0
  3654. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3655. * message with its preceding host->target stats request message.
  3656. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3657. */
  3658. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3659. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3660. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3661. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3662. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3663. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3664. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3665. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3666. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3667. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3668. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3669. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3670. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3671. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3672. do { \
  3673. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3674. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3675. } while (0)
  3676. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3677. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3678. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3679. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3680. do { \
  3681. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3682. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3683. } while (0)
  3684. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3685. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3686. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3687. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3688. do { \
  3689. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3690. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3691. } while (0)
  3692. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3693. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3694. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3695. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3696. do { \
  3697. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3698. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3699. } while (0)
  3700. /**
  3701. * @brief host -> target HTT out-of-band sync request
  3702. *
  3703. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3704. *
  3705. * @details
  3706. * The HTT SYNC tells the target to suspend processing of subsequent
  3707. * HTT host-to-target messages until some other target agent locally
  3708. * informs the target HTT FW that the current sync counter is equal to
  3709. * or greater than (in a modulo sense) the sync counter specified in
  3710. * the SYNC message.
  3711. * This allows other host-target components to synchronize their operation
  3712. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3713. * security key has been downloaded to and activated by the target.
  3714. * In the absence of any explicit synchronization counter value
  3715. * specification, the target HTT FW will use zero as the default current
  3716. * sync value.
  3717. *
  3718. * |31 24|23 16|15 8|7 0|
  3719. * |-----------------------------------------------------------|
  3720. * | reserved | sync count | msg type |
  3721. * |-----------------------------------------------------------|
  3722. * Header fields:
  3723. * - MSG_TYPE
  3724. * Bits 7:0
  3725. * Purpose: identifies this as a sync message
  3726. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3727. * - SYNC_COUNT
  3728. * Bits 15:8
  3729. * Purpose: specifies what sync value the HTT FW will wait for from
  3730. * an out-of-band specification to resume its operation
  3731. * Value: in-band sync counter value to compare against the out-of-band
  3732. * counter spec.
  3733. * The HTT target FW will suspend its host->target message processing
  3734. * as long as
  3735. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3736. */
  3737. #define HTT_H2T_SYNC_MSG_SZ 4
  3738. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3739. #define HTT_H2T_SYNC_COUNT_S 8
  3740. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3741. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3742. HTT_H2T_SYNC_COUNT_S)
  3743. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3744. do { \
  3745. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3746. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3747. } while (0)
  3748. /**
  3749. * @brief host -> target HTT aggregation configuration
  3750. *
  3751. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3752. */
  3753. #define HTT_AGGR_CFG_MSG_SZ 4
  3754. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3755. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3756. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3757. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3758. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3759. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3760. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3761. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3762. do { \
  3763. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3764. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3765. } while (0)
  3766. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3767. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3768. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3769. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3770. do { \
  3771. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3772. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3773. } while (0)
  3774. /**
  3775. * @brief host -> target HTT configure max amsdu info per vdev
  3776. *
  3777. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3778. *
  3779. * @details
  3780. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3781. *
  3782. * |31 21|20 16|15 8|7 0|
  3783. * |-----------------------------------------------------------|
  3784. * | reserved | vdev id | max amsdu | msg type |
  3785. * |-----------------------------------------------------------|
  3786. * Header fields:
  3787. * - MSG_TYPE
  3788. * Bits 7:0
  3789. * Purpose: identifies this as a aggr cfg ex message
  3790. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3791. * - MAX_NUM_AMSDU_SUBFRM
  3792. * Bits 15:8
  3793. * Purpose: max MSDUs per A-MSDU
  3794. * - VDEV_ID
  3795. * Bits 20:16
  3796. * Purpose: ID of the vdev to which this limit is applied
  3797. */
  3798. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3799. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3800. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3801. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3802. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3803. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3804. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3805. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3806. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3807. do { \
  3808. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3809. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3810. } while (0)
  3811. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3812. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3813. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3814. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3815. do { \
  3816. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3817. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3818. } while (0)
  3819. /**
  3820. * @brief HTT WDI_IPA Config Message
  3821. *
  3822. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3823. *
  3824. * @details
  3825. * The HTT WDI_IPA config message is created/sent by host at driver
  3826. * init time. It contains information about data structures used on
  3827. * WDI_IPA TX and RX path.
  3828. * TX CE ring is used for pushing packet metadata from IPA uC
  3829. * to WLAN FW
  3830. * TX Completion ring is used for generating TX completions from
  3831. * WLAN FW to IPA uC
  3832. * RX Indication ring is used for indicating RX packets from FW
  3833. * to IPA uC
  3834. * RX Ring2 is used as either completion ring or as second
  3835. * indication ring. when Ring2 is used as completion ring, IPA uC
  3836. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3837. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3838. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3839. * indicated in RX Indication ring. Please see WDI_IPA specification
  3840. * for more details.
  3841. * |31 24|23 16|15 8|7 0|
  3842. * |----------------+----------------+----------------+----------------|
  3843. * | tx pkt pool size | Rsvd | msg_type |
  3844. * |-------------------------------------------------------------------|
  3845. * | tx comp ring base (bits 31:0) |
  3846. #if HTT_PADDR64
  3847. * | tx comp ring base (bits 63:32) |
  3848. #endif
  3849. * |-------------------------------------------------------------------|
  3850. * | tx comp ring size |
  3851. * |-------------------------------------------------------------------|
  3852. * | tx comp WR_IDX physical address (bits 31:0) |
  3853. #if HTT_PADDR64
  3854. * | tx comp WR_IDX physical address (bits 63:32) |
  3855. #endif
  3856. * |-------------------------------------------------------------------|
  3857. * | tx CE WR_IDX physical address (bits 31:0) |
  3858. #if HTT_PADDR64
  3859. * | tx CE WR_IDX physical address (bits 63:32) |
  3860. #endif
  3861. * |-------------------------------------------------------------------|
  3862. * | rx indication ring base (bits 31:0) |
  3863. #if HTT_PADDR64
  3864. * | rx indication ring base (bits 63:32) |
  3865. #endif
  3866. * |-------------------------------------------------------------------|
  3867. * | rx indication ring size |
  3868. * |-------------------------------------------------------------------|
  3869. * | rx ind RD_IDX physical address (bits 31:0) |
  3870. #if HTT_PADDR64
  3871. * | rx ind RD_IDX physical address (bits 63:32) |
  3872. #endif
  3873. * |-------------------------------------------------------------------|
  3874. * | rx ind WR_IDX physical address (bits 31:0) |
  3875. #if HTT_PADDR64
  3876. * | rx ind WR_IDX physical address (bits 63:32) |
  3877. #endif
  3878. * |-------------------------------------------------------------------|
  3879. * |-------------------------------------------------------------------|
  3880. * | rx ring2 base (bits 31:0) |
  3881. #if HTT_PADDR64
  3882. * | rx ring2 base (bits 63:32) |
  3883. #endif
  3884. * |-------------------------------------------------------------------|
  3885. * | rx ring2 size |
  3886. * |-------------------------------------------------------------------|
  3887. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3888. #if HTT_PADDR64
  3889. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3890. #endif
  3891. * |-------------------------------------------------------------------|
  3892. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3893. #if HTT_PADDR64
  3894. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3895. #endif
  3896. * |-------------------------------------------------------------------|
  3897. *
  3898. * Header fields:
  3899. * Header fields:
  3900. * - MSG_TYPE
  3901. * Bits 7:0
  3902. * Purpose: Identifies this as WDI_IPA config message
  3903. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3904. * - TX_PKT_POOL_SIZE
  3905. * Bits 15:0
  3906. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3907. * WDI_IPA TX path
  3908. * For systems using 32-bit format for bus addresses:
  3909. * - TX_COMP_RING_BASE_ADDR
  3910. * Bits 31:0
  3911. * Purpose: TX Completion Ring base address in DDR
  3912. * - TX_COMP_RING_SIZE
  3913. * Bits 31:0
  3914. * Purpose: TX Completion Ring size (must be power of 2)
  3915. * - TX_COMP_WR_IDX_ADDR
  3916. * Bits 31:0
  3917. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3918. * updates the Write Index for WDI_IPA TX completion ring
  3919. * - TX_CE_WR_IDX_ADDR
  3920. * Bits 31:0
  3921. * Purpose: DDR address where IPA uC
  3922. * updates the WR Index for TX CE ring
  3923. * (needed for fusion platforms)
  3924. * - RX_IND_RING_BASE_ADDR
  3925. * Bits 31:0
  3926. * Purpose: RX Indication Ring base address in DDR
  3927. * - RX_IND_RING_SIZE
  3928. * Bits 31:0
  3929. * Purpose: RX Indication Ring size
  3930. * - RX_IND_RD_IDX_ADDR
  3931. * Bits 31:0
  3932. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3933. * RX indication ring
  3934. * - RX_IND_WR_IDX_ADDR
  3935. * Bits 31:0
  3936. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3937. * updates the Write Index for WDI_IPA RX indication ring
  3938. * - RX_RING2_BASE_ADDR
  3939. * Bits 31:0
  3940. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3941. * - RX_RING2_SIZE
  3942. * Bits 31:0
  3943. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3944. * - RX_RING2_RD_IDX_ADDR
  3945. * Bits 31:0
  3946. * Purpose: If Second RX ring is Indication ring, DDR address where
  3947. * IPA uC updates the Read Index for Ring2.
  3948. * If Second RX ring is completion ring, this is NOT used
  3949. * - RX_RING2_WR_IDX_ADDR
  3950. * Bits 31:0
  3951. * Purpose: If Second RX ring is Indication ring, DDR address where
  3952. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3953. * If second RX ring is completion ring, DDR address where
  3954. * IPA uC updates the Write Index for Ring 2.
  3955. * For systems using 64-bit format for bus addresses:
  3956. * - TX_COMP_RING_BASE_ADDR_LO
  3957. * Bits 31:0
  3958. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3959. * - TX_COMP_RING_BASE_ADDR_HI
  3960. * Bits 31:0
  3961. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3962. * - TX_COMP_RING_SIZE
  3963. * Bits 31:0
  3964. * Purpose: TX Completion Ring size (must be power of 2)
  3965. * - TX_COMP_WR_IDX_ADDR_LO
  3966. * Bits 31:0
  3967. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3968. * Lower 4 bytes of DDR address where WIFI FW
  3969. * updates the Write Index for WDI_IPA TX completion ring
  3970. * - TX_COMP_WR_IDX_ADDR_HI
  3971. * Bits 31:0
  3972. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3973. * Higher 4 bytes of DDR address where WIFI FW
  3974. * updates the Write Index for WDI_IPA TX completion ring
  3975. * - TX_CE_WR_IDX_ADDR_LO
  3976. * Bits 31:0
  3977. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3978. * updates the WR Index for TX CE ring
  3979. * (needed for fusion platforms)
  3980. * - TX_CE_WR_IDX_ADDR_HI
  3981. * Bits 31:0
  3982. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3983. * updates the WR Index for TX CE ring
  3984. * (needed for fusion platforms)
  3985. * - RX_IND_RING_BASE_ADDR_LO
  3986. * Bits 31:0
  3987. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3988. * - RX_IND_RING_BASE_ADDR_HI
  3989. * Bits 31:0
  3990. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3991. * - RX_IND_RING_SIZE
  3992. * Bits 31:0
  3993. * Purpose: RX Indication Ring size
  3994. * - RX_IND_RD_IDX_ADDR_LO
  3995. * Bits 31:0
  3996. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3997. * for WDI_IPA RX indication ring
  3998. * - RX_IND_RD_IDX_ADDR_HI
  3999. * Bits 31:0
  4000. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  4001. * for WDI_IPA RX indication ring
  4002. * - RX_IND_WR_IDX_ADDR_LO
  4003. * Bits 31:0
  4004. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  4005. * Lower 4 bytes of DDR address where WIFI FW
  4006. * updates the Write Index for WDI_IPA RX indication ring
  4007. * - RX_IND_WR_IDX_ADDR_HI
  4008. * Bits 31:0
  4009. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  4010. * Higher 4 bytes of DDR address where WIFI FW
  4011. * updates the Write Index for WDI_IPA RX indication ring
  4012. * - RX_RING2_BASE_ADDR_LO
  4013. * Bits 31:0
  4014. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4015. * - RX_RING2_BASE_ADDR_HI
  4016. * Bits 31:0
  4017. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4018. * - RX_RING2_SIZE
  4019. * Bits 31:0
  4020. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  4021. * - RX_RING2_RD_IDX_ADDR_LO
  4022. * Bits 31:0
  4023. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4024. * DDR address where IPA uC updates the Read Index for Ring2.
  4025. * If Second RX ring is completion ring, this is NOT used
  4026. * - RX_RING2_RD_IDX_ADDR_HI
  4027. * Bits 31:0
  4028. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4029. * DDR address where IPA uC updates the Read Index for Ring2.
  4030. * If Second RX ring is completion ring, this is NOT used
  4031. * - RX_RING2_WR_IDX_ADDR_LO
  4032. * Bits 31:0
  4033. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4034. * DDR address where WIFI FW updates the Write Index
  4035. * for WDI_IPA RX ring2
  4036. * If second RX ring is completion ring, lower 4 bytes of
  4037. * DDR address where IPA uC updates the Write Index for Ring 2.
  4038. * - RX_RING2_WR_IDX_ADDR_HI
  4039. * Bits 31:0
  4040. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4041. * DDR address where WIFI FW updates the Write Index
  4042. * for WDI_IPA RX ring2
  4043. * If second RX ring is completion ring, higher 4 bytes of
  4044. * DDR address where IPA uC updates the Write Index for Ring 2.
  4045. */
  4046. #if HTT_PADDR64
  4047. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4048. #else
  4049. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4050. #endif
  4051. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4052. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4053. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4054. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4055. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4056. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4057. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4058. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4059. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4060. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4061. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4062. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4063. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4064. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4065. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4066. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4067. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4068. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4069. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4070. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4071. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4072. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4073. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4074. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4075. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4076. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4077. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4078. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4079. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4080. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4081. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4082. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4083. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4084. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4085. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4086. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4087. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4088. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4089. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4090. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4091. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4092. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4093. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4094. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4095. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4096. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4097. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4098. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4099. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4100. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4101. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4102. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4103. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4104. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4105. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4106. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4107. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4108. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4109. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4110. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4111. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4112. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4113. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4114. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4115. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4116. do { \
  4117. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4118. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4119. } while (0)
  4120. /* for systems using 32-bit format for bus addr */
  4121. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4122. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4123. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4124. do { \
  4125. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4126. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4127. } while (0)
  4128. /* for systems using 64-bit format for bus addr */
  4129. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4130. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4131. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4132. do { \
  4133. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4134. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4135. } while (0)
  4136. /* for systems using 64-bit format for bus addr */
  4137. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4138. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4139. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4140. do { \
  4141. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4142. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4143. } while (0)
  4144. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4145. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4146. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4147. do { \
  4148. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4149. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4150. } while (0)
  4151. /* for systems using 32-bit format for bus addr */
  4152. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4153. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4154. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4155. do { \
  4156. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4157. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4158. } while (0)
  4159. /* for systems using 64-bit format for bus addr */
  4160. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4161. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4162. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4163. do { \
  4164. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4165. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4166. } while (0)
  4167. /* for systems using 64-bit format for bus addr */
  4168. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4169. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4170. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4171. do { \
  4172. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4173. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4174. } while (0)
  4175. /* for systems using 32-bit format for bus addr */
  4176. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4177. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4178. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4179. do { \
  4180. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4181. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4182. } while (0)
  4183. /* for systems using 64-bit format for bus addr */
  4184. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4185. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4186. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4187. do { \
  4188. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4189. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4190. } while (0)
  4191. /* for systems using 64-bit format for bus addr */
  4192. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4193. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4194. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4195. do { \
  4196. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4197. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4198. } while (0)
  4199. /* for systems using 32-bit format for bus addr */
  4200. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4201. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4202. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4203. do { \
  4204. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4205. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4206. } while (0)
  4207. /* for systems using 64-bit format for bus addr */
  4208. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4209. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4210. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4211. do { \
  4212. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4213. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4214. } while (0)
  4215. /* for systems using 64-bit format for bus addr */
  4216. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4217. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4218. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4219. do { \
  4220. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4221. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4222. } while (0)
  4223. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4224. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4225. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4226. do { \
  4227. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4228. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4229. } while (0)
  4230. /* for systems using 32-bit format for bus addr */
  4231. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4232. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4233. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4234. do { \
  4235. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4236. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4237. } while (0)
  4238. /* for systems using 64-bit format for bus addr */
  4239. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4240. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4241. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4242. do { \
  4243. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4244. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4245. } while (0)
  4246. /* for systems using 64-bit format for bus addr */
  4247. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4248. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4249. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4250. do { \
  4251. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4252. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4253. } while (0)
  4254. /* for systems using 32-bit format for bus addr */
  4255. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4256. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4257. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4258. do { \
  4259. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4260. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4261. } while (0)
  4262. /* for systems using 64-bit format for bus addr */
  4263. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4264. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4265. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4266. do { \
  4267. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4268. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4269. } while (0)
  4270. /* for systems using 64-bit format for bus addr */
  4271. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4272. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4273. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4274. do { \
  4275. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4276. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4277. } while (0)
  4278. /* for systems using 32-bit format for bus addr */
  4279. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4280. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4281. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4282. do { \
  4283. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4284. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4285. } while (0)
  4286. /* for systems using 64-bit format for bus addr */
  4287. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4288. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4289. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4290. do { \
  4291. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4292. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4293. } while (0)
  4294. /* for systems using 64-bit format for bus addr */
  4295. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4296. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4297. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4298. do { \
  4299. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4300. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4301. } while (0)
  4302. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4303. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4304. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4305. do { \
  4306. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4307. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4308. } while (0)
  4309. /* for systems using 32-bit format for bus addr */
  4310. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4311. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4312. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4313. do { \
  4314. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4315. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4316. } while (0)
  4317. /* for systems using 64-bit format for bus addr */
  4318. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4319. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4320. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4321. do { \
  4322. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4323. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4324. } while (0)
  4325. /* for systems using 64-bit format for bus addr */
  4326. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4327. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4328. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4329. do { \
  4330. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4331. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4332. } while (0)
  4333. /* for systems using 32-bit format for bus addr */
  4334. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4335. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4336. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4337. do { \
  4338. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4339. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4340. } while (0)
  4341. /* for systems using 64-bit format for bus addr */
  4342. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4343. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4344. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4345. do { \
  4346. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4347. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4348. } while (0)
  4349. /* for systems using 64-bit format for bus addr */
  4350. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4351. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4352. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4353. do { \
  4354. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4355. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4356. } while (0)
  4357. /*
  4358. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4359. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4360. * addresses are stored in a XXX-bit field.
  4361. * This macro is used to define both htt_wdi_ipa_config32_t and
  4362. * htt_wdi_ipa_config64_t structs.
  4363. */
  4364. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4365. _paddr__tx_comp_ring_base_addr_, \
  4366. _paddr__tx_comp_wr_idx_addr_, \
  4367. _paddr__tx_ce_wr_idx_addr_, \
  4368. _paddr__rx_ind_ring_base_addr_, \
  4369. _paddr__rx_ind_rd_idx_addr_, \
  4370. _paddr__rx_ind_wr_idx_addr_, \
  4371. _paddr__rx_ring2_base_addr_,\
  4372. _paddr__rx_ring2_rd_idx_addr_,\
  4373. _paddr__rx_ring2_wr_idx_addr_) \
  4374. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4375. { \
  4376. /* DWORD 0: flags and meta-data */ \
  4377. A_UINT32 \
  4378. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4379. reserved: 8, \
  4380. tx_pkt_pool_size: 16;\
  4381. /* DWORD 1 */\
  4382. _paddr__tx_comp_ring_base_addr_;\
  4383. /* DWORD 2 (or 3)*/\
  4384. A_UINT32 tx_comp_ring_size;\
  4385. /* DWORD 3 (or 4)*/\
  4386. _paddr__tx_comp_wr_idx_addr_;\
  4387. /* DWORD 4 (or 6)*/\
  4388. _paddr__tx_ce_wr_idx_addr_;\
  4389. /* DWORD 5 (or 8)*/\
  4390. _paddr__rx_ind_ring_base_addr_;\
  4391. /* DWORD 6 (or 10)*/\
  4392. A_UINT32 rx_ind_ring_size;\
  4393. /* DWORD 7 (or 11)*/\
  4394. _paddr__rx_ind_rd_idx_addr_;\
  4395. /* DWORD 8 (or 13)*/\
  4396. _paddr__rx_ind_wr_idx_addr_;\
  4397. /* DWORD 9 (or 15)*/\
  4398. _paddr__rx_ring2_base_addr_;\
  4399. /* DWORD 10 (or 17) */\
  4400. A_UINT32 rx_ring2_size;\
  4401. /* DWORD 11 (or 18) */\
  4402. _paddr__rx_ring2_rd_idx_addr_;\
  4403. /* DWORD 12 (or 20) */\
  4404. _paddr__rx_ring2_wr_idx_addr_;\
  4405. } POSTPACK
  4406. /* define a htt_wdi_ipa_config32_t type */
  4407. 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));
  4408. /* define a htt_wdi_ipa_config64_t type */
  4409. 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));
  4410. #if HTT_PADDR64
  4411. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4412. #else
  4413. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4414. #endif
  4415. enum htt_wdi_ipa_op_code {
  4416. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4417. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4418. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4419. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4420. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4421. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4422. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4423. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4424. /* keep this last */
  4425. HTT_WDI_IPA_OPCODE_MAX
  4426. };
  4427. /**
  4428. * @brief HTT WDI_IPA Operation Request Message
  4429. *
  4430. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4431. *
  4432. * @details
  4433. * HTT WDI_IPA Operation Request message is sent by host
  4434. * to either suspend or resume WDI_IPA TX or RX path.
  4435. * |31 24|23 16|15 8|7 0|
  4436. * |----------------+----------------+----------------+----------------|
  4437. * | op_code | Rsvd | msg_type |
  4438. * |-------------------------------------------------------------------|
  4439. *
  4440. * Header fields:
  4441. * - MSG_TYPE
  4442. * Bits 7:0
  4443. * Purpose: Identifies this as WDI_IPA Operation Request message
  4444. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4445. * - OP_CODE
  4446. * Bits 31:16
  4447. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4448. * value: = enum htt_wdi_ipa_op_code
  4449. */
  4450. PREPACK struct htt_wdi_ipa_op_request_t
  4451. {
  4452. /* DWORD 0: flags and meta-data */
  4453. A_UINT32
  4454. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4455. reserved: 8,
  4456. op_code: 16;
  4457. } POSTPACK;
  4458. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4459. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4460. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4461. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4462. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4463. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4464. do { \
  4465. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4466. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4467. } while (0)
  4468. /*
  4469. * @brief host -> target HTT_MSI_SETUP message
  4470. *
  4471. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4472. *
  4473. * @details
  4474. * After target is booted up, host can send MSI setup message so that
  4475. * target sets up HW registers based on setup message.
  4476. *
  4477. * The message would appear as follows:
  4478. * |31 24|23 16|15|14 8|7 0|
  4479. * |---------------+-----------------+-----------------+-----------------|
  4480. * | reserved | msi_type | pdev_id | msg_type |
  4481. * |---------------------------------------------------------------------|
  4482. * | msi_addr_lo |
  4483. * |---------------------------------------------------------------------|
  4484. * | msi_addr_hi |
  4485. * |---------------------------------------------------------------------|
  4486. * | msi_data |
  4487. * |---------------------------------------------------------------------|
  4488. *
  4489. * The message is interpreted as follows:
  4490. * dword0 - b'0:7 - msg_type: This will be set to
  4491. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4492. * b'8:15 - pdev_id:
  4493. * 0 (for rings at SOC/UMAC level),
  4494. * 1/2/3 mac id (for rings at LMAC level)
  4495. * b'16:23 - msi_type: identify which msi registers need to be setup
  4496. * more details can be got from enum htt_msi_setup_type
  4497. * b'24:31 - reserved
  4498. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4499. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4500. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4501. */
  4502. PREPACK struct htt_msi_setup_t {
  4503. A_UINT32 msg_type: 8,
  4504. pdev_id: 8,
  4505. msi_type: 8,
  4506. reserved: 8;
  4507. A_UINT32 msi_addr_lo;
  4508. A_UINT32 msi_addr_hi;
  4509. A_UINT32 msi_data;
  4510. } POSTPACK;
  4511. enum htt_msi_setup_type {
  4512. HTT_PPDU_END_MSI_SETUP_TYPE,
  4513. /* Insert new types here*/
  4514. };
  4515. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4516. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4517. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4518. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4519. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4520. HTT_MSI_SETUP_PDEV_ID_S)
  4521. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4522. do { \
  4523. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4524. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4525. } while (0)
  4526. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4527. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4528. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4529. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4530. HTT_MSI_SETUP_MSI_TYPE_S)
  4531. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4532. do { \
  4533. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4534. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4535. } while (0)
  4536. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4537. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4538. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4539. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4540. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4541. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4542. do { \
  4543. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4544. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4545. } while (0)
  4546. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4547. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4548. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4549. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4550. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4551. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4552. do { \
  4553. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4554. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4555. } while (0)
  4556. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4557. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4558. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4559. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4560. HTT_MSI_SETUP_MSI_DATA_S)
  4561. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4562. do { \
  4563. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4564. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4565. } while (0)
  4566. /*
  4567. * @brief host -> target HTT_SRING_SETUP message
  4568. *
  4569. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4570. *
  4571. * @details
  4572. * After target is booted up, Host can send SRING setup message for
  4573. * each host facing LMAC SRING. Target setups up HW registers based
  4574. * on setup message and confirms back to Host if response_required is set.
  4575. * Host should wait for confirmation message before sending new SRING
  4576. * setup message
  4577. *
  4578. * The message would appear as follows:
  4579. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4580. * |--------------- +-----------------+-----------------+-----------------|
  4581. * | ring_type | ring_id | pdev_id | msg_type |
  4582. * |----------------------------------------------------------------------|
  4583. * | ring_base_addr_lo |
  4584. * |----------------------------------------------------------------------|
  4585. * | ring_base_addr_hi |
  4586. * |----------------------------------------------------------------------|
  4587. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4588. * |----------------------------------------------------------------------|
  4589. * | ring_head_offset32_remote_addr_lo |
  4590. * |----------------------------------------------------------------------|
  4591. * | ring_head_offset32_remote_addr_hi |
  4592. * |----------------------------------------------------------------------|
  4593. * | ring_tail_offset32_remote_addr_lo |
  4594. * |----------------------------------------------------------------------|
  4595. * | ring_tail_offset32_remote_addr_hi |
  4596. * |----------------------------------------------------------------------|
  4597. * | ring_msi_addr_lo |
  4598. * |----------------------------------------------------------------------|
  4599. * | ring_msi_addr_hi |
  4600. * |----------------------------------------------------------------------|
  4601. * | ring_msi_data |
  4602. * |----------------------------------------------------------------------|
  4603. * | intr_timer_th |IM| intr_batch_counter_th |
  4604. * |----------------------------------------------------------------------|
  4605. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4606. * |----------------------------------------------------------------------|
  4607. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4608. * |----------------------------------------------------------------------|
  4609. * Where
  4610. * IM = sw_intr_mode
  4611. * RR = response_required
  4612. * PTCF = prefetch_timer_cfg
  4613. * IP = IPA drop flag
  4614. *
  4615. * The message is interpreted as follows:
  4616. * dword0 - b'0:7 - msg_type: This will be set to
  4617. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4618. * b'8:15 - pdev_id:
  4619. * 0 (for rings at SOC/UMAC level),
  4620. * 1/2/3 mac id (for rings at LMAC level)
  4621. * b'16:23 - ring_id: identify which ring is to setup,
  4622. * more details can be got from enum htt_srng_ring_id
  4623. * b'24:31 - ring_type: identify type of host rings,
  4624. * more details can be got from enum htt_srng_ring_type
  4625. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4626. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4627. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4628. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4629. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4630. * SW_TO_HW_RING.
  4631. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4632. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4633. * Lower 32 bits of memory address of the remote variable
  4634. * storing the 4-byte word offset that identifies the head
  4635. * element within the ring.
  4636. * (The head offset variable has type A_UINT32.)
  4637. * Valid for HW_TO_SW and SW_TO_SW rings.
  4638. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4639. * Upper 32 bits of memory address of the remote variable
  4640. * storing the 4-byte word offset that identifies the head
  4641. * element within the ring.
  4642. * (The head offset variable has type A_UINT32.)
  4643. * Valid for HW_TO_SW and SW_TO_SW rings.
  4644. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4645. * Lower 32 bits of memory address of the remote variable
  4646. * storing the 4-byte word offset that identifies the tail
  4647. * element within the ring.
  4648. * (The tail offset variable has type A_UINT32.)
  4649. * Valid for HW_TO_SW and SW_TO_SW rings.
  4650. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4651. * Upper 32 bits of memory address of the remote variable
  4652. * storing the 4-byte word offset that identifies the tail
  4653. * element within the ring.
  4654. * (The tail offset variable has type A_UINT32.)
  4655. * Valid for HW_TO_SW and SW_TO_SW rings.
  4656. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4657. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4658. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4659. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4660. * dword10 - b'0:31 - ring_msi_data: MSI data
  4661. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4662. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4663. * dword11 - b'0:14 - intr_batch_counter_th:
  4664. * batch counter threshold is in units of 4-byte words.
  4665. * HW internally maintains and increments batch count.
  4666. * (see SRING spec for detail description).
  4667. * When batch count reaches threshold value, an interrupt
  4668. * is generated by HW.
  4669. * b'15 - sw_intr_mode:
  4670. * This configuration shall be static.
  4671. * Only programmed at power up.
  4672. * 0: generate pulse style sw interrupts
  4673. * 1: generate level style sw interrupts
  4674. * b'16:31 - intr_timer_th:
  4675. * The timer init value when timer is idle or is
  4676. * initialized to start downcounting.
  4677. * In 8us units (to cover a range of 0 to 524 ms)
  4678. * dword12 - b'0:15 - intr_low_threshold:
  4679. * Used only by Consumer ring to generate ring_sw_int_p.
  4680. * Ring entries low threshold water mark, that is used
  4681. * in combination with the interrupt timer as well as
  4682. * the the clearing of the level interrupt.
  4683. * b'16:18 - prefetch_timer_cfg:
  4684. * Used only by Consumer ring to set timer mode to
  4685. * support Application prefetch handling.
  4686. * The external tail offset/pointer will be updated
  4687. * at following intervals:
  4688. * 3'b000: (Prefetch feature disabled; used only for debug)
  4689. * 3'b001: 1 usec
  4690. * 3'b010: 4 usec
  4691. * 3'b011: 8 usec (default)
  4692. * 3'b100: 16 usec
  4693. * Others: Reserved
  4694. * b'19 - response_required:
  4695. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4696. * b'20 - ipa_drop_flag:
  4697. Indicates that host will config ipa drop threshold percentage
  4698. * b'21:31 - reserved: reserved for future use
  4699. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4700. * b'8:15 - ipa drop high threshold percentage:
  4701. * b'16:31 - Reserved
  4702. */
  4703. PREPACK struct htt_sring_setup_t {
  4704. A_UINT32 msg_type: 8,
  4705. pdev_id: 8,
  4706. ring_id: 8,
  4707. ring_type: 8;
  4708. A_UINT32 ring_base_addr_lo;
  4709. A_UINT32 ring_base_addr_hi;
  4710. A_UINT32 ring_size: 16,
  4711. ring_entry_size: 8,
  4712. ring_misc_cfg_flag: 8;
  4713. A_UINT32 ring_head_offset32_remote_addr_lo;
  4714. A_UINT32 ring_head_offset32_remote_addr_hi;
  4715. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4716. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4717. A_UINT32 ring_msi_addr_lo;
  4718. A_UINT32 ring_msi_addr_hi;
  4719. A_UINT32 ring_msi_data;
  4720. A_UINT32 intr_batch_counter_th: 15,
  4721. sw_intr_mode: 1,
  4722. intr_timer_th: 16;
  4723. A_UINT32 intr_low_threshold: 16,
  4724. prefetch_timer_cfg: 3,
  4725. response_required: 1,
  4726. ipa_drop_flag: 1,
  4727. reserved1: 11;
  4728. A_UINT32 ipa_drop_low_threshold: 8,
  4729. ipa_drop_high_threshold: 8,
  4730. reserved: 16;
  4731. } POSTPACK;
  4732. enum htt_srng_ring_type {
  4733. HTT_HW_TO_SW_RING = 0,
  4734. HTT_SW_TO_HW_RING,
  4735. HTT_SW_TO_SW_RING,
  4736. /* Insert new ring types above this line */
  4737. };
  4738. enum htt_srng_ring_id {
  4739. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4740. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4741. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4742. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4743. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4744. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4745. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4746. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4747. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4748. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4749. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4750. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4751. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4752. HTT_LPASS_TO_FW_RXBUF_RING, /* new LPASS to FW refill ring to recycle rx buffers */
  4753. HTT_HOST3_TO_FW_RXBUF_RING, /* used by host for EasyMesh feature */
  4754. /* Add Other SRING which can't be directly configured by host software above this line */
  4755. };
  4756. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4757. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4758. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4759. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4760. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4761. HTT_SRING_SETUP_PDEV_ID_S)
  4762. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4763. do { \
  4764. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4765. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4766. } while (0)
  4767. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4768. #define HTT_SRING_SETUP_RING_ID_S 16
  4769. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4770. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4771. HTT_SRING_SETUP_RING_ID_S)
  4772. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4773. do { \
  4774. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4775. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4776. } while (0)
  4777. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4778. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4779. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4780. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4781. HTT_SRING_SETUP_RING_TYPE_S)
  4782. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4783. do { \
  4784. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4785. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4786. } while (0)
  4787. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4788. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4789. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4790. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4791. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4792. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4793. do { \
  4794. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4795. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4796. } while (0)
  4797. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4798. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4799. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4800. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4801. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4802. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4803. do { \
  4804. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4805. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4806. } while (0)
  4807. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4808. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4809. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4810. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4811. HTT_SRING_SETUP_RING_SIZE_S)
  4812. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4813. do { \
  4814. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4815. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4816. } while (0)
  4817. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4818. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4819. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4820. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4821. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4822. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4823. do { \
  4824. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4825. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4826. } while (0)
  4827. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4828. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4829. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4830. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4831. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4832. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4833. do { \
  4834. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4835. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4836. } while (0)
  4837. /* This control bit is applicable to only Producer, which updates Ring ID field
  4838. * of each descriptor before pushing into the ring.
  4839. * 0: updates ring_id(default)
  4840. * 1: ring_id updating disabled */
  4841. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4842. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4843. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4844. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4845. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4846. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4847. do { \
  4848. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4849. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4850. } while (0)
  4851. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4852. * of each descriptor before pushing into the ring.
  4853. * 0: updates Loopcnt(default)
  4854. * 1: Loopcnt updating disabled */
  4855. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4856. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4857. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4858. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4859. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4860. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4861. do { \
  4862. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4863. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4864. } while (0)
  4865. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4866. * into security_id port of GXI/AXI. */
  4867. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4868. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4869. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4870. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4871. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4872. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4873. do { \
  4874. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4875. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4876. } while (0)
  4877. /* During MSI write operation, SRNG drives value of this register bit into
  4878. * swap bit of GXI/AXI. */
  4879. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4880. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4881. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4882. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4883. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4884. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4885. do { \
  4886. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4887. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4888. } while (0)
  4889. /* During Pointer write operation, SRNG drives value of this register bit into
  4890. * swap bit of GXI/AXI. */
  4891. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4892. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4893. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4894. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4895. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4896. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4897. do { \
  4898. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4899. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4900. } while (0)
  4901. /* During any data or TLV write operation, SRNG drives value of this register
  4902. * bit into swap bit of GXI/AXI. */
  4903. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4904. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4905. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4906. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4907. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4908. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4909. do { \
  4910. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4911. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4912. } while (0)
  4913. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4914. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4915. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4916. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4917. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4918. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4919. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4920. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4921. do { \
  4922. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4923. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4924. } while (0)
  4925. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4926. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4927. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4928. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4929. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4930. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4931. do { \
  4932. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4933. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4934. } while (0)
  4935. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4936. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4937. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4938. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4939. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4940. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4941. do { \
  4942. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4943. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4944. } while (0)
  4945. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4946. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4947. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4948. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4949. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4950. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4951. do { \
  4952. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4953. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4954. } while (0)
  4955. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4956. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4957. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4958. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4959. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4960. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4961. do { \
  4962. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4963. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4964. } while (0)
  4965. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4966. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4967. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4968. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4969. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4970. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4971. do { \
  4972. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4973. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4974. } while (0)
  4975. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4976. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4977. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4978. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4979. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4980. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4981. do { \
  4982. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4983. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4984. } while (0)
  4985. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4986. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4987. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4988. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4989. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4990. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4991. do { \
  4992. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4993. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4994. } while (0)
  4995. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4996. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4997. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4998. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4999. HTT_SRING_SETUP_SW_INTR_MODE_S)
  5000. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  5001. do { \
  5002. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  5003. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  5004. } while (0)
  5005. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  5006. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  5007. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  5008. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  5009. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  5010. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  5011. do { \
  5012. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  5013. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  5014. } while (0)
  5015. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  5016. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  5017. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  5018. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  5019. HTT_SRING_SETUP_INTR_LOW_TH_S)
  5020. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  5021. do { \
  5022. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  5023. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  5024. } while (0)
  5025. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  5026. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  5027. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  5028. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  5029. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  5030. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  5031. do { \
  5032. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  5033. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  5034. } while (0)
  5035. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5036. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5037. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5038. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5039. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5040. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5041. do { \
  5042. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5043. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5044. } while (0)
  5045. /**
  5046. * @brief host -> target RX ring selection config message
  5047. *
  5048. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5049. *
  5050. * @details
  5051. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5052. * configure RXDMA rings.
  5053. * The configuration is per ring based and includes both packet subtypes
  5054. * and PPDU/MPDU TLVs.
  5055. *
  5056. * The message would appear as follows:
  5057. *
  5058. * |31 28|27|26|25|24|23|22|21 19|18 16|15 | 11| 10|9 8|7 0|
  5059. * |-----+--+--+--+--+-----------------+----+---+---+---+---------------|
  5060. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5061. * |-----------------------+-----+-----+--------------------------------|
  5062. * |rsvd2|RX|RXHDL| CLD | CLC | CLM | ring_buffer_size |
  5063. * |--------------------------------------------------------------------|
  5064. * | packet_type_enable_flags_0 |
  5065. * |--------------------------------------------------------------------|
  5066. * | packet_type_enable_flags_1 |
  5067. * |--------------------------------------------------------------------|
  5068. * | packet_type_enable_flags_2 |
  5069. * |--------------------------------------------------------------------|
  5070. * | packet_type_enable_flags_3 |
  5071. * |--------------------------------------------------------------------|
  5072. * | tlv_filter_in_flags |
  5073. * |-----------------------------------+--------------------------------|
  5074. * | rx_header_offset | rx_packet_offset |
  5075. * |-----------------------------------+--------------------------------|
  5076. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5077. * |-----------------------------------+--------------------------------|
  5078. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5079. * |-----------------------------------+--------------------------------|
  5080. * | rsvd3 | rx_attention_offset |
  5081. * |--------------------------------------------------------------------|
  5082. * | rsvd4 | mo| fp| rx_drop_threshold |
  5083. * | |ndp|ndp| |
  5084. * |--------------------------------------------------------------------|
  5085. * Where:
  5086. * PS = pkt_swap
  5087. * SS = status_swap
  5088. * OV = rx_offsets_valid
  5089. * DT = drop_thresh_valid
  5090. * CLM = config_length_mgmt
  5091. * CLC = config_length_ctrl
  5092. * CLD = config_length_data
  5093. * RXHDL = rx_hdr_len
  5094. * RX = rxpcu_filter_enable_flag
  5095. * The message is interpreted as follows:
  5096. * dword0 - b'0:7 - msg_type: This will be set to
  5097. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5098. * b'8:15 - pdev_id:
  5099. * 0 (for rings at SOC/UMAC level),
  5100. * 1/2/3 mac id (for rings at LMAC level)
  5101. * b'16:23 - ring_id : Identify the ring to configure.
  5102. * More details can be got from enum htt_srng_ring_id
  5103. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5104. * BUF_RING_CFG_0 defs within HW .h files,
  5105. * e.g. wmac_top_reg_seq_hwioreg.h
  5106. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5107. * BUF_RING_CFG_0 defs within HW .h files,
  5108. * e.g. wmac_top_reg_seq_hwioreg.h
  5109. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5110. * configuration fields are valid
  5111. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5112. * rx_drop_threshold field is valid
  5113. * b'28 - rx_mon_global_en: Enable/Disable global register
  5114. 8 configuration in Rx monitor module.
  5115. * b'29:31 - rsvd1: reserved for future use
  5116. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5117. * in byte units.
  5118. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5119. * b'16:18 - config_length_mgmt (MGMT):
  5120. * Represents the length of mpdu bytes for mgmt pkt.
  5121. * valid values:
  5122. * 001 - 64bytes
  5123. * 010 - 128bytes
  5124. * 100 - 256bytes
  5125. * 111 - Full mpdu bytes
  5126. * b'19:21 - config_length_ctrl (CTRL):
  5127. * Represents the length of mpdu bytes for ctrl pkt.
  5128. * valid values:
  5129. * 001 - 64bytes
  5130. * 010 - 128bytes
  5131. * 100 - 256bytes
  5132. * 111 - Full mpdu bytes
  5133. * b'22:24 - config_length_data (DATA):
  5134. * Represents the length of mpdu bytes for data pkt.
  5135. * valid values:
  5136. * 001 - 64bytes
  5137. * 010 - 128bytes
  5138. * 100 - 256bytes
  5139. * 111 - Full mpdu bytes
  5140. * b'25:26 - rx_hdr_len:
  5141. * Specifies the number of bytes of recvd packet to copy
  5142. * into the rx_hdr tlv.
  5143. * supported values for now by host:
  5144. * 01 - 64bytes
  5145. * 10 - 128bytes
  5146. * 11 - 256bytes
  5147. * default - 128 bytes
  5148. * b'27 - rxpcu_filter_enable_flag
  5149. * For Scan Radio Host CPU utilization is very high.
  5150. * In order to reduce CPU utilization we need to filter out
  5151. * certain configured MAC frames.
  5152. * To filter out configured MAC address frames, RxPCU should
  5153. * be zero which means allow all frames for MD at RxOLE
  5154. * host wil fiter out frames.
  5155. * RxPCU (Filter IN) -> RxOLE (Filter In/Filter Out)
  5156. * b'28:31 - rsvd2: Reserved for future use
  5157. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5158. * Enable MGMT packet from 0b0000 to 0b1001
  5159. * bits from low to high: FP, MD, MO - 3 bits
  5160. * FP: Filter_Pass
  5161. * MD: Monitor_Direct
  5162. * MO: Monitor_Other
  5163. * 10 mgmt subtypes * 3 bits -> 30 bits
  5164. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5165. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5166. * Enable MGMT packet from 0b1010 to 0b1111
  5167. * bits from low to high: FP, MD, MO - 3 bits
  5168. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5169. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5170. * Enable CTRL packet from 0b0000 to 0b1001
  5171. * bits from low to high: FP, MD, MO - 3 bits
  5172. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5173. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5174. * Enable CTRL packet from 0b1010 to 0b1111,
  5175. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5176. * bits from low to high: FP, MD, MO - 3 bits
  5177. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5178. * dword6 - b'0:31 - tlv_filter_in_flags:
  5179. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5180. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5181. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5182. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5183. * A value of 0 will be considered as ignore this config.
  5184. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5185. * e.g. wmac_top_reg_seq_hwioreg.h
  5186. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5187. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5188. * A value of 0 will be considered as ignore this config.
  5189. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5190. * e.g. wmac_top_reg_seq_hwioreg.h
  5191. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5192. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5193. * A value of 0 will be considered as ignore this config.
  5194. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5195. * e.g. wmac_top_reg_seq_hwioreg.h
  5196. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5197. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5198. * A value of 0 will be considered as ignore this config.
  5199. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5200. * e.g. wmac_top_reg_seq_hwioreg.h
  5201. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5202. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5203. * A value of 0 will be considered as ignore this config.
  5204. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5205. * e.g. wmac_top_reg_seq_hwioreg.h
  5206. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5207. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5208. * A value of 0 will be considered as ignore this config.
  5209. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5210. * e.g. wmac_top_reg_seq_hwioreg.h
  5211. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5212. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5213. * A value of 0 will be considered as ignore this config.
  5214. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5215. * e.g. wmac_top_reg_seq_hwioreg.h
  5216. * - b'16:31 - rsvd3 for future use
  5217. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5218. * to source rings. Consumer drops packets if the available
  5219. * words in the ring falls below the configured threshold
  5220. * value.
  5221. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5222. * by host. 1 -> subscribed
  5223. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5224. * by host. 1 -> subscribed
  5225. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5226. * subscribed by host. 1 -> subscribed
  5227. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5228. * selection for the FP PHY ERR status tlv.
  5229. * 0 - wbm2rxdma_buf_source_ring
  5230. * 1 - fw2rxdma_buf_source_ring
  5231. * 2 - sw2rxdma_buf_source_ring
  5232. * 3 - no_buffer_ring
  5233. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5234. * selection for the FP PHY ERR status tlv.
  5235. * 0 - rxdma_release_ring
  5236. * 1 - rxdma2fw_ring
  5237. * 2 - rxdma2sw_ring
  5238. * 3 - rxdma2reo_ring
  5239. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5240. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5241. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5242. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5243. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5244. * 0: MSDU level logging
  5245. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5246. * 0: MSDU level logging
  5247. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5248. * 0: MSDU level logging
  5249. * - b'23 - word_mask_compaction: enable/disable word mask for
  5250. * mpdu/msdu start/end tlvs
  5251. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5252. * manager override
  5253. * - b'25:28 - rbm_override_val: return buffer manager override value
  5254. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5255. * which have to be posted to host from phy.
  5256. * Corresponding to errors defined in
  5257. * phyrx_abort_request_reason enums 0 to 31.
  5258. * Refer to RXPCU register definition header files for the
  5259. * phyrx_abort_request_reason enum definition.
  5260. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5261. * errors which have to be posted to host from phy.
  5262. * Corresponding to errors defined in
  5263. * phyrx_abort_request_reason enums 32 to 63.
  5264. * Refer to RXPCU register definition header files for the
  5265. * phyrx_abort_request_reason enum definition.
  5266. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5267. * applicable if word mask enabled
  5268. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5269. * applicable if word mask enabled
  5270. * - b'19:31 - rsvd7
  5271. * dword15- b'0:16 - rx_msdu_end_word_mask
  5272. * - b'17:31 - rsvd5
  5273. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5274. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5275. * buffer
  5276. * 1: RX_PKT TLV logging at specified offset for the
  5277. * subsequent buffer
  5278. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5279. */
  5280. PREPACK struct htt_rx_ring_selection_cfg_t {
  5281. A_UINT32 msg_type: 8,
  5282. pdev_id: 8,
  5283. ring_id: 8,
  5284. status_swap: 1,
  5285. pkt_swap: 1,
  5286. rx_offsets_valid: 1,
  5287. drop_thresh_valid: 1,
  5288. rx_mon_global_en: 1,
  5289. rsvd1: 3;
  5290. A_UINT32 ring_buffer_size: 16,
  5291. config_length_mgmt:3,
  5292. config_length_ctrl:3,
  5293. config_length_data:3,
  5294. rx_hdr_len: 2,
  5295. rxpcu_filter_enable_flag:1,
  5296. rsvd2: 4;
  5297. A_UINT32 packet_type_enable_flags_0;
  5298. A_UINT32 packet_type_enable_flags_1;
  5299. A_UINT32 packet_type_enable_flags_2;
  5300. A_UINT32 packet_type_enable_flags_3;
  5301. A_UINT32 tlv_filter_in_flags;
  5302. A_UINT32 rx_packet_offset: 16,
  5303. rx_header_offset: 16;
  5304. A_UINT32 rx_mpdu_end_offset: 16,
  5305. rx_mpdu_start_offset: 16;
  5306. A_UINT32 rx_msdu_end_offset: 16,
  5307. rx_msdu_start_offset: 16;
  5308. A_UINT32 rx_attn_offset: 16,
  5309. rsvd3: 16;
  5310. A_UINT32 rx_drop_threshold: 10,
  5311. fp_ndp: 1,
  5312. mo_ndp: 1,
  5313. fp_phy_err: 1,
  5314. fp_phy_err_buf_src: 2,
  5315. fp_phy_err_buf_dest: 2,
  5316. pkt_type_enable_msdu_or_mpdu_logging:3,
  5317. dma_mpdu_mgmt: 1,
  5318. dma_mpdu_ctrl: 1,
  5319. dma_mpdu_data: 1,
  5320. word_mask_compaction_enable:1,
  5321. rbm_override_enable: 1,
  5322. rbm_override_val: 4,
  5323. rsvd4: 3;
  5324. A_UINT32 phy_err_mask;
  5325. A_UINT32 phy_err_mask_cont;
  5326. A_UINT32 rx_mpdu_start_word_mask:16,
  5327. rx_mpdu_end_word_mask: 3,
  5328. rsvd7: 13;
  5329. A_UINT32 rx_msdu_end_word_mask: 17,
  5330. rsvd5: 15;
  5331. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5332. rx_pkt_tlv_offset: 15,
  5333. rsvd6: 16;
  5334. A_UINT32 rx_mpdu_start_word_mask_v2: 20,
  5335. rx_mpdu_end_word_mask_v2: 8,
  5336. rsvd8: 4;
  5337. A_UINT32 rx_msdu_end_word_mask_v2: 20,
  5338. rsvd9: 12;
  5339. A_UINT32 rx_ppdu_end_usr_stats_word_mask_v2: 20,
  5340. rsvd10: 12;
  5341. A_UINT32 packet_type_enable_fpmo_flags0;
  5342. A_UINT32 packet_type_enable_fpmo_flags1;
  5343. } POSTPACK;
  5344. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5345. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5346. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5347. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5348. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5349. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5350. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5351. do { \
  5352. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5353. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5354. } while (0)
  5355. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5356. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5357. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5358. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5359. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5360. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5361. do { \
  5362. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5363. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5364. } while (0)
  5365. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5366. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5367. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5368. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5369. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5370. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5371. do { \
  5372. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5373. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5374. } while (0)
  5375. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5376. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5377. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5378. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5379. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5380. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5381. do { \
  5382. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5383. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5384. } while (0)
  5385. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5386. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5387. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5388. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5389. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5390. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5391. do { \
  5392. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5393. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5394. } while (0)
  5395. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5396. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5397. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5398. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5399. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5400. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5401. do { \
  5402. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5403. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5404. } while (0)
  5405. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5406. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5407. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5408. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5409. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5410. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5411. do { \
  5412. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5413. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5414. } while (0)
  5415. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5416. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5417. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5418. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5419. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5420. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5421. do { \
  5422. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5423. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5424. } while (0)
  5425. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5426. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5427. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5428. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5429. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5430. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5431. do { \
  5432. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5433. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5434. } while (0)
  5435. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5436. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5437. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5438. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5439. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5440. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5441. do { \
  5442. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5443. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5444. } while (0)
  5445. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5446. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5447. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5448. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5449. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5450. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5451. do { \
  5452. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5453. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5454. } while (0)
  5455. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5456. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5457. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5458. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5459. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5460. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5461. do { \
  5462. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5463. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5464. } while(0)
  5465. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M 0x08000000
  5466. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S 27
  5467. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_GET(_var) \
  5468. (((_var) & HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M) >> \
  5469. HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S)
  5470. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_SET(_var, _val) \
  5471. do { \
  5472. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER, _val); \
  5473. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S));\
  5474. } while(0)
  5475. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5476. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5477. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5478. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5479. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5480. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5481. do { \
  5482. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5483. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5484. } while (0)
  5485. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5486. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5487. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5488. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5489. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5490. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5491. do { \
  5492. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5493. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5494. } while (0)
  5495. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5496. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5497. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5498. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5499. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5500. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5501. do { \
  5502. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5503. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5504. } while (0)
  5505. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5506. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5507. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5508. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5509. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5510. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5511. do { \
  5512. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5513. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5514. } while (0)
  5515. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5516. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5517. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5518. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5519. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5520. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5521. do { \
  5522. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5523. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5524. } while (0)
  5525. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5526. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5527. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5528. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5529. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5530. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5531. do { \
  5532. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5533. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5534. } while (0)
  5535. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5536. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5537. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5538. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5539. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5540. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5541. do { \
  5542. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5543. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5544. } while (0)
  5545. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5546. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5547. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5548. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5549. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5550. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5551. do { \
  5552. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5553. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5554. } while (0)
  5555. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5556. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5557. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5558. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5559. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5560. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5561. do { \
  5562. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5563. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5564. } while (0)
  5565. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5566. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5567. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5568. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5569. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5570. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5571. do { \
  5572. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5573. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5574. } while (0)
  5575. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5576. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5577. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5578. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5579. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5580. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5581. do { \
  5582. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5583. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5584. } while (0)
  5585. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5586. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5587. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5588. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5589. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5590. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5591. do { \
  5592. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5593. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5594. } while (0)
  5595. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5596. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5597. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5598. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5599. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5600. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5601. do { \
  5602. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5603. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5604. } while (0)
  5605. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5606. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5607. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5608. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5609. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5610. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5611. do { \
  5612. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5613. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5614. } while (0)
  5615. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5616. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5617. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5618. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5619. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5620. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5621. do { \
  5622. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5623. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5624. } while (0)
  5625. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5626. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5627. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5628. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5629. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5630. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5631. do { \
  5632. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5633. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5634. } while (0)
  5635. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5636. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5637. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5638. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5639. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5640. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5641. do { \
  5642. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5643. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5644. } while (0)
  5645. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5646. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5647. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5648. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5649. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5650. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5651. do { \
  5652. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5653. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5654. } while (0)
  5655. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5656. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5657. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5658. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5659. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5660. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5661. do { \
  5662. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5663. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5664. } while (0)
  5665. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5666. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5667. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5668. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5669. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5670. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5671. do { \
  5672. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5673. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5674. } while (0)
  5675. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5676. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5677. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5678. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5679. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5680. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5681. do { \
  5682. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5683. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5684. } while (0)
  5685. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5686. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5687. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5688. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5689. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5690. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5691. do { \
  5692. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5693. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5694. } while (0)
  5695. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5696. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5697. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5698. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5699. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5700. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5701. do { \
  5702. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5703. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5704. } while (0)
  5705. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5706. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5707. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5708. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5709. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5710. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5711. do { \
  5712. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5713. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5714. } while (0)
  5715. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5716. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5717. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5718. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5719. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5720. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5721. do { \
  5722. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5723. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5724. } while (0)
  5725. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5726. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5727. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5728. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5729. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5730. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5731. do { \
  5732. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5733. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5734. } while (0)
  5735. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5736. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5737. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5738. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5739. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5740. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5741. do { \
  5742. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5743. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5744. } while (0)
  5745. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5746. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5747. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5748. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5749. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5750. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5751. do { \
  5752. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5753. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5754. } while (0)
  5755. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5756. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5757. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5758. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5759. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5760. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5761. do { \
  5762. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5763. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5764. } while (0)
  5765. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5766. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5767. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5768. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5769. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5770. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5771. do { \
  5772. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5773. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5774. } while (0)
  5775. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5776. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5777. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5778. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5779. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5780. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5781. do { \
  5782. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5783. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5784. } while (0)
  5785. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5786. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5787. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5788. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5789. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5790. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5791. do { \
  5792. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5793. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5794. } while (0)
  5795. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M 0x000FFFFF
  5796. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S 0
  5797. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_GET(_var) \
  5798. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M)>> \
  5799. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)
  5800. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_SET(_var, _val) \
  5801. do { \
  5802. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2, _val);\
  5803. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)); \
  5804. } while (0)
  5805. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M 0x0FF00000
  5806. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S 20
  5807. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_GET(_var) \
  5808. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M)>> \
  5809. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)
  5810. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_SET(_var, _val) \
  5811. do { \
  5812. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2, _val);\
  5813. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)); \
  5814. } while (0)
  5815. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M 0x000FFFFF
  5816. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S 0
  5817. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_GET(_var) \
  5818. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M)>> \
  5819. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)
  5820. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_SET(_var, _val) \
  5821. do { \
  5822. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2, _val);\
  5823. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)); \
  5824. } while (0)
  5825. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M 0x000FFFFF
  5826. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S 0
  5827. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_GET(_var) \
  5828. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M)>> \
  5829. HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)
  5830. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_SET(_var, _val) \
  5831. do { \
  5832. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2, _val);\
  5833. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)); \
  5834. } while (0)
  5835. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M 0xFFFFFFFF
  5836. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S 0
  5837. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_GET(_var) \
  5838. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M)>> \
  5839. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)
  5840. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_SET(_var, _val) \
  5841. do { \
  5842. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0, _val); \
  5843. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)); \
  5844. } while (0)
  5845. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M 0xFFFFFFFF
  5846. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S 0
  5847. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_GET(_var) \
  5848. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M)>> \
  5849. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)
  5850. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_SET(_var, _val) \
  5851. do { \
  5852. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1, _val); \
  5853. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)); \
  5854. } while (0)
  5855. /*
  5856. * Subtype based MGMT frames enable bits.
  5857. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5858. */
  5859. /* association request */
  5860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5866. /* association response */
  5867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5873. /* Reassociation request */
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5880. /* Reassociation response */
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5887. /* Probe request */
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5894. /* Probe response */
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5901. /* Timing Advertisement */
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5908. /* Reserved */
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5915. /* Beacon */
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5922. /* ATIM */
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5929. /* Disassociation */
  5930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5936. /* Authentication */
  5937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5943. /* Deauthentication */
  5944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5950. /* Action */
  5951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5957. /* Action No Ack */
  5958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5964. /* Reserved */
  5965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5971. /*
  5972. * Subtype based CTRL frames enable bits.
  5973. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5974. */
  5975. /* Reserved */
  5976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5982. /* Reserved */
  5983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5989. /* Reserved */
  5990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5996. /* Reserved */
  5997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  6000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  6001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  6002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  6003. /* Reserved */
  6004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  6005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  6006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  6007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  6008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  6009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  6010. /* Reserved */
  6011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  6012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  6013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  6014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  6015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  6016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  6017. /* Reserved */
  6018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  6019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  6020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  6021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  6022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  6023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  6024. /* Control Wrapper */
  6025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  6026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  6027. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  6028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  6029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  6030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  6031. /* Block Ack Request */
  6032. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  6033. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  6034. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  6035. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  6036. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  6037. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  6038. /* Block Ack*/
  6039. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  6040. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  6041. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  6042. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  6043. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  6044. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  6045. /* PS-POLL */
  6046. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  6047. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  6048. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  6049. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  6050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  6051. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  6052. /* RTS */
  6053. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  6054. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  6055. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  6056. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  6057. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  6058. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  6059. /* CTS */
  6060. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  6061. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  6062. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  6063. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  6064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  6065. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  6066. /* ACK */
  6067. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  6068. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  6069. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  6070. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  6071. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  6072. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  6073. /* CF-END */
  6074. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  6075. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  6076. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  6077. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  6078. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  6079. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  6080. /* CF-END + CF-ACK */
  6081. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  6082. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  6083. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  6084. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  6085. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  6086. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  6087. /* Multicast data */
  6088. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  6089. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  6090. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  6091. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  6092. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  6093. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  6094. /* Unicast data */
  6095. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  6096. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  6097. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  6098. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  6099. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  6100. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  6101. /* NULL data */
  6102. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  6103. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  6104. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  6105. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  6106. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  6107. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  6108. /* FPMO mode flags */
  6109. /* MGMT */
  6110. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_M 0x00000001
  6111. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_S 0
  6112. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_M 0x00000002
  6113. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_S 1
  6114. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_M 0x00000004
  6115. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_S 2
  6116. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_M 0x00000008
  6117. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_S 3
  6118. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_M 0x00000010
  6119. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_S 4
  6120. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_M 0x00000020
  6121. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_S 5
  6122. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_M 0x00000040
  6123. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_S 6
  6124. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_M 0x00000080
  6125. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_S 7
  6126. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_M 0x00000100
  6127. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_S 8
  6128. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_M 0x00000200
  6129. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_S 9
  6130. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_M 0x00000400
  6131. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_S 10
  6132. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_M 0x00000800
  6133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_S 11
  6134. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_M 0x00001000
  6135. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_S 12
  6136. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_M 0x00002000
  6137. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_S 13
  6138. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_M 0x00004000
  6139. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_S 14
  6140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_M 0x00008000
  6141. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_S 15
  6142. /* CTRL */
  6143. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_M 0x00010000
  6144. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_S 16
  6145. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_M 0x00020000
  6146. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_S 17
  6147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_M 0x00040000
  6148. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_S 18
  6149. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_M 0x00080000
  6150. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_S 19
  6151. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_M 0x00100000
  6152. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_S 20
  6153. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_M 0x00200000
  6154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_S 21
  6155. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_M 0x00400000
  6156. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_S 22
  6157. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_M 0x00800000
  6158. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_S 23
  6159. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_M 0x01000000
  6160. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_S 24
  6161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_M 0x02000000
  6162. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_S 25
  6163. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_M 0x04000000
  6164. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_S 26
  6165. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_M 0x08000000
  6166. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_S 27
  6167. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_M 0x10000000
  6168. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_S 28
  6169. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_M 0x20000000
  6170. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_S 29
  6171. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_M 0x40000000
  6172. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_S 30
  6173. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_M 0x80000000
  6174. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_S 31
  6175. /* DATA */
  6176. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_M 0x00000001
  6177. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_S 0
  6178. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_M 0x00000002
  6179. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_S 1
  6180. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_M 0x00000004
  6181. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_S 2
  6182. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_M 0x00000008
  6183. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_S 3
  6184. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_M 0x00000010
  6185. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_S 4
  6186. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  6187. do { \
  6188. HTT_CHECK_SET_VAL(httsym, value); \
  6189. (word) |= (value) << httsym##_S; \
  6190. } while (0)
  6191. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  6192. (((word) & httsym##_M) >> httsym##_S)
  6193. #define htt_rx_ring_pkt_enable_subtype_set( \
  6194. word, flag, mode, type, subtype, val) \
  6195. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  6196. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  6197. #define htt_rx_ring_pkt_enable_subtype_get( \
  6198. word, flag, mode, type, subtype) \
  6199. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  6200. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  6201. /* Definition to filter in TLVs */
  6202. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  6203. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  6204. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  6205. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  6206. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6207. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6208. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6209. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6210. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6211. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6212. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6213. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6214. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6215. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6216. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6217. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6218. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6219. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6220. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6221. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6222. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6223. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6224. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6225. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6226. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6227. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6228. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6229. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6230. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6231. do { \
  6232. HTT_CHECK_SET_VAL(httsym, enable); \
  6233. (word) |= (enable) << httsym##_S; \
  6234. } while (0)
  6235. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6236. (((word) & httsym##_M) >> httsym##_S)
  6237. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6238. HTT_RX_RING_TLV_ENABLE_SET( \
  6239. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6240. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6241. HTT_RX_RING_TLV_ENABLE_GET( \
  6242. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6243. /**
  6244. * @brief host -> target TX monitor config message
  6245. *
  6246. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6247. *
  6248. * @details
  6249. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6250. * configure RXDMA rings.
  6251. * The configuration is per ring based and includes both packet types
  6252. * and PPDU/MPDU TLVs.
  6253. *
  6254. * The message would appear as follows:
  6255. *
  6256. * |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|
  6257. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6258. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6259. * |-----------+--------+--------+-----+------------------------------------|
  6260. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6261. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6262. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6263. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6264. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6265. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6266. * |------------------------------------------------------------------------|
  6267. * | tlv_filter_mask_in0 |
  6268. * |------------------------------------------------------------------------|
  6269. * | tlv_filter_mask_in1 |
  6270. * |------------------------------------------------------------------------|
  6271. * | tlv_filter_mask_in2 |
  6272. * |------------------------------------------------------------------------|
  6273. * | tlv_filter_mask_in3 |
  6274. * |-----------------+-----------------+---------------------+--------------|
  6275. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6276. * |------------------------------------------------------------------------|
  6277. * | pcu_ppdu_setup_word_mask |
  6278. * |--------------------+--+--+--+-----+---------------------+--------------|
  6279. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6280. * |------------------------------------------------------------------------|
  6281. *
  6282. * Where:
  6283. * PS = pkt_swap
  6284. * SS = status_swap
  6285. * The message is interpreted as follows:
  6286. * dword0 - b'0:7 - msg_type: This will be set to
  6287. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6288. * b'8:15 - pdev_id:
  6289. * 0 (for rings at SOC level),
  6290. * 1/2/3 mac id (for rings at LMAC level)
  6291. * b'16:23 - ring_id : Identify the ring to configure.
  6292. * More details can be got from enum htt_srng_ring_id
  6293. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6294. * BUF_RING_CFG_0 defs within HW .h files,
  6295. * e.g. wmac_top_reg_seq_hwioreg.h
  6296. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6297. * BUF_RING_CFG_0 defs within HW .h files,
  6298. * e.g. wmac_top_reg_seq_hwioreg.h
  6299. * b'26 - tx_mon_global_en: Enable/Disable global register
  6300. * configuration in Tx monitor module.
  6301. * b'27:31 - rsvd1: reserved for future use
  6302. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6303. * in byte units.
  6304. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6305. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6306. * 64, 128, 256.
  6307. * If all 3 bits are set config length is > 256.
  6308. * if val is '0', then ignore this field.
  6309. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6310. * 64, 128, 256.
  6311. * If all 3 bits are set config length is > 256.
  6312. * if val is '0', then ignore this field.
  6313. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6314. * 64, 128, 256.
  6315. * If all 3 bits are set config length is > 256.
  6316. * If val is '0', then ignore this field.
  6317. * - b'25:31 - rsvd2: Reserved for future use
  6318. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6319. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6320. * If packet_type_enable_flags is '1' for MGMT type,
  6321. * monitor will ignore this bit and allow this TLV.
  6322. * If packet_type_enable_flags is '0' for MGMT type,
  6323. * monitor will use this bit to enable/disable logging
  6324. * of this TLV.
  6325. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6326. * If packet_type_enable_flags is '1' for CTRL type,
  6327. * monitor will ignore this bit and allow this TLV.
  6328. * If packet_type_enable_flags is '0' for CTRL type,
  6329. * monitor will use this bit to enable/disable logging
  6330. * of this TLV.
  6331. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6332. * If packet_type_enable_flags is '1' for DATA type,
  6333. * monitor will ignore this bit and allow this TLV.
  6334. * If packet_type_enable_flags is '0' for DATA type,
  6335. * monitor will use this bit to enable/disable logging
  6336. * of this TLV.
  6337. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6338. * If packet_type_enable_flags is '1' for MGMT type,
  6339. * monitor will ignore this bit and allow this TLV.
  6340. * If packet_type_enable_flags is '0' for MGMT type,
  6341. * monitor will use this bit to enable/disable logging
  6342. * of this TLV.
  6343. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6344. * If packet_type_enable_flags is '1' for CTRL type,
  6345. * monitor will ignore this bit and allow this TLV.
  6346. * If packet_type_enable_flags is '0' for CTRL type,
  6347. * monitor will use this bit to enable/disable logging
  6348. * of this TLV.
  6349. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6350. * If packet_type_enable_flags is '1' for DATA type,
  6351. * monitor will ignore this bit and allow this TLV.
  6352. * If packet_type_enable_flags is '0' for DATA type,
  6353. * monitor will use this bit to enable/disable logging
  6354. * of this TLV.
  6355. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6356. * If packet_type_enable_flags is '1' for MGMT type,
  6357. * monitor will ignore this bit and allow this TLV.
  6358. * If packet_type_enable_flags is '0' for MGMT type,
  6359. * monitor will use this bit to enable/disable logging
  6360. * of this TLV.
  6361. * If filter_in_TX_MPDU_START = 1 it is recommended
  6362. * to set this bit.
  6363. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6364. * If packet_type_enable_flags is '1' for CTRL type,
  6365. * monitor will ignore this bit and allow this TLV.
  6366. * If packet_type_enable_flags is '0' for CTRL type,
  6367. * monitor will use this bit to enable/disable logging
  6368. * of this TLV.
  6369. * If filter_in_TX_MPDU_START = 1 it is recommended
  6370. * to set this bit.
  6371. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6372. * If packet_type_enable_flags is '1' for DATA type,
  6373. * monitor will ignore this bit and allow this TLV.
  6374. * If packet_type_enable_flags is '0' for DATA type,
  6375. * monitor will use this bit to enable/disable logging
  6376. * of this TLV.
  6377. * If filter_in_TX_MPDU_START = 1 it is recommended
  6378. * to set this bit.
  6379. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6380. * If packet_type_enable_flags is '1' for MGMT type,
  6381. * monitor will ignore this bit and allow this TLV.
  6382. * If packet_type_enable_flags is '0' for MGMT type,
  6383. * monitor will use this bit to enable/disable logging
  6384. * of this TLV.
  6385. * If filter_in_TX_MSDU_START = 1 it is recommended
  6386. * to set this bit.
  6387. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6388. * If packet_type_enable_flags is '1' for CTRL type,
  6389. * monitor will ignore this bit and allow this TLV.
  6390. * If packet_type_enable_flags is '0' for CTRL type,
  6391. * monitor will use this bit to enable/disable logging
  6392. * of this TLV.
  6393. * If filter_in_TX_MSDU_START = 1 it is recommended
  6394. * to set this bit.
  6395. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6396. * If packet_type_enable_flags is '1' for DATA type,
  6397. * monitor will ignore this bit and allow this TLV.
  6398. * If packet_type_enable_flags is '0' for DATA type,
  6399. * monitor will use this bit to enable/disable logging
  6400. * of this TLV.
  6401. * If filter_in_TX_MSDU_START = 1 it is recommended
  6402. * to set this bit.
  6403. * b'15:31 - rsvd3: Reserved for future use
  6404. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6405. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6406. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6407. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6408. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6409. * - b'8:15 - tx_peer_entry_word_mask:
  6410. * - b'16:23 - tx_queue_ext_word_mask:
  6411. * - b'24:31 - tx_msdu_start_word_mask:
  6412. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6413. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6414. * - b'8:15 - rxpcu_user_setup_word_mask:
  6415. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6416. * MGMT, CTRL, DATA
  6417. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6418. * 0 -> MSDU level logging is enabled
  6419. * (valid only if bit is set in
  6420. * pkt_type_enable_msdu_or_mpdu_logging)
  6421. * 1 -> MPDU level logging is enabled
  6422. * (valid only if bit is set in
  6423. * pkt_type_enable_msdu_or_mpdu_logging)
  6424. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6425. * 0 -> MSDU level logging is enabled
  6426. * (valid only if bit is set in
  6427. * pkt_type_enable_msdu_or_mpdu_logging)
  6428. * 1 -> MPDU level logging is enabled
  6429. * (valid only if bit is set in
  6430. * pkt_type_enable_msdu_or_mpdu_logging)
  6431. * - b'21 - dma_mpdu_data(D) : For DATA
  6432. * 0 -> MSDU level logging is enabled
  6433. * (valid only if bit is set in
  6434. * pkt_type_enable_msdu_or_mpdu_logging)
  6435. * 1 -> MPDU level logging is enabled
  6436. * (valid only if bit is set in
  6437. * pkt_type_enable_msdu_or_mpdu_logging)
  6438. * - b'22:31 - rsvd4 for future use
  6439. */
  6440. PREPACK struct htt_tx_monitor_cfg_t {
  6441. A_UINT32 msg_type: 8,
  6442. pdev_id: 8,
  6443. ring_id: 8,
  6444. status_swap: 1,
  6445. pkt_swap: 1,
  6446. tx_mon_global_en: 1,
  6447. rsvd1: 5;
  6448. A_UINT32 ring_buffer_size: 16,
  6449. config_length_mgmt: 3,
  6450. config_length_ctrl: 3,
  6451. config_length_data: 3,
  6452. rsvd2: 7;
  6453. A_UINT32 pkt_type_enable_flags: 3,
  6454. filter_in_tx_mpdu_start_mgmt: 1,
  6455. filter_in_tx_mpdu_start_ctrl: 1,
  6456. filter_in_tx_mpdu_start_data: 1,
  6457. filter_in_tx_msdu_start_mgmt: 1,
  6458. filter_in_tx_msdu_start_ctrl: 1,
  6459. filter_in_tx_msdu_start_data: 1,
  6460. filter_in_tx_mpdu_end_mgmt: 1,
  6461. filter_in_tx_mpdu_end_ctrl: 1,
  6462. filter_in_tx_mpdu_end_data: 1,
  6463. filter_in_tx_msdu_end_mgmt: 1,
  6464. filter_in_tx_msdu_end_ctrl: 1,
  6465. filter_in_tx_msdu_end_data: 1,
  6466. word_mask_compaction_enable: 1,
  6467. rsvd3: 16;
  6468. A_UINT32 tlv_filter_mask_in0;
  6469. A_UINT32 tlv_filter_mask_in1;
  6470. A_UINT32 tlv_filter_mask_in2;
  6471. A_UINT32 tlv_filter_mask_in3;
  6472. A_UINT32 tx_fes_setup_word_mask: 8,
  6473. tx_peer_entry_word_mask: 8,
  6474. tx_queue_ext_word_mask: 8,
  6475. tx_msdu_start_word_mask: 8;
  6476. A_UINT32 pcu_ppdu_setup_word_mask;
  6477. A_UINT32 tx_mpdu_start_word_mask: 8,
  6478. rxpcu_user_setup_word_mask: 8,
  6479. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6480. dma_mpdu_mgmt: 1,
  6481. dma_mpdu_ctrl: 1,
  6482. dma_mpdu_data: 1,
  6483. rsvd4: 10;
  6484. A_UINT32 tx_queue_ext_v2_word_mask: 12,
  6485. tx_peer_entry_v2_word_mask: 12,
  6486. rsvd5: 10;
  6487. A_UINT32 fes_status_end_word_mask: 16,
  6488. response_end_status_word_mask: 16;
  6489. A_UINT32 fes_status_prot_word_mask: 11,
  6490. rsvd6: 21;
  6491. } POSTPACK;
  6492. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6493. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6494. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6495. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6496. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6497. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6498. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6499. do { \
  6500. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6501. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6502. } while (0)
  6503. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6504. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6505. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6506. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6507. HTT_TX_MONITOR_CFG_RING_ID_S)
  6508. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6509. do { \
  6510. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6511. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6512. } while (0)
  6513. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6514. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6515. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6516. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6517. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6518. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6519. do { \
  6520. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6521. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6522. } while (0)
  6523. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6524. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6525. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6526. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6527. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6528. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6529. do { \
  6530. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6531. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6532. } while (0)
  6533. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6534. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6535. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6536. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6537. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6538. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6539. do { \
  6540. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6541. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6542. } while (0)
  6543. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6544. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6545. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6546. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6547. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6548. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6549. do { \
  6550. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6551. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6552. } while (0)
  6553. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6554. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6555. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6556. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6557. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6558. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6559. do { \
  6560. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6561. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6562. } while (0)
  6563. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6564. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6565. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6566. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6567. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6568. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6569. do { \
  6570. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6571. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6572. } while (0)
  6573. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6574. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6575. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6576. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6577. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6578. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6579. do { \
  6580. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6581. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6582. } while (0)
  6583. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6584. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6585. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6586. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6587. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6588. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6589. do { \
  6590. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6591. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6592. } while (0)
  6593. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6594. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6595. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6596. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6597. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6598. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6599. do { \
  6600. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6601. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6602. } while (0)
  6603. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6604. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6605. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6606. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6607. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6608. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6609. do { \
  6610. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6611. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6612. } while (0)
  6613. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6614. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6615. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6616. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6617. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6618. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6619. do { \
  6620. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6621. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6622. } while (0)
  6623. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6624. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6625. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6626. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6627. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6628. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6629. do { \
  6630. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6631. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6632. } while (0)
  6633. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6634. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6635. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6636. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6637. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6638. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6639. do { \
  6640. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6641. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6642. } while (0)
  6643. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6644. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6645. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6646. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6647. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6648. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6649. do { \
  6650. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6651. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6652. } while (0)
  6653. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6654. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6655. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6656. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6657. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6658. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6659. do { \
  6660. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6661. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6662. } while (0)
  6663. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6664. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6665. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6666. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6667. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6668. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6669. do { \
  6670. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6671. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6672. } while (0)
  6673. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6674. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6675. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6676. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6677. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6678. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6679. do { \
  6680. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6681. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6682. } while (0)
  6683. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6684. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6685. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6686. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6687. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6688. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6689. do { \
  6690. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6691. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6692. } while (0)
  6693. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6694. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6695. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6696. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6697. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6698. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6699. do { \
  6700. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6701. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6702. } while (0)
  6703. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6704. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6705. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6706. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6707. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6708. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6709. do { \
  6710. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6711. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6712. } while (0)
  6713. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00008000
  6714. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S 15
  6715. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  6716. (((_var) & HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  6717. HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  6718. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  6719. do { \
  6720. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  6721. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  6722. } while (0)
  6723. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6724. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6725. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6726. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6727. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6728. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6729. do { \
  6730. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6731. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6732. } while (0)
  6733. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6734. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6735. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6736. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6737. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6738. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6739. do { \
  6740. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6741. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6742. } while (0)
  6743. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6744. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6745. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6746. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6747. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6748. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6749. do { \
  6750. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6751. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6752. } while (0)
  6753. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6754. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6755. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6756. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6757. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6758. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6759. do { \
  6760. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6761. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6762. } while (0)
  6763. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6764. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6765. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6766. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6767. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6768. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6769. do { \
  6770. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6771. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6772. } while (0)
  6773. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6774. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6775. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6776. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6777. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6778. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6779. do { \
  6780. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6781. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6782. } while (0)
  6783. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6784. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6785. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6786. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6787. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6788. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6789. do { \
  6790. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6791. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6792. } while (0)
  6793. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6794. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6795. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6796. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6797. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6798. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6799. do { \
  6800. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6801. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6802. } while (0)
  6803. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6804. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6805. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6806. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6807. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6808. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6809. do { \
  6810. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6811. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6812. } while (0)
  6813. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6814. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6815. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6816. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6817. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6818. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6819. do { \
  6820. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6821. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6822. } while (0)
  6823. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6824. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6825. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6826. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6827. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6828. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6829. do { \
  6830. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6831. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6832. } while (0)
  6833. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6834. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6835. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6836. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6837. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6838. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6839. do { \
  6840. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6841. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6842. } while (0)
  6843. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M 0x00000fff
  6844. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S 0
  6845. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_GET(_var) \
  6846. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M) >> \
  6847. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)
  6848. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_SET(_var, _val) \
  6849. do { \
  6850. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK, _val); \
  6851. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)); \
  6852. } while (0)
  6853. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M 0x00fff000
  6854. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S 12
  6855. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_GET(_var) \
  6856. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M) >> \
  6857. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)
  6858. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_SET(_var, _val) \
  6859. do { \
  6860. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK, _val); \
  6861. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)); \
  6862. } while (0)
  6863. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M 0x0000ffff
  6864. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S 0
  6865. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_GET(_var) \
  6866. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M) >> \
  6867. HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)
  6868. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_SET(_var, _val) \
  6869. do { \
  6870. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK, _val); \
  6871. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)); \
  6872. } while (0)
  6873. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M 0xffff0000
  6874. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S 16
  6875. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_GET(_var) \
  6876. (((_var) & HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M) >> \
  6877. HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)
  6878. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_SET(_var, _val) \
  6879. do { \
  6880. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK, _val); \
  6881. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)); \
  6882. } while (0)
  6883. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M 0x000007ff
  6884. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S 0
  6885. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_GET(_var) \
  6886. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M) >> \
  6887. HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)
  6888. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_SET(_var, _val) \
  6889. do { \
  6890. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK, _val); \
  6891. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)); \
  6892. } while (0)
  6893. /*
  6894. * pkt_type_enable_flags
  6895. */
  6896. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6897. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6898. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6899. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6900. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6901. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6902. /*
  6903. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6904. */
  6905. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6906. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6907. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6908. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6909. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6910. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6911. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6912. do { \
  6913. HTT_CHECK_SET_VAL(httsym, value); \
  6914. (word) |= (value) << httsym##_S; \
  6915. } while (0)
  6916. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6917. (((word) & httsym##_M) >> httsym##_S)
  6918. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6919. * type -> MGMT, CTRL, DATA*/
  6920. #define htt_tx_ring_pkt_type_set( \
  6921. word, mode, type, val) \
  6922. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6923. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6924. #define htt_tx_ring_pkt_type_get( \
  6925. word, mode, type) \
  6926. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6927. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6928. /* Definition to filter in TLVs */
  6929. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6930. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6931. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6932. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6933. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6934. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6935. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6936. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6937. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6938. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6939. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6940. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6941. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6942. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6943. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6944. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6945. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6946. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6947. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6948. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6949. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6950. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6951. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6952. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6953. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6954. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6955. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6956. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6957. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6958. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6959. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6960. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6961. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6962. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6963. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6964. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6965. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6966. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6967. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6968. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6969. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6970. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6971. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6972. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6973. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6974. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6975. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6976. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6977. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6978. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6979. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6980. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6981. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6982. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6983. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6984. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6985. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6986. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6987. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6988. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6989. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6990. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6991. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6992. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6993. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6994. do { \
  6995. HTT_CHECK_SET_VAL(httsym, enable); \
  6996. (word) |= (enable) << httsym##_S; \
  6997. } while (0)
  6998. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6999. (((word) & httsym##_M) >> httsym##_S)
  7000. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  7001. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  7002. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  7003. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  7004. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  7005. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  7006. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  7007. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  7008. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  7009. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  7010. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  7011. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  7012. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  7013. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  7014. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  7015. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  7016. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  7017. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  7018. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  7019. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  7020. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  7021. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  7022. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  7023. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  7024. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  7025. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  7026. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  7027. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  7028. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  7029. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  7030. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  7031. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  7032. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  7033. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  7034. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  7035. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  7036. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  7037. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  7038. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  7039. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  7040. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  7041. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  7042. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  7043. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  7044. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  7045. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  7046. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  7047. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  7048. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  7049. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  7050. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  7051. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  7052. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  7053. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  7054. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  7055. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  7056. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  7057. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  7058. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  7059. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  7060. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  7061. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  7062. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  7063. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  7064. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  7065. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  7066. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  7067. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  7068. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  7069. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  7070. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  7071. do { \
  7072. HTT_CHECK_SET_VAL(httsym, enable); \
  7073. (word) |= (enable) << httsym##_S; \
  7074. } while (0)
  7075. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  7076. (((word) & httsym##_M) >> httsym##_S)
  7077. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  7078. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  7079. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  7080. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  7081. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  7082. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  7083. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  7084. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  7085. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  7086. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  7087. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  7088. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  7089. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  7090. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  7091. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  7092. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  7093. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  7094. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  7095. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  7096. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  7097. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  7098. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  7099. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  7100. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  7101. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  7102. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  7103. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  7104. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  7105. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  7106. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  7107. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  7108. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  7109. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  7110. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  7111. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  7112. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  7113. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  7114. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  7115. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  7116. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  7117. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  7118. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  7119. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  7120. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  7121. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  7122. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  7123. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  7124. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  7125. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  7126. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  7127. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  7128. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  7129. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  7130. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  7131. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  7132. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  7133. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  7134. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  7135. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  7136. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  7137. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  7138. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  7139. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  7140. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  7141. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  7142. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  7143. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  7144. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  7145. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  7146. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  7147. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  7148. do { \
  7149. HTT_CHECK_SET_VAL(httsym, enable); \
  7150. (word) |= (enable) << httsym##_S; \
  7151. } while (0)
  7152. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  7153. (((word) & httsym##_M) >> httsym##_S)
  7154. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  7155. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  7156. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  7157. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  7158. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  7159. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  7160. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  7161. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  7162. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  7163. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  7164. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  7165. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  7166. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  7167. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  7168. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  7169. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  7170. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  7171. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  7172. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  7173. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  7174. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  7175. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  7176. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  7177. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  7178. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  7179. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  7180. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  7181. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  7182. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  7183. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  7184. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  7185. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  7186. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  7187. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  7188. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  7189. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  7190. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  7191. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  7192. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  7193. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  7194. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  7195. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  7196. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  7197. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  7198. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  7199. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  7200. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  7201. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  7202. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  7203. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  7204. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  7205. do { \
  7206. HTT_CHECK_SET_VAL(httsym, enable); \
  7207. (word) |= (enable) << httsym##_S; \
  7208. } while (0)
  7209. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  7210. (((word) & httsym##_M) >> httsym##_S)
  7211. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  7212. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  7213. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  7214. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  7215. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  7216. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  7217. /**
  7218. * @brief host --> target Receive Flow Steering configuration message definition
  7219. *
  7220. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  7221. *
  7222. * host --> target Receive Flow Steering configuration message definition.
  7223. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7224. * The reason for this is we want RFS to be configured and ready before MAC
  7225. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7226. *
  7227. * |31 24|23 16|15 9|8|7 0|
  7228. * |----------------+----------------+----------------+----------------|
  7229. * | reserved |E| msg type |
  7230. * |-------------------------------------------------------------------|
  7231. * Where E = RFS enable flag
  7232. *
  7233. * The RFS_CONFIG message consists of a single 4-byte word.
  7234. *
  7235. * Header fields:
  7236. * - MSG_TYPE
  7237. * Bits 7:0
  7238. * Purpose: identifies this as a RFS config msg
  7239. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  7240. * - RFS_CONFIG
  7241. * Bit 8
  7242. * Purpose: Tells target whether to enable (1) or disable (0)
  7243. * flow steering feature when sending rx indication messages to host
  7244. */
  7245. #define HTT_H2T_RFS_CONFIG_M 0x100
  7246. #define HTT_H2T_RFS_CONFIG_S 8
  7247. #define HTT_RX_RFS_CONFIG_GET(_var) \
  7248. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  7249. HTT_H2T_RFS_CONFIG_S)
  7250. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  7251. do { \
  7252. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  7253. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  7254. } while (0)
  7255. #define HTT_RFS_CFG_REQ_BYTES 4
  7256. /**
  7257. * @brief host -> target FW extended statistics request
  7258. *
  7259. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  7260. *
  7261. * @details
  7262. * The following field definitions describe the format of the HTT host
  7263. * to target FW extended stats retrieve message.
  7264. * The message specifies the type of stats the host wants to retrieve.
  7265. *
  7266. * |31 24|23 16|15 8|7 0|
  7267. * |-----------------------------------------------------------|
  7268. * | reserved | stats type | pdev_mask | msg type |
  7269. * |-----------------------------------------------------------|
  7270. * | config param [0] |
  7271. * |-----------------------------------------------------------|
  7272. * | config param [1] |
  7273. * |-----------------------------------------------------------|
  7274. * | config param [2] |
  7275. * |-----------------------------------------------------------|
  7276. * | config param [3] |
  7277. * |-----------------------------------------------------------|
  7278. * | reserved |
  7279. * |-----------------------------------------------------------|
  7280. * | cookie LSBs |
  7281. * |-----------------------------------------------------------|
  7282. * | cookie MSBs |
  7283. * |-----------------------------------------------------------|
  7284. * Header fields:
  7285. * - MSG_TYPE
  7286. * Bits 7:0
  7287. * Purpose: identifies this is a extended stats upload request message
  7288. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7289. * - PDEV_MASK
  7290. * Bits 8:15
  7291. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7292. * Value: This is a overloaded field, refer to usage and interpretation of
  7293. * PDEV in interface document.
  7294. * Bit 8 : Reserved for SOC stats
  7295. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7296. * Indicates MACID_MASK in DBS
  7297. * - STATS_TYPE
  7298. * Bits 23:16
  7299. * Purpose: identifies which FW statistics to upload
  7300. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7301. * - Reserved
  7302. * Bits 31:24
  7303. * - CONFIG_PARAM [0]
  7304. * Bits 31:0
  7305. * Purpose: give an opaque configuration value to the specified stats type
  7306. * Value: stats-type specific configuration value
  7307. * Refer to htt_stats.h for interpretation for each stats sub_type
  7308. * - CONFIG_PARAM [1]
  7309. * Bits 31:0
  7310. * Purpose: give an opaque configuration value to the specified stats type
  7311. * Value: stats-type specific configuration value
  7312. * Refer to htt_stats.h for interpretation for each stats sub_type
  7313. * - CONFIG_PARAM [2]
  7314. * Bits 31:0
  7315. * Purpose: give an opaque configuration value to the specified stats type
  7316. * Value: stats-type specific configuration value
  7317. * Refer to htt_stats.h for interpretation for each stats sub_type
  7318. * - CONFIG_PARAM [3]
  7319. * Bits 31:0
  7320. * Purpose: give an opaque configuration value to the specified stats type
  7321. * Value: stats-type specific configuration value
  7322. * Refer to htt_stats.h for interpretation for each stats sub_type
  7323. * - Reserved [31:0] for future use.
  7324. * - COOKIE_LSBS
  7325. * Bits 31:0
  7326. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7327. * message with its preceding host->target stats request message.
  7328. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7329. * - COOKIE_MSBS
  7330. * Bits 31:0
  7331. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7332. * message with its preceding host->target stats request message.
  7333. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7334. */
  7335. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7336. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7337. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7338. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7339. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7340. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7341. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7342. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7343. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7344. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7345. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7346. do { \
  7347. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7348. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7349. } while (0)
  7350. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7351. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7352. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7353. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7354. do { \
  7355. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7356. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7357. } while (0)
  7358. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7359. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7360. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7361. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7362. do { \
  7363. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7364. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7365. } while (0)
  7366. /**
  7367. * @brief host -> target FW streaming statistics request
  7368. *
  7369. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7370. *
  7371. * @details
  7372. * The following field definitions describe the format of the HTT host
  7373. * to target message that requests the target to start or stop producing
  7374. * ongoing stats of the specified type.
  7375. *
  7376. * |31|30 |23 16|15 8|7 0|
  7377. * |-----------------------------------------------------------|
  7378. * |EN| reserved | stats type | reserved | msg type |
  7379. * |-----------------------------------------------------------|
  7380. * | config param [0] |
  7381. * |-----------------------------------------------------------|
  7382. * | config param [1] |
  7383. * |-----------------------------------------------------------|
  7384. * | config param [2] |
  7385. * |-----------------------------------------------------------|
  7386. * | config param [3] |
  7387. * |-----------------------------------------------------------|
  7388. * Where:
  7389. * - EN is an enable/disable flag
  7390. * Header fields:
  7391. * - MSG_TYPE
  7392. * Bits 7:0
  7393. * Purpose: identifies this is a streaming stats upload request message
  7394. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7395. * - STATS_TYPE
  7396. * Bits 23:16
  7397. * Purpose: identifies which FW statistics to upload
  7398. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7399. * Only the htt_dbg_ext_stats_type values identified as streaming
  7400. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7401. * - ENABLE
  7402. * Bit 31
  7403. * Purpose: enable/disable the target's ongoing stats of the specified type
  7404. * Value:
  7405. * 0 - disable ongoing production of the specified stats type
  7406. * 1 - enable ongoing production of the specified stats type
  7407. * - CONFIG_PARAM [0]
  7408. * Bits 31:0
  7409. * Purpose: give an opaque configuration value to the specified stats type
  7410. * Value: stats-type specific configuration value
  7411. * Refer to htt_stats.h for interpretation for each stats sub_type
  7412. * - CONFIG_PARAM [1]
  7413. * Bits 31:0
  7414. * Purpose: give an opaque configuration value to the specified stats type
  7415. * Value: stats-type specific configuration value
  7416. * Refer to htt_stats.h for interpretation for each stats sub_type
  7417. * - CONFIG_PARAM [2]
  7418. * Bits 31:0
  7419. * Purpose: give an opaque configuration value to the specified stats type
  7420. * Value: stats-type specific configuration value
  7421. * Refer to htt_stats.h for interpretation for each stats sub_type
  7422. * - CONFIG_PARAM [3]
  7423. * Bits 31:0
  7424. * Purpose: give an opaque configuration value to the specified stats type
  7425. * Value: stats-type specific configuration value
  7426. * Refer to htt_stats.h for interpretation for each stats sub_type
  7427. */
  7428. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7429. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7430. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7431. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7432. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7433. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7434. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7435. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7436. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7437. do { \
  7438. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7439. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7440. } while (0)
  7441. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7442. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7443. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7444. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7445. do { \
  7446. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7447. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7448. } while (0)
  7449. /**
  7450. * @brief host -> target FW PPDU_STATS request message
  7451. *
  7452. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7453. *
  7454. * @details
  7455. * The following field definitions describe the format of the HTT host
  7456. * to target FW for PPDU_STATS_CFG msg.
  7457. * The message allows the host to configure the PPDU_STATS_IND messages
  7458. * produced by the target.
  7459. *
  7460. * |31 24|23 16|15 8|7 0|
  7461. * |-----------------------------------------------------------|
  7462. * | REQ bit mask | pdev_mask | msg type |
  7463. * |-----------------------------------------------------------|
  7464. * Header fields:
  7465. * - MSG_TYPE
  7466. * Bits 7:0
  7467. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7468. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7469. * - PDEV_MASK
  7470. * Bits 8:15
  7471. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7472. * Value: This is a overloaded field, refer to usage and interpretation of
  7473. * PDEV in interface document.
  7474. * Bit 8 : Reserved for SOC stats
  7475. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7476. * Indicates MACID_MASK in DBS
  7477. * - REQ_TLV_BIT_MASK
  7478. * Bits 16:31
  7479. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7480. * needs to be included in the target's PPDU_STATS_IND messages.
  7481. * Value: refer htt_ppdu_stats_tlv_tag_t
  7482. *
  7483. */
  7484. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7485. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7486. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7487. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7488. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7489. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7490. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7491. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7492. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7493. do { \
  7494. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7495. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7496. } while (0)
  7497. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7498. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7499. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7500. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7501. do { \
  7502. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7503. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7504. } while (0)
  7505. /**
  7506. * @brief Host-->target HTT RX FSE setup message
  7507. *
  7508. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7509. *
  7510. * @details
  7511. * Through this message, the host will provide details of the flow tables
  7512. * in host DDR along with hash keys.
  7513. * This message can be sent per SOC or per PDEV, which is differentiated
  7514. * by pdev id values.
  7515. * The host will allocate flow search table and sends table size,
  7516. * physical DMA address of flow table, and hash keys to firmware to
  7517. * program into the RXOLE FSE HW block.
  7518. *
  7519. * The following field definitions describe the format of the RX FSE setup
  7520. * message sent from the host to target
  7521. *
  7522. * Header fields:
  7523. * dword0 - b'7:0 - msg_type: This will be set to
  7524. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7525. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7526. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7527. * pdev's LMAC ring.
  7528. * b'31:16 - reserved : Reserved for future use
  7529. * dword1 - b'19:0 - number of records: This field indicates the number of
  7530. * entries in the flow table. For example: 8k number of
  7531. * records is equivalent to
  7532. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7533. * b'27:20 - max search: This field specifies the skid length to FSE
  7534. * parser HW module whenever match is not found at the
  7535. * exact index pointed by hash.
  7536. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7537. * Refer htt_ip_da_sa_prefix below for more details.
  7538. * b'31:30 - reserved: Reserved for future use
  7539. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7540. * table allocated by host in DDR
  7541. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7542. * table allocated by host in DDR
  7543. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7544. * entry hashing
  7545. *
  7546. *
  7547. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7548. * |---------------------------------------------------------------|
  7549. * | reserved | pdev_id | MSG_TYPE |
  7550. * |---------------------------------------------------------------|
  7551. * |resvd|IPDSA| max_search | Number of records |
  7552. * |---------------------------------------------------------------|
  7553. * | base address lo |
  7554. * |---------------------------------------------------------------|
  7555. * | base address high |
  7556. * |---------------------------------------------------------------|
  7557. * | toeplitz key 31_0 |
  7558. * |---------------------------------------------------------------|
  7559. * | toeplitz key 63_32 |
  7560. * |---------------------------------------------------------------|
  7561. * | toeplitz key 95_64 |
  7562. * |---------------------------------------------------------------|
  7563. * | toeplitz key 127_96 |
  7564. * |---------------------------------------------------------------|
  7565. * | toeplitz key 159_128 |
  7566. * |---------------------------------------------------------------|
  7567. * | toeplitz key 191_160 |
  7568. * |---------------------------------------------------------------|
  7569. * | toeplitz key 223_192 |
  7570. * |---------------------------------------------------------------|
  7571. * | toeplitz key 255_224 |
  7572. * |---------------------------------------------------------------|
  7573. * | toeplitz key 287_256 |
  7574. * |---------------------------------------------------------------|
  7575. * | reserved | toeplitz key 314_288(26:0 bits) |
  7576. * |---------------------------------------------------------------|
  7577. * where:
  7578. * IPDSA = ip_da_sa
  7579. */
  7580. /**
  7581. * @brief: htt_ip_da_sa_prefix
  7582. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7583. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7584. * documentation per RFC3849
  7585. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7586. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7587. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7588. */
  7589. enum htt_ip_da_sa_prefix {
  7590. HTT_RX_IPV6_20010db8,
  7591. HTT_RX_IPV4_MAPPED_IPV6,
  7592. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7593. HTT_RX_IPV6_64FF9B,
  7594. };
  7595. /**
  7596. * @brief Host-->target HTT RX FISA configure and enable
  7597. *
  7598. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7599. *
  7600. * @details
  7601. * The host will send this command down to configure and enable the FISA
  7602. * operational params.
  7603. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7604. * register.
  7605. * Should configure both the MACs.
  7606. *
  7607. * dword0 - b'7:0 - msg_type:
  7608. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7609. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7610. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7611. * pdev's LMAC ring.
  7612. * b'31:16 - reserved : Reserved for future use
  7613. *
  7614. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7615. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7616. * packets. 1 flow search will be skipped
  7617. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7618. * tcp,udp packets
  7619. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7620. * calculation
  7621. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7622. * calculation
  7623. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7624. * calculation
  7625. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7626. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7627. * length
  7628. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7629. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7630. * length
  7631. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7632. * num jump
  7633. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7634. * num jump
  7635. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7636. * data type switch has happened for MPDU Sequence num jump
  7637. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7638. * for MPDU Sequence num jump
  7639. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7640. * for decrypt errors
  7641. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7642. * while aggregating a msdu
  7643. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7644. * The aggregation is done until (number of MSDUs aggregated
  7645. * < LIMIT + 1)
  7646. * b'31:18 - Reserved
  7647. *
  7648. * fisa_control_value - 32bit value FW can write to register
  7649. *
  7650. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7651. * Threshold value for FISA timeout (units are microseconds).
  7652. * When the global timestamp exceeds this threshold, FISA
  7653. * aggregation will be restarted.
  7654. * A value of 0 means timeout is disabled.
  7655. * Compare the threshold register with timestamp field in
  7656. * flow entry to generate timeout for the flow.
  7657. *
  7658. * |31 18 |17 16|15 8|7 0|
  7659. * |-------------------------------------------------------------|
  7660. * | reserved | pdev_mask | msg type |
  7661. * |-------------------------------------------------------------|
  7662. * | reserved | FISA_CTRL |
  7663. * |-------------------------------------------------------------|
  7664. * | FISA_TIMEOUT_THRESH |
  7665. * |-------------------------------------------------------------|
  7666. */
  7667. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7668. A_UINT32 msg_type:8,
  7669. pdev_id:8,
  7670. reserved0:16;
  7671. /**
  7672. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7673. * [17:0]
  7674. */
  7675. union {
  7676. /*
  7677. * fisa_control_bits structure is deprecated.
  7678. * Please use fisa_control_bits_v2 going forward.
  7679. */
  7680. struct {
  7681. A_UINT32 fisa_enable: 1,
  7682. ipsec_skip_search: 1,
  7683. nontcp_skip_search: 1,
  7684. add_ipv4_fixed_hdr_len: 1,
  7685. add_ipv6_fixed_hdr_len: 1,
  7686. add_tcp_fixed_hdr_len: 1,
  7687. add_udp_hdr_len: 1,
  7688. chksum_cum_ip_len_en: 1,
  7689. disable_tid_check: 1,
  7690. disable_ta_check: 1,
  7691. disable_qos_check: 1,
  7692. disable_raw_check: 1,
  7693. disable_decrypt_err_check: 1,
  7694. disable_msdu_drop_check: 1,
  7695. fisa_aggr_limit: 4,
  7696. reserved: 14;
  7697. } fisa_control_bits;
  7698. struct {
  7699. A_UINT32 fisa_enable: 1,
  7700. fisa_aggr_limit: 4,
  7701. reserved: 27;
  7702. } fisa_control_bits_v2;
  7703. A_UINT32 fisa_control_value;
  7704. } u_fisa_control;
  7705. /**
  7706. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7707. * timeout threshold for aggregation. Unit in usec.
  7708. * [31:0]
  7709. */
  7710. A_UINT32 fisa_timeout_threshold;
  7711. } POSTPACK;
  7712. /* DWord 0: pdev-ID */
  7713. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7714. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7715. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7716. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7717. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7718. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7719. do { \
  7720. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7721. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7722. } while (0)
  7723. /* Dword 1: fisa_control_value fisa config */
  7724. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7725. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7726. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7727. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7728. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7729. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7730. do { \
  7731. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7732. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7733. } while (0)
  7734. /* Dword 1: fisa_control_value ipsec_skip_search */
  7735. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7736. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7737. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7738. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7739. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7740. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7741. do { \
  7742. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7743. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7744. } while (0)
  7745. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7746. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7747. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7748. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7749. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7750. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7751. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7752. do { \
  7753. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7754. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7755. } while (0)
  7756. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7757. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7758. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7759. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7760. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7761. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7762. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7763. do { \
  7764. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7765. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7766. } while (0)
  7767. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7768. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7769. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7770. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7771. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7772. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7773. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7774. do { \
  7775. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7776. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7777. } while (0)
  7778. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7779. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7780. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7781. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7782. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7783. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7784. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7785. do { \
  7786. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7787. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7788. } while (0)
  7789. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7790. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7791. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7792. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7793. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7794. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7795. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7796. do { \
  7797. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7798. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7799. } while (0)
  7800. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7801. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7802. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7803. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7804. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7805. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7806. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7807. do { \
  7808. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7809. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7810. } while (0)
  7811. /* Dword 1: fisa_control_value disable_tid_check */
  7812. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7813. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7814. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7815. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7816. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7817. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7818. do { \
  7819. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7820. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7821. } while (0)
  7822. /* Dword 1: fisa_control_value disable_ta_check */
  7823. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7824. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7825. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7826. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7827. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7828. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7829. do { \
  7830. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7831. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7832. } while (0)
  7833. /* Dword 1: fisa_control_value disable_qos_check */
  7834. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7835. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7836. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7837. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7838. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7839. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7840. do { \
  7841. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7842. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7843. } while (0)
  7844. /* Dword 1: fisa_control_value disable_raw_check */
  7845. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7846. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7847. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7848. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7849. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7850. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7851. do { \
  7852. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7853. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7854. } while (0)
  7855. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7856. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7857. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7858. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7859. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7860. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7861. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7862. do { \
  7863. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7864. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7865. } while (0)
  7866. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7867. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7868. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7869. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7870. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7871. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7872. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7873. do { \
  7874. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7875. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7876. } while (0)
  7877. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7878. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7879. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7880. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7881. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7882. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7883. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7884. do { \
  7885. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7886. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7887. } while (0)
  7888. /* Dword 1: fisa_control_value fisa config */
  7889. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7890. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7891. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7892. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7893. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7894. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7895. do { \
  7896. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7897. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7898. } while (0)
  7899. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7900. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7901. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7902. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7903. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7904. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7905. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7906. do { \
  7907. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7908. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7909. } while (0)
  7910. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7911. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7912. pdev_id:8,
  7913. reserved0:16;
  7914. A_UINT32 num_records:20,
  7915. max_search:8,
  7916. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7917. reserved1:2;
  7918. A_UINT32 base_addr_lo;
  7919. A_UINT32 base_addr_hi;
  7920. A_UINT32 toeplitz31_0;
  7921. A_UINT32 toeplitz63_32;
  7922. A_UINT32 toeplitz95_64;
  7923. A_UINT32 toeplitz127_96;
  7924. A_UINT32 toeplitz159_128;
  7925. A_UINT32 toeplitz191_160;
  7926. A_UINT32 toeplitz223_192;
  7927. A_UINT32 toeplitz255_224;
  7928. A_UINT32 toeplitz287_256;
  7929. A_UINT32 toeplitz314_288:27,
  7930. reserved2:5;
  7931. } POSTPACK;
  7932. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7933. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7934. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7935. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7936. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7937. /* DWORD 0: Pdev ID */
  7938. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7939. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7940. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7941. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7942. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7943. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7944. do { \
  7945. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7946. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7947. } while (0)
  7948. /* DWORD 1:num of records */
  7949. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7950. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7951. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7952. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7953. HTT_RX_FSE_SETUP_NUM_REC_S)
  7954. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7955. do { \
  7956. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7957. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7958. } while (0)
  7959. /* DWORD 1:max_search */
  7960. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7961. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7962. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7963. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7964. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7965. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7966. do { \
  7967. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7968. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7969. } while (0)
  7970. /* DWORD 1:ip_da_sa prefix */
  7971. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7972. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7973. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7974. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7975. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7976. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7977. do { \
  7978. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7979. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7980. } while (0)
  7981. /* DWORD 2: Base Address LO */
  7982. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7983. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7984. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7985. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7986. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7987. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7988. do { \
  7989. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7990. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7991. } while (0)
  7992. /* DWORD 3: Base Address High */
  7993. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7994. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7995. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7996. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7997. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7998. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7999. do { \
  8000. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  8001. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  8002. } while (0)
  8003. /* DWORD 4-12: Hash Value */
  8004. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  8005. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  8006. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  8007. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  8008. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  8009. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  8010. do { \
  8011. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  8012. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  8013. } while (0)
  8014. /* DWORD 13: Hash Value 314:288 bits */
  8015. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  8016. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  8017. HTT_RX_FSE_SETUP_HASH_314_288_S)
  8018. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  8019. do { \
  8020. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  8021. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  8022. } while (0)
  8023. /**
  8024. * @brief Host-->target HTT RX FSE operation message
  8025. *
  8026. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  8027. *
  8028. * @details
  8029. * The host will send this Flow Search Engine (FSE) operation message for
  8030. * every flow add/delete operation.
  8031. * The FSE operation includes FSE full cache invalidation or individual entry
  8032. * invalidation.
  8033. * This message can be sent per SOC or per PDEV which is differentiated
  8034. * by pdev id values.
  8035. *
  8036. * |31 16|15 8|7 1|0|
  8037. * |-------------------------------------------------------------|
  8038. * | reserved | pdev_id | MSG_TYPE |
  8039. * |-------------------------------------------------------------|
  8040. * | reserved | operation |I|
  8041. * |-------------------------------------------------------------|
  8042. * | ip_src_addr_31_0 |
  8043. * |-------------------------------------------------------------|
  8044. * | ip_src_addr_63_32 |
  8045. * |-------------------------------------------------------------|
  8046. * | ip_src_addr_95_64 |
  8047. * |-------------------------------------------------------------|
  8048. * | ip_src_addr_127_96 |
  8049. * |-------------------------------------------------------------|
  8050. * | ip_dst_addr_31_0 |
  8051. * |-------------------------------------------------------------|
  8052. * | ip_dst_addr_63_32 |
  8053. * |-------------------------------------------------------------|
  8054. * | ip_dst_addr_95_64 |
  8055. * |-------------------------------------------------------------|
  8056. * | ip_dst_addr_127_96 |
  8057. * |-------------------------------------------------------------|
  8058. * | l4_dst_port | l4_src_port |
  8059. * | (32-bit SPI incase of IPsec) |
  8060. * |-------------------------------------------------------------|
  8061. * | reserved | l4_proto |
  8062. * |-------------------------------------------------------------|
  8063. *
  8064. * where I is 1-bit ipsec_valid.
  8065. *
  8066. * The following field definitions describe the format of the RX FSE operation
  8067. * message sent from the host to target for every add/delete flow entry to flow
  8068. * table.
  8069. *
  8070. * Header fields:
  8071. * dword0 - b'7:0 - msg_type: This will be set to
  8072. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  8073. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8074. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8075. * specified pdev's LMAC ring.
  8076. * b'31:16 - reserved : Reserved for future use
  8077. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  8078. * (Internet Protocol Security).
  8079. * IPsec describes the framework for providing security at
  8080. * IP layer. IPsec is defined for both versions of IP:
  8081. * IPV4 and IPV6.
  8082. * Please refer to htt_rx_flow_proto enumeration below for
  8083. * more info.
  8084. * ipsec_valid = 1 for IPSEC packets
  8085. * ipsec_valid = 0 for IP Packets
  8086. * b'7:1 - operation: This indicates types of FSE operation.
  8087. * Refer to htt_rx_fse_operation enumeration:
  8088. * 0 - No Cache Invalidation required
  8089. * 1 - Cache invalidate only one entry given by IP
  8090. * src/dest address at DWORD[2:9]
  8091. * 2 - Complete FSE Cache Invalidation
  8092. * 3 - FSE Disable
  8093. * 4 - FSE Enable
  8094. * b'31:8 - reserved: Reserved for future use
  8095. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  8096. * for per flow addition/deletion
  8097. * For IPV4 src/dest addresses, the first A_UINT32 is used
  8098. * and the subsequent 3 A_UINT32 will be padding bytes.
  8099. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  8100. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  8101. * from 0 to 65535 but only 0 to 1023 are designated as
  8102. * well-known ports. Refer to [RFC1700] for more details.
  8103. * This field is valid only if
  8104. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  8105. * - L4 dest port (31:16): 16-bit Destination Port numbers
  8106. * range from 0 to 65535 but only 0 to 1023 are designated
  8107. * as well-known ports. Refer to [RFC1700] for more details.
  8108. * This field is valid only if
  8109. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  8110. * - SPI (31:0): Security Parameters Index is an
  8111. * identification tag added to the header while using IPsec
  8112. * for tunneling the IP traffici.
  8113. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  8114. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  8115. * Assigned Internet Protocol Numbers.
  8116. * l4_proto numbers for standard protocol like UDP/TCP
  8117. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  8118. * l4_proto = 17 for UDP etc.
  8119. * b'31:8 - reserved: Reserved for future use.
  8120. *
  8121. */
  8122. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  8123. A_UINT32 msg_type:8,
  8124. pdev_id:8,
  8125. reserved0:16;
  8126. A_UINT32 ipsec_valid:1,
  8127. operation:7,
  8128. reserved1:24;
  8129. A_UINT32 ip_src_addr_31_0;
  8130. A_UINT32 ip_src_addr_63_32;
  8131. A_UINT32 ip_src_addr_95_64;
  8132. A_UINT32 ip_src_addr_127_96;
  8133. A_UINT32 ip_dest_addr_31_0;
  8134. A_UINT32 ip_dest_addr_63_32;
  8135. A_UINT32 ip_dest_addr_95_64;
  8136. A_UINT32 ip_dest_addr_127_96;
  8137. union {
  8138. A_UINT32 spi;
  8139. struct {
  8140. A_UINT32 l4_src_port:16,
  8141. l4_dest_port:16;
  8142. } ip;
  8143. } u;
  8144. A_UINT32 l4_proto:8,
  8145. reserved:24;
  8146. } POSTPACK;
  8147. /**
  8148. * @brief Host-->target HTT RX Full monitor mode register configuration message
  8149. *
  8150. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  8151. *
  8152. * @details
  8153. * The host will send this Full monitor mode register configuration message.
  8154. * This message can be sent per SOC or per PDEV which is differentiated
  8155. * by pdev id values.
  8156. *
  8157. * |31 16|15 11|10 8|7 3|2|1|0|
  8158. * |-------------------------------------------------------------|
  8159. * | reserved | pdev_id | MSG_TYPE |
  8160. * |-------------------------------------------------------------|
  8161. * | reserved |Release Ring |N|Z|E|
  8162. * |-------------------------------------------------------------|
  8163. *
  8164. * where E is 1-bit full monitor mode enable/disable.
  8165. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  8166. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  8167. *
  8168. * The following field definitions describe the format of the full monitor
  8169. * mode configuration message sent from the host to target for each pdev.
  8170. *
  8171. * Header fields:
  8172. * dword0 - b'7:0 - msg_type: This will be set to
  8173. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  8174. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8175. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8176. * specified pdev's LMAC ring.
  8177. * b'31:16 - reserved : Reserved for future use.
  8178. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  8179. * monitor mode rxdma register is to be enabled or disabled.
  8180. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  8181. * additional descriptors at ppdu end for zero mpdus
  8182. * enabled or disabled.
  8183. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  8184. * additional descriptors at ppdu end for non zero mpdus
  8185. * enabled or disabled.
  8186. * b'10:3 - release_ring: This indicates the destination ring
  8187. * selection for the descriptor at the end of PPDU
  8188. * 0 - REO ring select
  8189. * 1 - FW ring select
  8190. * 2 - SW ring select
  8191. * 3 - Release ring select
  8192. * Refer to htt_rx_full_mon_release_ring.
  8193. * b'31:11 - reserved for future use
  8194. */
  8195. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  8196. A_UINT32 msg_type:8,
  8197. pdev_id:8,
  8198. reserved0:16;
  8199. A_UINT32 full_monitor_mode_enable:1,
  8200. addnl_descs_zero_mpdus_end:1,
  8201. addnl_descs_non_zero_mpdus_end:1,
  8202. release_ring:8,
  8203. reserved1:21;
  8204. } POSTPACK;
  8205. /**
  8206. * Enumeration for full monitor mode destination ring select
  8207. * 0 - REO destination ring select
  8208. * 1 - FW destination ring select
  8209. * 2 - SW destination ring select
  8210. * 3 - Release destination ring select
  8211. */
  8212. enum htt_rx_full_mon_release_ring {
  8213. HTT_RX_MON_RING_REO,
  8214. HTT_RX_MON_RING_FW,
  8215. HTT_RX_MON_RING_SW,
  8216. HTT_RX_MON_RING_RELEASE,
  8217. };
  8218. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  8219. /* DWORD 0: Pdev ID */
  8220. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  8221. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  8222. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  8223. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  8224. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  8225. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  8226. do { \
  8227. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  8228. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  8229. } while (0)
  8230. /* DWORD 1:ENABLE */
  8231. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  8232. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  8233. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  8234. do { \
  8235. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  8236. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  8237. } while (0)
  8238. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  8239. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  8240. /* DWORD 1:ZERO_MPDU */
  8241. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  8242. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  8243. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  8244. do { \
  8245. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  8246. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  8247. } while (0)
  8248. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  8249. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  8250. /* DWORD 1:NON_ZERO_MPDU */
  8251. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  8252. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  8253. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  8254. do { \
  8255. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  8256. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  8257. } while (0)
  8258. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  8259. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  8260. /* DWORD 1:RELEASE_RINGS */
  8261. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  8262. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  8263. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  8264. do { \
  8265. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  8266. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  8267. } while (0)
  8268. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  8269. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  8270. /**
  8271. * Enumeration for IP Protocol or IPSEC Protocol
  8272. * IPsec describes the framework for providing security at IP layer.
  8273. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  8274. */
  8275. enum htt_rx_flow_proto {
  8276. HTT_RX_FLOW_IP_PROTO,
  8277. HTT_RX_FLOW_IPSEC_PROTO,
  8278. };
  8279. /**
  8280. * Enumeration for FSE Cache Invalidation
  8281. * 0 - No Cache Invalidation required
  8282. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8283. * 2 - Complete FSE Cache Invalidation
  8284. * 3 - FSE Disable
  8285. * 4 - FSE Enable
  8286. */
  8287. enum htt_rx_fse_operation {
  8288. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8289. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8290. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8291. HTT_RX_FSE_DISABLE,
  8292. HTT_RX_FSE_ENABLE,
  8293. };
  8294. /* DWORD 0: Pdev ID */
  8295. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8296. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8297. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8298. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8299. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8300. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8301. do { \
  8302. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8303. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8304. } while (0)
  8305. /* DWORD 1:IP PROTO or IPSEC */
  8306. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8307. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8308. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8309. do { \
  8310. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8311. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8312. } while (0)
  8313. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8314. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8315. /* DWORD 1:FSE Operation */
  8316. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8317. #define HTT_RX_FSE_OPERATION_S 1
  8318. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8319. do { \
  8320. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8321. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8322. } while (0)
  8323. #define HTT_RX_FSE_OPERATION_GET(word) \
  8324. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8325. /* DWORD 2-9:IP Address */
  8326. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8327. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8328. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8329. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8330. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8331. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8332. do { \
  8333. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8334. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8335. } while (0)
  8336. /* DWORD 10:Source Port Number */
  8337. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8338. #define HTT_RX_FSE_SOURCEPORT_S 0
  8339. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8340. do { \
  8341. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8342. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8343. } while (0)
  8344. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8345. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8346. /* DWORD 11:Destination Port Number */
  8347. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8348. #define HTT_RX_FSE_DESTPORT_S 16
  8349. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8350. do { \
  8351. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8352. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8353. } while (0)
  8354. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8355. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8356. /* DWORD 10-11:SPI (In case of IPSEC) */
  8357. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8358. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8359. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8360. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8361. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8362. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8363. do { \
  8364. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8365. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8366. } while (0)
  8367. /* DWORD 12:L4 PROTO */
  8368. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8369. #define HTT_RX_FSE_L4_PROTO_S 0
  8370. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8371. do { \
  8372. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8373. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8374. } while (0)
  8375. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8376. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8377. /**
  8378. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8379. *
  8380. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8381. *
  8382. * |31 24|23 |15 8|7 2|1|0|
  8383. * |----------------+----------------+----------------+----------------|
  8384. * | reserved | pdev_id | msg_type |
  8385. * |---------------------------------+----------------+----------------|
  8386. * | reserved |E|F|
  8387. * |---------------------------------+----------------+----------------|
  8388. * Where E = Configure the target to provide the 3-tuple hash value in
  8389. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8390. * F = Configure the target to provide the 3-tuple hash value in
  8391. * flow_id_toeplitz field of rx_msdu_start tlv
  8392. *
  8393. * The following field definitions describe the format of the 3 tuple hash value
  8394. * message sent from the host to target as part of initialization sequence.
  8395. *
  8396. * Header fields:
  8397. * dword0 - b'7:0 - msg_type: This will be set to
  8398. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8399. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8400. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8401. * specified pdev's LMAC ring.
  8402. * b'31:16 - reserved : Reserved for future use
  8403. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8404. * b'1 - toeplitz_hash_2_or_4_field_enable
  8405. * b'31:2 - reserved : Reserved for future use
  8406. * ---------+------+----------------------------------------------------------
  8407. * bit1 | bit0 | Functionality
  8408. * ---------+------+----------------------------------------------------------
  8409. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8410. * | | in flow_id_toeplitz field
  8411. * ---------+------+----------------------------------------------------------
  8412. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8413. * | | in toeplitz_hash_2_or_4 field
  8414. * ---------+------+----------------------------------------------------------
  8415. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8416. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8417. * ---------+------+----------------------------------------------------------
  8418. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8419. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8420. * | | toeplitz_hash_2_or_4 field
  8421. *----------------------------------------------------------------------------
  8422. */
  8423. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8424. A_UINT32 msg_type :8,
  8425. pdev_id :8,
  8426. reserved0 :16;
  8427. A_UINT32 flow_id_toeplitz_field_enable :1,
  8428. toeplitz_hash_2_or_4_field_enable :1,
  8429. reserved1 :30;
  8430. } POSTPACK;
  8431. /* DWORD0 : pdev_id configuration Macros */
  8432. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8433. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8434. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8435. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8436. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8437. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8438. do { \
  8439. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8440. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8441. } while (0)
  8442. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8443. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8444. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8445. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8446. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8447. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8448. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8449. do { \
  8450. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8451. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8452. } while (0)
  8453. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8454. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8455. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8456. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8457. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8458. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8459. do { \
  8460. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8461. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8462. } while (0)
  8463. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8464. /**
  8465. * @brief host --> target Host PA Address Size
  8466. *
  8467. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8468. *
  8469. * @details
  8470. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8471. * provide the physical start address and size of each of the memory
  8472. * areas within host DDR that the target FW may need to access.
  8473. *
  8474. * For example, the host can use this message to allow the target FW
  8475. * to set up access to the host's pools of TQM link descriptors.
  8476. * The message would appear as follows:
  8477. *
  8478. * |31 24|23 16|15 8|7 0|
  8479. * |----------------+----------------+----------------+----------------|
  8480. * | reserved | num_entries | msg_type |
  8481. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8482. * | mem area 0 size |
  8483. * |----------------+----------------+----------------+----------------|
  8484. * | mem area 0 physical_address_lo |
  8485. * |----------------+----------------+----------------+----------------|
  8486. * | mem area 0 physical_address_hi |
  8487. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8488. * | mem area 1 size |
  8489. * |----------------+----------------+----------------+----------------|
  8490. * | mem area 1 physical_address_lo |
  8491. * |----------------+----------------+----------------+----------------|
  8492. * | mem area 1 physical_address_hi |
  8493. * |----------------+----------------+----------------+----------------|
  8494. * ...
  8495. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8496. * | mem area N size |
  8497. * |----------------+----------------+----------------+----------------|
  8498. * | mem area N physical_address_lo |
  8499. * |----------------+----------------+----------------+----------------|
  8500. * | mem area N physical_address_hi |
  8501. * |----------------+----------------+----------------+----------------|
  8502. *
  8503. * The message is interpreted as follows:
  8504. * dword0 - b'0:7 - msg_type: This will be set to
  8505. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8506. * b'8:15 - number_entries: Indicated the number of host memory
  8507. * areas specified within the remainder of the message
  8508. * b'16:31 - reserved.
  8509. * dword1 - b'0:31 - memory area 0 size in bytes
  8510. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8511. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8512. * and similar for memory area 1 through memory area N.
  8513. */
  8514. PREPACK struct htt_h2t_host_paddr_size {
  8515. A_UINT32 msg_type: 8,
  8516. num_entries: 8,
  8517. reserved: 16;
  8518. } POSTPACK;
  8519. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8520. A_UINT32 size;
  8521. A_UINT32 physical_address_lo;
  8522. A_UINT32 physical_address_hi;
  8523. } POSTPACK;
  8524. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE \
  8525. (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8526. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_DWORDS \
  8527. (HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE >> 2)
  8528. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8529. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8530. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8531. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8532. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8533. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8534. do { \
  8535. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8536. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8537. } while (0)
  8538. /**
  8539. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8540. *
  8541. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8542. *
  8543. * @details
  8544. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8545. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8546. *
  8547. * The message would appear as follows:
  8548. *
  8549. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8550. * |---------------------------------+---+---+----------+-+-----------|
  8551. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8552. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8553. *
  8554. *
  8555. * The message is interpreted as follows:
  8556. * dword0 - b'0:7 - msg_type: This will be set to
  8557. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8558. * b'8 - override bit to drive MSDUs to PPE ring
  8559. * b'9:13 - REO destination ring indication
  8560. * b'14 - Multi buffer msdu override enable bit
  8561. * b'15 - Intra BSS override
  8562. * b'16 - Decap raw override
  8563. * b'17 - Decap Native wifi override
  8564. * b'18 - IP frag override
  8565. * b'19:31 - reserved
  8566. */
  8567. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8568. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8569. override: 1,
  8570. reo_destination_indication: 5,
  8571. multi_buffer_msdu_override_en: 1,
  8572. intra_bss_override: 1,
  8573. decap_raw_override: 1,
  8574. decap_nwifi_override: 1,
  8575. ip_frag_override: 1,
  8576. reserved: 13;
  8577. } POSTPACK;
  8578. /* DWORD 0: Override */
  8579. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8580. #define HTT_PPE_CFG_OVERRIDE_S 8
  8581. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8582. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8583. HTT_PPE_CFG_OVERRIDE_S)
  8584. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8585. do { \
  8586. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8587. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8588. } while (0)
  8589. /* DWORD 0: REO Destination Indication*/
  8590. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8591. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8592. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8593. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8594. HTT_PPE_CFG_REO_DEST_IND_S)
  8595. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8596. do { \
  8597. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8598. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8599. } while (0)
  8600. /* DWORD 0: Multi buffer MSDU override */
  8601. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8602. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8603. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8604. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8605. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8606. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8607. do { \
  8608. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8609. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8610. } while (0)
  8611. /* DWORD 0: Intra BSS override */
  8612. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8613. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8614. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8615. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8616. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8617. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8618. do { \
  8619. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8620. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8621. } while (0)
  8622. /* DWORD 0: Decap RAW override */
  8623. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8624. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8625. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8626. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8627. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8628. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8629. do { \
  8630. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8631. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8632. } while (0)
  8633. /* DWORD 0: Decap NWIFI override */
  8634. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8635. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8636. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8637. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8638. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8639. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8640. do { \
  8641. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8642. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8643. } while (0)
  8644. /* DWORD 0: IP frag override */
  8645. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8646. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8647. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8648. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8649. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8650. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8651. do { \
  8652. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8653. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8654. } while (0)
  8655. /*
  8656. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8657. *
  8658. * @details
  8659. * The following field definitions describe the format of the HTT host
  8660. * to target FW VDEV TX RX stats retrieve message.
  8661. * The message specifies the type of stats the host wants to retrieve.
  8662. *
  8663. * |31 27|26 25|24 17|16|15 8|7 0|
  8664. * |-----------------------------------------------------------|
  8665. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8666. * |-----------------------------------------------------------|
  8667. * | vdev_id lower bitmask |
  8668. * |-----------------------------------------------------------|
  8669. * | vdev_id upper bitmask |
  8670. * |-----------------------------------------------------------|
  8671. * Header fields:
  8672. * Where:
  8673. * dword0 - b'7:0 - msg_type: This will be set to
  8674. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8675. * b'15:8 - pdev id
  8676. * b'16(E) - Enable/Disable the vdev HW stats
  8677. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8678. * b'25:26(R) - Reset stats bits
  8679. * 0: don't reset stats
  8680. * 1: reset stats once
  8681. * 2: reset stats at the start of each periodic interval
  8682. * b'27:31 - reserved for future use
  8683. * dword1 - b'0:31 - vdev_id lower bitmask
  8684. * dword2 - b'0:31 - vdev_id upper bitmask
  8685. */
  8686. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8687. A_UINT32 msg_type :8,
  8688. pdev_id :8,
  8689. enable :1,
  8690. periodic_interval :8,
  8691. reset_stats_bits :2,
  8692. reserved0 :5;
  8693. A_UINT32 vdev_id_lower_bitmask;
  8694. A_UINT32 vdev_id_upper_bitmask;
  8695. } POSTPACK;
  8696. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8697. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8698. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8699. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8700. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8701. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8702. do { \
  8703. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8704. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8705. } while (0)
  8706. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8707. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8708. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8709. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8710. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8711. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8712. do { \
  8713. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8714. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8715. } while (0)
  8716. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8717. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8718. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8719. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8720. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8721. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8722. do { \
  8723. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8724. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8725. } while (0)
  8726. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8727. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8728. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8729. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8730. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8731. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8732. do { \
  8733. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8734. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8735. } while (0)
  8736. /*
  8737. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8738. *
  8739. * @details
  8740. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8741. * the default MSDU queues for one of the TIDs within the specified peer
  8742. * to the specified service class.
  8743. * The TID is indirectly specified - each service class is associated
  8744. * with a TID. All default MSDU queues for this peer-TID will be
  8745. * linked to the service class in question.
  8746. *
  8747. * |31 16|15 8|7 0|
  8748. * |------------------------------+--------------+--------------|
  8749. * | peer ID | svc class ID | msg type |
  8750. * |------------------------------------------------------------|
  8751. * Header fields:
  8752. * dword0 - b'7:0 - msg_type: This will be set to
  8753. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8754. * b'15:8 - service class ID
  8755. * b'31:16 - peer ID
  8756. */
  8757. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8758. A_UINT32 msg_type :8,
  8759. svc_class_id :8,
  8760. peer_id :16;
  8761. } POSTPACK;
  8762. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8763. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8764. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8765. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8766. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8767. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8768. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8769. do { \
  8770. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8771. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8772. } while (0)
  8773. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8774. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8775. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8776. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8777. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8778. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8779. do { \
  8780. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8781. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8782. } while (0)
  8783. /*
  8784. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8785. *
  8786. * @details
  8787. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8788. * remove the linkage of the specified peer-TID's MSDU queues to
  8789. * service classes.
  8790. *
  8791. * |31 16|15 8|7 0|
  8792. * |------------------------------+--------------+--------------|
  8793. * | peer ID | svc class ID | msg type |
  8794. * |------------------------------------------------------------|
  8795. * Header fields:
  8796. * dword0 - b'7:0 - msg_type: This will be set to
  8797. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8798. * b'15:8 - service class ID
  8799. * b'31:16 - peer ID
  8800. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8801. * value for peer ID indicates that the target should
  8802. * apply the UNMAP_REQ to all peers.
  8803. */
  8804. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8805. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8806. A_UINT32 msg_type :8,
  8807. svc_class_id :8,
  8808. peer_id :16;
  8809. } POSTPACK;
  8810. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8811. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8812. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8813. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8814. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8815. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8816. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8817. do { \
  8818. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8819. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8820. } while (0)
  8821. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8822. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8823. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8824. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8825. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8826. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8827. do { \
  8828. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8829. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8830. } while (0)
  8831. /*
  8832. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8833. *
  8834. * @details
  8835. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8836. * request the target to report what service class the default MSDU queues
  8837. * of the specified TIDs within the peer are linked to.
  8838. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8839. * to report what service class (if any) the default MSDU queues for
  8840. * each of the specified TIDs are linked to.
  8841. *
  8842. * |31 16|15 8|7 1| 0|
  8843. * |------------------------------+--------------+--------------|
  8844. * | peer ID | TID mask | msg type |
  8845. * |------------------------------------------------------------|
  8846. * | reserved |ETO|
  8847. * |------------------------------------------------------------|
  8848. * Header fields:
  8849. * dword0 - b'7:0 - msg_type: This will be set to
  8850. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8851. * b'15:8 - TID mask
  8852. * b'31:16 - peer ID
  8853. * dword1 - b'0 - "Existing Tids Only" flag
  8854. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8855. * message generated by this REQ will only show the
  8856. * mapping for TIDs that actually exist in the target's
  8857. * peer object.
  8858. * Any TIDs that are covered by a MAP_REQ but which
  8859. * do not actually exist will be shown as being
  8860. * unmapped (i.e. svc class ID 0xff).
  8861. * If this flag is cleared, the MAP_REPORT_CONF message
  8862. * will consider not only the mapping of TIDs currently
  8863. * existing in the peer, but also the mapping that will
  8864. * be applied for any TID objects created within this
  8865. * peer in the future.
  8866. * b'31:1 - reserved for future use
  8867. */
  8868. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8869. A_UINT32 msg_type :8,
  8870. tid_mask :8,
  8871. peer_id :16;
  8872. A_UINT32 existing_tids_only:1,
  8873. reserved :31;
  8874. } POSTPACK;
  8875. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8876. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8877. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8878. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8879. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8880. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8881. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8882. do { \
  8883. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8884. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8885. } while (0)
  8886. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8887. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8888. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8889. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8890. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8891. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8892. do { \
  8893. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8894. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8895. } while (0)
  8896. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8897. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8898. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8899. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8900. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8901. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8902. do { \
  8903. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8904. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8905. } while (0)
  8906. /**
  8907. * @brief Format of shared memory between Host and Target
  8908. * for UMAC hang recovery feature messaging.
  8909. * @details
  8910. * This is shared memory between Host and Target allocated
  8911. * and used in chips where UMAC hang recovery feature is supported.
  8912. * This shared memory is allocated per SOC level by Host since each
  8913. * SOC's target Q6FW needs to communicate independently to the Host
  8914. * through its own shared memory.
  8915. * If target sets a bit in t2h_msg (provided it's valid bit offset)
  8916. * then host interprets it as a new message from target.
  8917. * Host clears that particular read bit in t2h_msg after each read
  8918. * operation. It is vice versa for h2t_msg. At any given point
  8919. * of time there is expected to be only one bit set
  8920. * either in t2h_msg or h2t_msg (referring to valid bit offset).
  8921. *
  8922. * The message is interpreted as follows:
  8923. * dword0 - b'0:31 - magic_num: Magic number for the shared memory region
  8924. * added for debuggability purpose.
  8925. * dword1 - b'0 - do_pre_reset
  8926. * b'1 - do_post_reset_start
  8927. * b'2 - do_post_reset_complete
  8928. * b'3 - initiate_umac_recovery
  8929. * b'4:31 - rsvd_t2h
  8930. * dword2 - b'0 - pre_reset_done
  8931. * b'1 - post_reset_start_done
  8932. * b'2 - post_reset_complete_done
  8933. * b'3 - start_pre_reset
  8934. * b'4:31 - rsvd_h2t
  8935. */
  8936. PREPACK typedef struct {
  8937. /** Magic number added for debuggability. */
  8938. A_UINT32 magic_num;
  8939. union {
  8940. /*
  8941. * BIT [0] :- T2H msg to do pre-reset
  8942. * BIT [1] :- T2H msg to do post-reset start
  8943. * BIT [2] :- T2H msg to do post-reset complete
  8944. * BIT [3] :- T2H msg to initiate UMAC recovery sequence.
  8945. * This is needed to synchronize UMAC recovery
  8946. * across all SOCs.
  8947. * BIT [31 : 4] :- reserved
  8948. */
  8949. A_UINT32 t2h_msg;
  8950. struct {
  8951. A_UINT32 do_pre_reset : 1, /* BIT [0] */
  8952. do_post_reset_start : 1, /* BIT [1] */
  8953. do_post_reset_complete : 1, /* BIT [2] */
  8954. initiate_umac_recovery : 1, /* BIT [3] */
  8955. rsvd_t2h : 28; /* BIT [31 : 4] */
  8956. };
  8957. };
  8958. union {
  8959. /*
  8960. * BIT [0] :- H2T msg to send pre-reset done
  8961. * BIT [1] :- H2T msg to send post-reset start done
  8962. * BIT [2] :- H2T msg to send post-reset complete done
  8963. * BIT [3] :- H2T msg to start pre-reset.
  8964. * This is expected only after T2H
  8965. * initiate_umac_recovery was received by Host
  8966. * from one of the SOCs.
  8967. * BIT [31 : 4] :- reserved
  8968. */
  8969. A_UINT32 h2t_msg;
  8970. struct {
  8971. A_UINT32 pre_reset_done : 1, /* BIT [0] */
  8972. post_reset_start_done : 1, /* BIT [1] */
  8973. post_reset_complete_done : 1, /* BIT [2] */
  8974. start_pre_reset : 1, /* BIT [3] */
  8975. rsvd_h2t : 28; /* BIT [31 : 4] */
  8976. };
  8977. };
  8978. } POSTPACK htt_umac_hang_recovery_msg_shmem_t;
  8979. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES \
  8980. (sizeof(htt_umac_hang_recovery_msg_shmem_t))
  8981. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DWORDS \
  8982. (HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES >> 2)
  8983. /* dword1 - b'0 - do_pre_reset */
  8984. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M 0x00000001
  8985. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S 0
  8986. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_GET(word1) \
  8987. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M) >> \
  8988. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S)
  8989. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_SET(word1, _val) \
  8990. do { \
  8991. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET, _val); \
  8992. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S));\
  8993. } while (0)
  8994. /* dword1 - b'1 - do_post_reset_start */
  8995. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M 0x00000002
  8996. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S 1
  8997. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_GET(word1) \
  8998. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M) >> \
  8999. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S)
  9000. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_SET(word1, _val) \
  9001. do { \
  9002. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START, _val); \
  9003. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S));\
  9004. } while (0)
  9005. /* dword1 - b'2 - do_post_reset_complete */
  9006. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M 0x00000004
  9007. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S 2
  9008. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_GET(word1) \
  9009. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M) >> \
  9010. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S)
  9011. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_SET(word1, _val) \
  9012. do { \
  9013. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE, _val); \
  9014. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S));\
  9015. } while (0)
  9016. /* dword1 - b'3 - initiate_umac_recovery */
  9017. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M 0x00000008
  9018. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S 3
  9019. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_GET(word1) \
  9020. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M) >> \
  9021. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S)
  9022. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_SET(word1, _val) \
  9023. do { \
  9024. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY, _val); \
  9025. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S));\
  9026. } while (0)
  9027. /* dword2 - b'0 - pre_reset_done */
  9028. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M 0x00000001
  9029. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S 0
  9030. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_GET(word2) \
  9031. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M) >> \
  9032. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S)
  9033. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_SET(word2, _val) \
  9034. do { \
  9035. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE, _val); \
  9036. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S));\
  9037. } while (0)
  9038. /* dword2 - b'1 - post_reset_start_done */
  9039. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M 0x00000002
  9040. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S 1
  9041. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_GET(word2) \
  9042. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M) >> \
  9043. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S)
  9044. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_SET(word2, _val) \
  9045. do { \
  9046. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE, _val); \
  9047. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S));\
  9048. } while (0)
  9049. /* dword2 - b'2 - post_reset_complete_done */
  9050. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M 0x00000004
  9051. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S 2
  9052. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_GET(word2) \
  9053. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M) >> \
  9054. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S)
  9055. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_SET(word2, _val) \
  9056. do { \
  9057. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE, _val); \
  9058. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S));\
  9059. } while (0)
  9060. /* dword2 - b'3 - start_pre_reset */
  9061. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M 0x00000008
  9062. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S 3
  9063. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_GET(word2) \
  9064. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M) >> \
  9065. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S)
  9066. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_SET(word2, _val) \
  9067. do { \
  9068. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET, _val); \
  9069. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S));\
  9070. } while (0)
  9071. /**
  9072. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message
  9073. *
  9074. * @details
  9075. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message is sent
  9076. * by the host to provide prerequisite info to target for the UMAC hang
  9077. * recovery feature.
  9078. * The info sent in this H2T message are T2H message method, H2T message
  9079. * method, T2H MSI interrupt number and physical start address, size of
  9080. * the shared memory (refers to the shared memory dedicated for messaging
  9081. * between host and target when the DUT is in UMAC hang recovery mode).
  9082. * This H2T message is expected to be only sent if the WMI service bit
  9083. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target.
  9084. *
  9085. * |31 16|15 12|11 8|7 0|
  9086. * |-------------------------------+--------------+--------------+------------|
  9087. * | reserved |h2t msg method|t2h msg method| msg_type |
  9088. * |--------------------------------------------------------------------------|
  9089. * | t2h msi interrupt number |
  9090. * |--------------------------------------------------------------------------|
  9091. * | shared memory area size |
  9092. * |--------------------------------------------------------------------------|
  9093. * | shared memory area physical address low |
  9094. * |--------------------------------------------------------------------------|
  9095. * | shared memory area physical address high |
  9096. * |--------------------------------------------------------------------------|
  9097. *
  9098. * The message is interpreted as follows:
  9099. * dword0 - b'0:7 - msg_type
  9100. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP)
  9101. * b'8:11 - t2h_msg_method: indicates method to be used for
  9102. * T2H communication in UMAC hang recovery mode.
  9103. * Value zero indicates MSI interrupt (default method).
  9104. * Refer to htt_umac_hang_recovery_msg_method enum.
  9105. * b'12:15 - h2t_msg_method: indicates method to be used for
  9106. * H2T communication in UMAC hang recovery mode.
  9107. * Value zero indicates polling by target for this h2t msg
  9108. * during UMAC hang recovery mode.
  9109. * Refer to htt_umac_hang_recovery_msg_method enum.
  9110. * b'16:31 - reserved.
  9111. * dword1 - b'0:31 - t2h_msi_data: MSI data to be used for
  9112. * T2H communication in UMAC hang recovery mode.
  9113. * dword2 - b'0:31 - size: size of shared memory dedicated for messaging
  9114. * only when in UMAC hang recovery mode.
  9115. * This refers to size in bytes.
  9116. * dword3 - b'0:31 - physical_address_lo: lower 32 bit physical address
  9117. * of the shared memory dedicated for messaging only when
  9118. * in UMAC hang recovery mode.
  9119. * dword4 - b'0:31 - physical_address_hi: higher 32 bit physical address
  9120. * of the shared memory dedicated for messaging only when
  9121. * in UMAC hang recovery mode.
  9122. */
  9123. /* t2h_msg_method and h2t_msg_method */
  9124. enum htt_umac_hang_recovery_msg_method {
  9125. htt_umac_hang_recovery_msg_t2h_msi_and_h2t_polling = 0,
  9126. };
  9127. PREPACK typedef struct {
  9128. A_UINT32 msg_type : 8,
  9129. t2h_msg_method : 4,
  9130. h2t_msg_method : 4,
  9131. reserved : 16;
  9132. A_UINT32 t2h_msi_data;
  9133. /* size bytes and physical address of shared memory. */
  9134. struct htt_h2t_host_paddr_size_entry_t msg_shared_mem;
  9135. } POSTPACK htt_h2t_umac_hang_recovery_prerequisite_setup_t;
  9136. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES \
  9137. (sizeof(htt_h2t_umac_hang_recovery_prerequisite_setup_t))
  9138. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_DWORDS \
  9139. (HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES >> 2)
  9140. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M 0x00000F00
  9141. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S 8
  9142. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_GET(word0) \
  9143. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M) >> \
  9144. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S)
  9145. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_SET(word0, _val) \
  9146. do { \
  9147. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD, _val); \
  9148. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S));\
  9149. } while (0)
  9150. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M 0x0000F000
  9151. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S 12
  9152. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_GET(word0) \
  9153. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M) >> \
  9154. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S)
  9155. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_SET(word0, _val) \
  9156. do { \
  9157. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD, _val); \
  9158. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S));\
  9159. } while (0)
  9160. /**
  9161. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET message
  9162. *
  9163. * @details
  9164. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET is a SOC level
  9165. * HTT message sent by the host to indicate that the target needs to start the
  9166. * UMAC hang recovery feature from the point of pre-reset routine.
  9167. * The purpose of this H2T message is to have host synchronize and trigger
  9168. * UMAC recovery across all targets.
  9169. * The info sent in this H2T message is the flag to indicate whether the
  9170. * target needs to execute UMAC-recovery in context of the Initiator or
  9171. * Non-Initiator.
  9172. * This H2T message is expected to be sent as response to the
  9173. * initiate_umac_recovery indication from the Initiator target attached to
  9174. * this same host.
  9175. * This H2T message is expected to be only sent if the WMI service bit
  9176. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target
  9177. * and HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP was sent
  9178. * beforehand.
  9179. *
  9180. * |31 9|8|7 0|
  9181. * |-----------------------------------------------------------|
  9182. * | reserved |I| msg_type |
  9183. * |-----------------------------------------------------------|
  9184. * Where:
  9185. * I = is_initiator
  9186. *
  9187. * The message is interpreted as follows:
  9188. * dword0 - b'0:7 - msg_type
  9189. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET)
  9190. * b'8 - is_initiator: indicates whether the target needs to
  9191. * execute the UMAC-recovery in context of the Initiator or
  9192. * Non-Initiator.
  9193. * The value zero indicates this target is Non-Initiator.
  9194. * b'9:31 - reserved.
  9195. */
  9196. PREPACK typedef struct {
  9197. A_UINT32 msg_type : 8,
  9198. is_initiator : 1,
  9199. reserved : 23;
  9200. } POSTPACK htt_h2t_umac_hang_recovery_start_pre_reset_t;
  9201. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES \
  9202. (sizeof(htt_h2t_umac_hang_recovery_start_pre_reset_t))
  9203. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_DWORDS \
  9204. (HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES >> 2)
  9205. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M 0x00000100
  9206. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S 8
  9207. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_GET(word0) \
  9208. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M) >> \
  9209. HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S)
  9210. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_SET(word0, _val) \
  9211. do { \
  9212. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR, _val); \
  9213. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S));\
  9214. } while (0)
  9215. /*
  9216. * @brief host -> target HTT RX_CCE_SUPER_RULE_SETUP message
  9217. *
  9218. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP
  9219. *
  9220. * @details
  9221. * Host sends RX_CCE_SUPER_RULE setup message to target, in order to request,
  9222. * install or uninstall rx cce super rules to match certain kind of packets
  9223. * with specific parameters. Target sets up HW registers based on setup message
  9224. * and always confirms back to Host.
  9225. *
  9226. * The message would appear as follows:
  9227. * |31 24|23 16|15 8|7 0|
  9228. * |-----------------+-----------------+-----------------+-----------------|
  9229. * | reserved | operation | vdev_id | msg_type |
  9230. * |-----------------------------------------------------------------------|
  9231. * | cce_super_rule_param[0] |
  9232. * |-----------------------------------------------------------------------|
  9233. * | cce_super_rule_param[1] |
  9234. * |-----------------------------------------------------------------------|
  9235. *
  9236. * The message is interpreted as follows:
  9237. * dword0 - b'0:7 - msg_type: This will be set to
  9238. * 0x23 (HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP)
  9239. * b'8:15 - vdev_id: Identify which vdev RX_CCE_SUPER_RULE is for
  9240. * b'16:23 - operation: Identify operation to be taken,
  9241. * 0: HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST
  9242. * 1: HTT_RX_CCE_SUPER_RULE_INSTALL
  9243. * 2: HTT_RX_CCE_SUPER_RULE_RELEASE
  9244. * b'24:31 - reserved
  9245. * dword1~10 - cce_super_rule_param[0]:
  9246. * contains parameters used to setup RX_CCE_SUPER_RULE_0
  9247. * dword11~20 - cce_super_rule_param[1]:
  9248. * contains parameters used to setup RX_CCE_SUPER_RULE_1
  9249. *
  9250. * Each cce_super_rule_param structure would appear as follows:
  9251. * |31 24|23 16|15 8|7 0|
  9252. * |-----------------+-----------------+-----------------+-----------------|
  9253. * |src_ipv6_addr[3] |src_ipv6_addr[2] |src_ipv6_addr[1] |src_ipv6_addr[0] |
  9254. * |/src_ipv4_addr[3]|/src_ipv4_addr[2]|/src_ipv4_addr[1]|/src_ipv4_addr[0]|
  9255. * |-----------------------------------------------------------------------|
  9256. * |src_ipv6_addr[7] |src_ipv6_addr[6] |src_ipv6_addr[5] |src_ipv6_addr[4] |
  9257. * |-----------------------------------------------------------------------|
  9258. * |src_ipv6_addr[11]|src_ipv6_addr[10]|src_ipv6_addr[9] |src_ipv6_addr[8] |
  9259. * |-----------------------------------------------------------------------|
  9260. * |src_ipv6_addr[15]|src_ipv6_addr[14]|src_ipv6_addr[13]|src_ipv6_addr[12]|
  9261. * |-----------------------------------------------------------------------|
  9262. * |dst_ipv6_addr[3] |dst_ipv6_addr[2] |dst_ipv6_addr[1] |dst_ipv6_addr[0] |
  9263. * |/dst_ipv4_addr[3]|/dst_ipv4_addr[2]|/dst_ipv4_addr[1]|/dst_ipv4_addr[0]|
  9264. * |-----------------------------------------------------------------------|
  9265. * |dst_ipv6_addr[7] |dst_ipv6_addr[6] |dst_ipv6_addr[5] |dst_ipv6_addr[4] |
  9266. * |-----------------------------------------------------------------------|
  9267. * |dst_ipv6_addr[11]|dst_ipv6_addr[10]|dst_ipv6_addr[9] |dst_ipv6_addr[8] |
  9268. * |-----------------------------------------------------------------------|
  9269. * |dst_ipv6_addr[15]|dst_ipv6_addr[14]|dst_ipv6_addr[13]|dst_ipv6_addr[12]|
  9270. * |-----------------------------------------------------------------------|
  9271. * | is_valid | l4_type | l3_type |
  9272. * |-----------------------------------------------------------------------|
  9273. * | l4_dst_port | l4_src_port |
  9274. * |-----------------------------------------------------------------------|
  9275. *
  9276. * The cce_super_rule_param[0] structure is interpreted as follows:
  9277. * dword1 - b'0:7 - src_ipv6_addr[0]: b'120:127 of source ipv6 address
  9278. * (or src_ipv4_addr[0]: b'24:31 of source ipv4 address,
  9279. * in case of ipv4)
  9280. * b'8:15 - src_ipv6_addr[1]: b'112:119 of source ipv6 address
  9281. * (or src_ipv4_addr[1]: b'16:23 of source ipv4 address,
  9282. * in case of ipv4)
  9283. * b'16:23 - src_ipv6_addr[2]: b'104:111 of source ipv6 address
  9284. * (or src_ipv4_addr[2]: b'8:15 of source ipv4 address,
  9285. * in case of ipv4)
  9286. * b'24:31 - src_ipv6_addr[3]: b'96:103 of source ipv6 address
  9287. * (or src_ipv4_addr[3]: b'0:7 of source ipv4 address,
  9288. * in case of ipv4)
  9289. * dword2 - b'0:7 - src_ipv6_addr[4]: b'88:95 of source ipv6 address
  9290. * b'8:15 - src_ipv6_addr[5]: b'80:87 of source ipv6 address
  9291. * b'16:23 - src_ipv6_addr[6]: b'72:79 of source ipv6 address
  9292. * b'24:31 - src_ipv6_addr[7]: b'64:71 of source ipv6 address
  9293. * dword3 - b'0:7 - src_ipv6_addr[8]: b'56:63 of source ipv6 address
  9294. * b'8:15 - src_ipv6_addr[9]: b'48:55 of source ipv6 address
  9295. * b'16:23 - src_ipv6_addr[10]: b'40:47 of source ipv6 address
  9296. * b'24:31 - src_ipv6_addr[11]: b'32:39 of source ipv6 address
  9297. * dword4 - b'0:7 - src_ipv6_addr[12]: b'24:31 of source ipv6 address
  9298. * b'8:15 - src_ipv6_addr[13]: b'16:23 of source ipv6 address
  9299. * b'16:23 - src_ipv6_addr[14]: b'8:15 of source ipv6 address
  9300. * b'24:31 - src_ipv6_addr[15]: b'0:7 of source ipv6 address
  9301. * dword5 - b'0:7 - dst_ipv6_addr[0]: b'120:127 of destination ipv6 address
  9302. * (or dst_ipv4_addr[0]: b'24:31 of destination
  9303. * ipv4 address, in case of ipv4)
  9304. * b'8:15 - dst_ipv6_addr[1]: b'112:119 of destination ipv6 address
  9305. * (or dst_ipv4_addr[1]: b'16:23 of destination
  9306. * ipv4 address, in case of ipv4)
  9307. * b'16:23 - dst_ipv6_addr[2]: b'104:111 of destination ipv6 address
  9308. * (or dst_ipv4_addr[2]: b'8:15 of destination
  9309. * ipv4 address, in case of ipv4)
  9310. * b'24:31 - dst_ipv6_addr[3]: b'96:103 of destination ipv6 address
  9311. * (or dst_ipv4_addr[3]: b'0:7 of destination
  9312. * ipv4 address, in case of ipv4)
  9313. * dword6 - b'0:7 - dst_ipv6_addr[4]: b'88:95 of destination ipv6 address
  9314. * b'8:15 - dst_ipv6_addr[5]: b'80:87 of destination ipv6 address
  9315. * b'16:23 - dst_ipv6_addr[6]: b'72:79 of destination ipv6 address
  9316. * b'24:31 - dst_ipv6_addr[7]: b'64:71 of destination ipv6 address
  9317. * dword7 - b'0:7 - dst_ipv6_addr[8]: b'56:63 of destination ipv6 address
  9318. * b'8:15 - dst_ipv6_addr[9]: b'48:55 of destination ipv6 address
  9319. * b'16:23 - dst_ipv6_addr[10]: b'40:47 of destination ipv6 address
  9320. * b'24:31 - dst_ipv6_addr[11]: b'32:39 of destination ipv6 address
  9321. * dword8 - b'0:7 - dst_ipv6_addr[12]: b'24:31 of destination ipv6 address
  9322. * b'8:15 - dst_ipv6_addr[13]: b'16:23 of destination ipv6 address
  9323. * b'16:23 - dst_ipv6_addr[14]: b'8:15 of destination ipv6 address
  9324. * b'24:31 - dst_ipv6_addr[15]: b'0:7 of destination ipv6 address
  9325. * dword9 - b'0:15 - l3_type: type of L3 protocol, indicating L3 protocol used
  9326. * 0x0008: ipv4
  9327. * 0xdd86: ipv6
  9328. * b'16:23 - l4_type: type of L4 protocol, indicating L4 protocol used
  9329. * 6: TCP
  9330. * 17: UDP
  9331. * b'24:31 - is_valid: indicate whether this parameter is valid
  9332. * 0: invalid
  9333. * 1: valid
  9334. * dword10 - b'0:15 - l4_src_port: TCP/UDP source port field
  9335. * b'16:31 - l4_dst_port: TCP/UDP destination port field
  9336. *
  9337. * The cce_super_rule_param[1] structure is similar.
  9338. */
  9339. #define HTT_RX_CCE_SUPER_RULE_SETUP_NUM 2
  9340. enum htt_rx_cce_super_rule_setup_operation {
  9341. HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST = 0,
  9342. HTT_RX_CCE_SUPER_RULE_INSTALL,
  9343. HTT_RX_CCE_SUPER_RULE_RELEASE,
  9344. /* All operation should be before this */
  9345. HTT_RX_CCE_SUPER_RULE_SETUP_INVALID_OPERATION,
  9346. };
  9347. typedef struct {
  9348. union {
  9349. A_UINT8 src_ipv4_addr[4];
  9350. A_UINT8 src_ipv6_addr[16];
  9351. };
  9352. union {
  9353. A_UINT8 dst_ipv4_addr[4];
  9354. A_UINT8 dst_ipv6_addr[16];
  9355. };
  9356. A_UINT32 l3_type: 16,
  9357. l4_type: 8,
  9358. is_valid: 8;
  9359. A_UINT32 l4_src_port: 16,
  9360. l4_dst_port: 16;
  9361. } htt_rx_cce_super_rule_param_t;
  9362. PREPACK struct htt_rx_cce_super_rule_setup_t {
  9363. A_UINT32 msg_type: 8,
  9364. vdev_id: 8,
  9365. operation: 8,
  9366. reserved: 8;
  9367. htt_rx_cce_super_rule_param_t
  9368. cce_super_rule_param[HTT_RX_CCE_SUPER_RULE_SETUP_NUM];
  9369. } POSTPACK;
  9370. #define HTT_RX_CCE_SUPER_RULE_SETUP_SZ \
  9371. (sizeof(struct htt_rx_cce_super_rule_setup_t))
  9372. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_M 0x0000ff00
  9373. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_S 8
  9374. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_GET(_var) \
  9375. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_M) >> \
  9376. HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_S)
  9377. #define HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_SET(_var, _val) \
  9378. do { \
  9379. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID, _val); \
  9380. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_VDEV_ID_S)); \
  9381. } while (0)
  9382. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_M 0x00ff0000
  9383. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S 16
  9384. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_GET(_var) \
  9385. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_M) >> \
  9386. HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S)
  9387. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_SET(_var, _val) \
  9388. do { \
  9389. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION, _val); \
  9390. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S)); \
  9391. } while (0)
  9392. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_M 0x0000ffff
  9393. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S 0
  9394. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_GET(_var) \
  9395. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_M) >> \
  9396. HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S)
  9397. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_SET(_var, _val) \
  9398. do { \
  9399. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE, _val); \
  9400. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S)); \
  9401. } while (0)
  9402. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_M 0x00ff0000
  9403. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S 16
  9404. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_GET(_var) \
  9405. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_M) >> \
  9406. HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S)
  9407. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_SET(_var, _val) \
  9408. do { \
  9409. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE, _val); \
  9410. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S)); \
  9411. } while (0)
  9412. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_M 0xff000000
  9413. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S 24
  9414. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_GET(_var) \
  9415. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_M) >> \
  9416. HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S)
  9417. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_SET(_var, _val) \
  9418. do { \
  9419. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID, _val); \
  9420. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S)); \
  9421. } while (0)
  9422. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_M 0x0000ffff
  9423. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S 0
  9424. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_GET(_var) \
  9425. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_M) >> \
  9426. HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S)
  9427. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_SET(_var, _val) \
  9428. do { \
  9429. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT, _val); \
  9430. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S)); \
  9431. } while (0)
  9432. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_M 0xffff0000
  9433. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S 16
  9434. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_GET(_var) \
  9435. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_M) >> \
  9436. HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S)
  9437. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_SET(_var, _val) \
  9438. do { \
  9439. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT, _val); \
  9440. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S)); \
  9441. } while (0)
  9442. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV4_ADDR_ARRAY_GET(_ptr, _array) \
  9443. do { \
  9444. A_MEMCPY(_array, _ptr, 4); \
  9445. } while (0)
  9446. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV4_ADDR_ARRAY_SET(_ptr, _array) \
  9447. do { \
  9448. A_MEMCPY(_ptr, _array, 4); \
  9449. } while (0)
  9450. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV6_ADDR_ARRAY_GET(_ptr, _array) \
  9451. do { \
  9452. A_MEMCPY(_array, _ptr, 16); \
  9453. } while (0)
  9454. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV6_ADDR_ARRAY_SET(_ptr, _array) \
  9455. do { \
  9456. A_MEMCPY(_ptr, _array, 16); \
  9457. } while (0)
  9458. /*=== target -> host messages ===============================================*/
  9459. enum htt_t2h_msg_type {
  9460. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  9461. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  9462. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  9463. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  9464. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  9465. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  9466. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  9467. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  9468. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  9469. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  9470. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  9471. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  9472. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  9473. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  9474. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  9475. /* only used for HL, add HTT MSG for HTT CREDIT update */
  9476. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  9477. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  9478. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  9479. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  9480. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  9481. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  9482. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  9483. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  9484. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  9485. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  9486. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  9487. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  9488. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  9489. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  9490. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  9491. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  9492. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  9493. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  9494. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  9495. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  9496. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  9497. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  9498. /* TX_OFFLOAD_DELIVER_IND:
  9499. * Forward the target's locally-generated packets to the host,
  9500. * to provide to the monitor mode interface.
  9501. */
  9502. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  9503. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  9504. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  9505. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  9506. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  9507. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  9508. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  9509. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  9510. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  9511. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  9512. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  9513. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  9514. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  9515. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  9516. HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN = 0x31,
  9517. HTT_T2H_MSG_TYPE_RX_DELBA_EXTN = 0x32,
  9518. HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE = 0x33,
  9519. HTT_T2H_MSG_TYPE_TEST,
  9520. /* keep this last */
  9521. HTT_T2H_NUM_MSGS
  9522. };
  9523. /*
  9524. * HTT target to host message type -
  9525. * stored in bits 7:0 of the first word of the message
  9526. */
  9527. #define HTT_T2H_MSG_TYPE_M 0xff
  9528. #define HTT_T2H_MSG_TYPE_S 0
  9529. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  9530. do { \
  9531. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  9532. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  9533. } while (0)
  9534. #define HTT_T2H_MSG_TYPE_GET(word) \
  9535. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  9536. /**
  9537. * @brief target -> host version number confirmation message definition
  9538. *
  9539. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  9540. *
  9541. * |31 24|23 16|15 8|7 0|
  9542. * |----------------+----------------+----------------+----------------|
  9543. * | reserved | major number | minor number | msg type |
  9544. * |-------------------------------------------------------------------|
  9545. * : option request TLV (optional) |
  9546. * :...................................................................:
  9547. *
  9548. * The VER_CONF message may consist of a single 4-byte word, or may be
  9549. * extended with TLVs that specify HTT options selected by the target.
  9550. * The following option TLVs may be appended to the VER_CONF message:
  9551. * - LL_BUS_ADDR_SIZE
  9552. * - HL_SUPPRESS_TX_COMPL_IND
  9553. * - MAX_TX_QUEUE_GROUPS
  9554. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  9555. * may be appended to the VER_CONF message (but only one TLV of each type).
  9556. *
  9557. * Header fields:
  9558. * - MSG_TYPE
  9559. * Bits 7:0
  9560. * Purpose: identifies this as a version number confirmation message
  9561. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  9562. * - VER_MINOR
  9563. * Bits 15:8
  9564. * Purpose: Specify the minor number of the HTT message library version
  9565. * in use by the target firmware.
  9566. * The minor number specifies the specific revision within a range
  9567. * of fundamentally compatible HTT message definition revisions.
  9568. * Compatible revisions involve adding new messages or perhaps
  9569. * adding new fields to existing messages, in a backwards-compatible
  9570. * manner.
  9571. * Incompatible revisions involve changing the message type values,
  9572. * or redefining existing messages.
  9573. * Value: minor number
  9574. * - VER_MAJOR
  9575. * Bits 15:8
  9576. * Purpose: Specify the major number of the HTT message library version
  9577. * in use by the target firmware.
  9578. * The major number specifies the family of minor revisions that are
  9579. * fundamentally compatible with each other, but not with prior or
  9580. * later families.
  9581. * Value: major number
  9582. */
  9583. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  9584. #define HTT_VER_CONF_MINOR_S 8
  9585. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  9586. #define HTT_VER_CONF_MAJOR_S 16
  9587. #define HTT_VER_CONF_MINOR_SET(word, value) \
  9588. do { \
  9589. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  9590. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  9591. } while (0)
  9592. #define HTT_VER_CONF_MINOR_GET(word) \
  9593. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  9594. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  9595. do { \
  9596. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  9597. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  9598. } while (0)
  9599. #define HTT_VER_CONF_MAJOR_GET(word) \
  9600. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  9601. #define HTT_VER_CONF_BYTES 4
  9602. /**
  9603. * @brief - target -> host HTT Rx In order indication message
  9604. *
  9605. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  9606. *
  9607. * @details
  9608. *
  9609. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  9610. * |----------------+-------------------+---------------------+---------------|
  9611. * | peer ID | P| F| O| ext TID | msg type |
  9612. * |--------------------------------------------------------------------------|
  9613. * | MSDU count | Reserved | vdev id |
  9614. * |--------------------------------------------------------------------------|
  9615. * | MSDU 0 bus address (bits 31:0) |
  9616. #if HTT_PADDR64
  9617. * | MSDU 0 bus address (bits 63:32) |
  9618. #endif
  9619. * |--------------------------------------------------------------------------|
  9620. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  9621. * |--------------------------------------------------------------------------|
  9622. * | MSDU 1 bus address (bits 31:0) |
  9623. #if HTT_PADDR64
  9624. * | MSDU 1 bus address (bits 63:32) |
  9625. #endif
  9626. * |--------------------------------------------------------------------------|
  9627. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  9628. * |--------------------------------------------------------------------------|
  9629. */
  9630. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  9631. *
  9632. * @details
  9633. * bits
  9634. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  9635. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9636. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  9637. * | | frag | | | | fail |chksum fail|
  9638. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9639. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  9640. */
  9641. struct htt_rx_in_ord_paddr_ind_hdr_t
  9642. {
  9643. A_UINT32 /* word 0 */
  9644. msg_type: 8,
  9645. ext_tid: 5,
  9646. offload: 1,
  9647. frag: 1,
  9648. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  9649. peer_id: 16;
  9650. A_UINT32 /* word 1 */
  9651. vap_id: 8,
  9652. /* NOTE:
  9653. * This reserved_1 field is not truly reserved - certain targets use
  9654. * this field internally to store debug information, and do not zero
  9655. * out the contents of the field before uploading the message to the
  9656. * host. Thus, any host-target communication supported by this field
  9657. * is limited to using values that are never used by the debug
  9658. * information stored by certain targets in the reserved_1 field.
  9659. * In particular, the targets in question don't use the value 0x3
  9660. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  9661. * so this previously-unused value within these bits is available to
  9662. * use as the host / target PKT_CAPTURE_MODE flag.
  9663. */
  9664. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  9665. /* if pkt_capture_mode == 0x3, host should
  9666. * send rx frames to monitor mode interface
  9667. */
  9668. msdu_cnt: 16;
  9669. };
  9670. struct htt_rx_in_ord_paddr_ind_msdu32_t
  9671. {
  9672. A_UINT32 dma_addr;
  9673. A_UINT32
  9674. length: 16,
  9675. fw_desc: 8,
  9676. msdu_info:8;
  9677. };
  9678. struct htt_rx_in_ord_paddr_ind_msdu64_t
  9679. {
  9680. A_UINT32 dma_addr_lo;
  9681. A_UINT32 dma_addr_hi;
  9682. A_UINT32
  9683. length: 16,
  9684. fw_desc: 8,
  9685. msdu_info:8;
  9686. };
  9687. #if HTT_PADDR64
  9688. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  9689. #else
  9690. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  9691. #endif
  9692. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  9693. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  9694. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  9695. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  9696. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  9697. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  9698. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  9699. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  9700. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  9701. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  9702. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  9703. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  9704. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  9705. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  9706. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  9707. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  9708. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  9709. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  9710. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  9711. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  9712. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  9713. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  9714. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  9715. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  9716. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  9717. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  9718. /* for systems using 64-bit format for bus addresses */
  9719. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  9720. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  9721. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  9722. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  9723. /* for systems using 32-bit format for bus addresses */
  9724. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  9725. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  9726. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  9727. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  9728. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  9729. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  9730. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  9731. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  9732. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  9733. do { \
  9734. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  9735. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  9736. } while (0)
  9737. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  9738. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  9739. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  9740. do { \
  9741. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  9742. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  9743. } while (0)
  9744. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  9745. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  9746. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  9747. do { \
  9748. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  9749. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  9750. } while (0)
  9751. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  9752. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  9753. /*
  9754. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  9755. * deliver the rx frames to the monitor mode interface.
  9756. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  9757. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  9758. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  9759. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  9760. */
  9761. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  9762. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  9763. do { \
  9764. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  9765. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  9766. } while (0)
  9767. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  9768. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  9769. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  9770. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  9771. do { \
  9772. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  9773. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  9774. } while (0)
  9775. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  9776. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  9777. /* for systems using 64-bit format for bus addresses */
  9778. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  9779. do { \
  9780. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  9781. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  9782. } while (0)
  9783. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  9784. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  9785. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  9786. do { \
  9787. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  9788. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  9789. } while (0)
  9790. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  9791. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  9792. /* for systems using 32-bit format for bus addresses */
  9793. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  9794. do { \
  9795. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  9796. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  9797. } while (0)
  9798. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  9799. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  9800. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  9801. do { \
  9802. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  9803. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  9804. } while (0)
  9805. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  9806. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  9807. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  9808. do { \
  9809. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  9810. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  9811. } while (0)
  9812. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  9813. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  9814. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  9815. do { \
  9816. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  9817. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  9818. } while (0)
  9819. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  9820. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  9821. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  9822. do { \
  9823. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  9824. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  9825. } while (0)
  9826. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  9827. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  9828. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  9829. do { \
  9830. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  9831. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  9832. } while (0)
  9833. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  9834. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  9835. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  9836. do { \
  9837. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  9838. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  9839. } while (0)
  9840. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  9841. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  9842. /* definitions used within target -> host rx indication message */
  9843. PREPACK struct htt_rx_ind_hdr_prefix_t
  9844. {
  9845. A_UINT32 /* word 0 */
  9846. msg_type: 8,
  9847. ext_tid: 5,
  9848. release_valid: 1,
  9849. flush_valid: 1,
  9850. reserved0: 1,
  9851. peer_id: 16;
  9852. A_UINT32 /* word 1 */
  9853. flush_start_seq_num: 6,
  9854. flush_end_seq_num: 6,
  9855. release_start_seq_num: 6,
  9856. release_end_seq_num: 6,
  9857. num_mpdu_ranges: 8;
  9858. } POSTPACK;
  9859. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  9860. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  9861. #define HTT_TGT_RSSI_INVALID 0x80
  9862. PREPACK struct htt_rx_ppdu_desc_t
  9863. {
  9864. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  9865. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  9866. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  9867. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  9868. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  9869. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  9870. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  9871. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  9872. A_UINT32 /* word 0 */
  9873. rssi_cmb: 8,
  9874. timestamp_submicrosec: 8,
  9875. phy_err_code: 8,
  9876. phy_err: 1,
  9877. legacy_rate: 4,
  9878. legacy_rate_sel: 1,
  9879. end_valid: 1,
  9880. start_valid: 1;
  9881. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  9882. union {
  9883. A_UINT32 /* word 1 */
  9884. rssi0_pri20: 8,
  9885. rssi0_ext20: 8,
  9886. rssi0_ext40: 8,
  9887. rssi0_ext80: 8;
  9888. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  9889. } u0;
  9890. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  9891. union {
  9892. A_UINT32 /* word 2 */
  9893. rssi1_pri20: 8,
  9894. rssi1_ext20: 8,
  9895. rssi1_ext40: 8,
  9896. rssi1_ext80: 8;
  9897. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  9898. } u1;
  9899. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  9900. union {
  9901. A_UINT32 /* word 3 */
  9902. rssi2_pri20: 8,
  9903. rssi2_ext20: 8,
  9904. rssi2_ext40: 8,
  9905. rssi2_ext80: 8;
  9906. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  9907. } u2;
  9908. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  9909. union {
  9910. A_UINT32 /* word 4 */
  9911. rssi3_pri20: 8,
  9912. rssi3_ext20: 8,
  9913. rssi3_ext40: 8,
  9914. rssi3_ext80: 8;
  9915. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  9916. } u3;
  9917. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  9918. A_UINT32 tsf32; /* word 5 */
  9919. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  9920. A_UINT32 timestamp_microsec; /* word 6 */
  9921. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  9922. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  9923. A_UINT32 /* word 7 */
  9924. vht_sig_a1: 24,
  9925. preamble_type: 8;
  9926. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  9927. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  9928. A_UINT32 /* word 8 */
  9929. vht_sig_a2: 24,
  9930. /* sa_ant_matrix
  9931. * For cases where a single rx chain has options to be connected to
  9932. * different rx antennas, show which rx antennas were in use during
  9933. * receipt of a given PPDU.
  9934. * This sa_ant_matrix provides a bitmask of the antennas used while
  9935. * receiving this frame.
  9936. */
  9937. sa_ant_matrix: 8;
  9938. } POSTPACK;
  9939. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  9940. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  9941. PREPACK struct htt_rx_ind_hdr_suffix_t
  9942. {
  9943. A_UINT32 /* word 0 */
  9944. fw_rx_desc_bytes: 16,
  9945. reserved0: 16;
  9946. } POSTPACK;
  9947. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  9948. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  9949. PREPACK struct htt_rx_ind_hdr_t
  9950. {
  9951. struct htt_rx_ind_hdr_prefix_t prefix;
  9952. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  9953. struct htt_rx_ind_hdr_suffix_t suffix;
  9954. } POSTPACK;
  9955. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  9956. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  9957. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  9958. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9959. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9960. /*
  9961. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9962. * the offset into the HTT rx indication message at which the
  9963. * FW rx PPDU descriptor resides
  9964. */
  9965. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9966. /*
  9967. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9968. * the offset into the HTT rx indication message at which the
  9969. * header suffix (FW rx MSDU byte count) resides
  9970. */
  9971. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9972. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9973. /*
  9974. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9975. * the offset into the HTT rx indication message at which the per-MSDU
  9976. * information starts
  9977. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9978. * per-MSDU information portion of the message. The per-MSDU info itself
  9979. * starts at byte 12.
  9980. */
  9981. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9982. /**
  9983. * @brief target -> host rx indication message definition
  9984. *
  9985. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9986. *
  9987. * @details
  9988. * The following field definitions describe the format of the rx indication
  9989. * message sent from the target to the host.
  9990. * The message consists of three major sections:
  9991. * 1. a fixed-length header
  9992. * 2. a variable-length list of firmware rx MSDU descriptors
  9993. * 3. one or more 4-octet MPDU range information elements
  9994. * The fixed length header itself has two sub-sections
  9995. * 1. the message meta-information, including identification of the
  9996. * sender and type of the received data, and a 4-octet flush/release IE
  9997. * 2. the firmware rx PPDU descriptor
  9998. *
  9999. * The format of the message is depicted below.
  10000. * in this depiction, the following abbreviations are used for information
  10001. * elements within the message:
  10002. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  10003. * elements associated with the PPDU start are valid.
  10004. * Specifically, the following fields are valid only if SV is set:
  10005. * RSSI (all variants), L, legacy rate, preamble type, service,
  10006. * VHT-SIG-A
  10007. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  10008. * elements associated with the PPDU end are valid.
  10009. * Specifically, the following fields are valid only if EV is set:
  10010. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  10011. * - L - Legacy rate selector - if legacy rates are used, this flag
  10012. * indicates whether the rate is from a CCK (L == 1) or OFDM
  10013. * (L == 0) PHY.
  10014. * - P - PHY error flag - boolean indication of whether the rx frame had
  10015. * a PHY error
  10016. *
  10017. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  10018. * |----------------+-------------------+---------------------+---------------|
  10019. * | peer ID | |RV|FV| ext TID | msg type |
  10020. * |--------------------------------------------------------------------------|
  10021. * | num | release | release | flush | flush |
  10022. * | MPDU | end | start | end | start |
  10023. * | ranges | seq num | seq num | seq num | seq num |
  10024. * |==========================================================================|
  10025. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  10026. * |V|V| | rate | | | timestamp | RSSI |
  10027. * |--------------------------------------------------------------------------|
  10028. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  10029. * |--------------------------------------------------------------------------|
  10030. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  10031. * |--------------------------------------------------------------------------|
  10032. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  10033. * |--------------------------------------------------------------------------|
  10034. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  10035. * |--------------------------------------------------------------------------|
  10036. * | TSF LSBs |
  10037. * |--------------------------------------------------------------------------|
  10038. * | microsec timestamp |
  10039. * |--------------------------------------------------------------------------|
  10040. * | preamble type | HT-SIG / VHT-SIG-A1 |
  10041. * |--------------------------------------------------------------------------|
  10042. * | service | HT-SIG / VHT-SIG-A2 |
  10043. * |==========================================================================|
  10044. * | reserved | FW rx desc bytes |
  10045. * |--------------------------------------------------------------------------|
  10046. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  10047. * | desc B3 | desc B2 | desc B1 | desc B0 |
  10048. * |--------------------------------------------------------------------------|
  10049. * : : :
  10050. * |--------------------------------------------------------------------------|
  10051. * | alignment | MSDU Rx |
  10052. * | padding | desc Bn |
  10053. * |--------------------------------------------------------------------------|
  10054. * | reserved | MPDU range status | MPDU count |
  10055. * |--------------------------------------------------------------------------|
  10056. * : reserved : MPDU range status : MPDU count :
  10057. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  10058. *
  10059. * Header fields:
  10060. * - MSG_TYPE
  10061. * Bits 7:0
  10062. * Purpose: identifies this as an rx indication message
  10063. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  10064. * - EXT_TID
  10065. * Bits 12:8
  10066. * Purpose: identify the traffic ID of the rx data, including
  10067. * special "extended" TID values for multicast, broadcast, and
  10068. * non-QoS data frames
  10069. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  10070. * - FLUSH_VALID (FV)
  10071. * Bit 13
  10072. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  10073. * is valid
  10074. * Value:
  10075. * 1 -> flush IE is valid and needs to be processed
  10076. * 0 -> flush IE is not valid and should be ignored
  10077. * - REL_VALID (RV)
  10078. * Bit 13
  10079. * Purpose: indicate whether the release IE (start/end sequence numbers)
  10080. * is valid
  10081. * Value:
  10082. * 1 -> release IE is valid and needs to be processed
  10083. * 0 -> release IE is not valid and should be ignored
  10084. * - PEER_ID
  10085. * Bits 31:16
  10086. * Purpose: Identify, by ID, which peer sent the rx data
  10087. * Value: ID of the peer who sent the rx data
  10088. * - FLUSH_SEQ_NUM_START
  10089. * Bits 5:0
  10090. * Purpose: Indicate the start of a series of MPDUs to flush
  10091. * Not all MPDUs within this series are necessarily valid - the host
  10092. * must check each sequence number within this range to see if the
  10093. * corresponding MPDU is actually present.
  10094. * This field is only valid if the FV bit is set.
  10095. * Value:
  10096. * The sequence number for the first MPDUs to check to flush.
  10097. * The sequence number is masked by 0x3f.
  10098. * - FLUSH_SEQ_NUM_END
  10099. * Bits 11:6
  10100. * Purpose: Indicate the end of a series of MPDUs to flush
  10101. * Value:
  10102. * The sequence number one larger than the sequence number of the
  10103. * last MPDU to check to flush.
  10104. * The sequence number is masked by 0x3f.
  10105. * Not all MPDUs within this series are necessarily valid - the host
  10106. * must check each sequence number within this range to see if the
  10107. * corresponding MPDU is actually present.
  10108. * This field is only valid if the FV bit is set.
  10109. * - REL_SEQ_NUM_START
  10110. * Bits 17:12
  10111. * Purpose: Indicate the start of a series of MPDUs to release.
  10112. * All MPDUs within this series are present and valid - the host
  10113. * need not check each sequence number within this range to see if
  10114. * the corresponding MPDU is actually present.
  10115. * This field is only valid if the RV bit is set.
  10116. * Value:
  10117. * The sequence number for the first MPDUs to check to release.
  10118. * The sequence number is masked by 0x3f.
  10119. * - REL_SEQ_NUM_END
  10120. * Bits 23:18
  10121. * Purpose: Indicate the end of a series of MPDUs to release.
  10122. * Value:
  10123. * The sequence number one larger than the sequence number of the
  10124. * last MPDU to check to release.
  10125. * The sequence number is masked by 0x3f.
  10126. * All MPDUs within this series are present and valid - the host
  10127. * need not check each sequence number within this range to see if
  10128. * the corresponding MPDU is actually present.
  10129. * This field is only valid if the RV bit is set.
  10130. * - NUM_MPDU_RANGES
  10131. * Bits 31:24
  10132. * Purpose: Indicate how many ranges of MPDUs are present.
  10133. * Each MPDU range consists of a series of contiguous MPDUs within the
  10134. * rx frame sequence which all have the same MPDU status.
  10135. * Value: 1-63 (typically a small number, like 1-3)
  10136. *
  10137. * Rx PPDU descriptor fields:
  10138. * - RSSI_CMB
  10139. * Bits 7:0
  10140. * Purpose: Combined RSSI from all active rx chains, across the active
  10141. * bandwidth.
  10142. * Value: RSSI dB units w.r.t. noise floor
  10143. * - TIMESTAMP_SUBMICROSEC
  10144. * Bits 15:8
  10145. * Purpose: high-resolution timestamp
  10146. * Value:
  10147. * Sub-microsecond time of PPDU reception.
  10148. * This timestamp ranges from [0,MAC clock MHz).
  10149. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  10150. * to form a high-resolution, large range rx timestamp.
  10151. * - PHY_ERR_CODE
  10152. * Bits 23:16
  10153. * Purpose:
  10154. * If the rx frame processing resulted in a PHY error, indicate what
  10155. * type of rx PHY error occurred.
  10156. * Value:
  10157. * This field is valid if the "P" (PHY_ERR) flag is set.
  10158. * TBD: document/specify the values for this field
  10159. * - PHY_ERR
  10160. * Bit 24
  10161. * Purpose: indicate whether the rx PPDU had a PHY error
  10162. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  10163. * - LEGACY_RATE
  10164. * Bits 28:25
  10165. * Purpose:
  10166. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  10167. * specify which rate was used.
  10168. * Value:
  10169. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  10170. * flag.
  10171. * If LEGACY_RATE_SEL is 0:
  10172. * 0x8: OFDM 48 Mbps
  10173. * 0x9: OFDM 24 Mbps
  10174. * 0xA: OFDM 12 Mbps
  10175. * 0xB: OFDM 6 Mbps
  10176. * 0xC: OFDM 54 Mbps
  10177. * 0xD: OFDM 36 Mbps
  10178. * 0xE: OFDM 18 Mbps
  10179. * 0xF: OFDM 9 Mbps
  10180. * If LEGACY_RATE_SEL is 1:
  10181. * 0x8: CCK 11 Mbps long preamble
  10182. * 0x9: CCK 5.5 Mbps long preamble
  10183. * 0xA: CCK 2 Mbps long preamble
  10184. * 0xB: CCK 1 Mbps long preamble
  10185. * 0xC: CCK 11 Mbps short preamble
  10186. * 0xD: CCK 5.5 Mbps short preamble
  10187. * 0xE: CCK 2 Mbps short preamble
  10188. * - LEGACY_RATE_SEL
  10189. * Bit 29
  10190. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  10191. * Value:
  10192. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  10193. * used a legacy rate.
  10194. * 0 -> OFDM, 1 -> CCK
  10195. * - END_VALID
  10196. * Bit 30
  10197. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  10198. * the start of the PPDU are valid. Specifically, the following
  10199. * fields are only valid if END_VALID is set:
  10200. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  10201. * TIMESTAMP_SUBMICROSEC
  10202. * Value:
  10203. * 0 -> rx PPDU desc end fields are not valid
  10204. * 1 -> rx PPDU desc end fields are valid
  10205. * - START_VALID
  10206. * Bit 31
  10207. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  10208. * the end of the PPDU are valid. Specifically, the following
  10209. * fields are only valid if START_VALID is set:
  10210. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  10211. * VHT-SIG-A
  10212. * Value:
  10213. * 0 -> rx PPDU desc start fields are not valid
  10214. * 1 -> rx PPDU desc start fields are valid
  10215. * - RSSI0_PRI20
  10216. * Bits 7:0
  10217. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  10218. * Value: RSSI dB units w.r.t. noise floor
  10219. *
  10220. * - RSSI0_EXT20
  10221. * Bits 7:0
  10222. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  10223. * (if the rx bandwidth was >= 40 MHz)
  10224. * Value: RSSI dB units w.r.t. noise floor
  10225. * - RSSI0_EXT40
  10226. * Bits 7:0
  10227. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  10228. * (if the rx bandwidth was >= 80 MHz)
  10229. * Value: RSSI dB units w.r.t. noise floor
  10230. * - RSSI0_EXT80
  10231. * Bits 7:0
  10232. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  10233. * (if the rx bandwidth was >= 160 MHz)
  10234. * Value: RSSI dB units w.r.t. noise floor
  10235. *
  10236. * - RSSI1_PRI20
  10237. * Bits 7:0
  10238. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  10239. * Value: RSSI dB units w.r.t. noise floor
  10240. * - RSSI1_EXT20
  10241. * Bits 7:0
  10242. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  10243. * (if the rx bandwidth was >= 40 MHz)
  10244. * Value: RSSI dB units w.r.t. noise floor
  10245. * - RSSI1_EXT40
  10246. * Bits 7:0
  10247. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  10248. * (if the rx bandwidth was >= 80 MHz)
  10249. * Value: RSSI dB units w.r.t. noise floor
  10250. * - RSSI1_EXT80
  10251. * Bits 7:0
  10252. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  10253. * (if the rx bandwidth was >= 160 MHz)
  10254. * Value: RSSI dB units w.r.t. noise floor
  10255. *
  10256. * - RSSI2_PRI20
  10257. * Bits 7:0
  10258. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  10259. * Value: RSSI dB units w.r.t. noise floor
  10260. * - RSSI2_EXT20
  10261. * Bits 7:0
  10262. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  10263. * (if the rx bandwidth was >= 40 MHz)
  10264. * Value: RSSI dB units w.r.t. noise floor
  10265. * - RSSI2_EXT40
  10266. * Bits 7:0
  10267. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  10268. * (if the rx bandwidth was >= 80 MHz)
  10269. * Value: RSSI dB units w.r.t. noise floor
  10270. * - RSSI2_EXT80
  10271. * Bits 7:0
  10272. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  10273. * (if the rx bandwidth was >= 160 MHz)
  10274. * Value: RSSI dB units w.r.t. noise floor
  10275. *
  10276. * - RSSI3_PRI20
  10277. * Bits 7:0
  10278. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  10279. * Value: RSSI dB units w.r.t. noise floor
  10280. * - RSSI3_EXT20
  10281. * Bits 7:0
  10282. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  10283. * (if the rx bandwidth was >= 40 MHz)
  10284. * Value: RSSI dB units w.r.t. noise floor
  10285. * - RSSI3_EXT40
  10286. * Bits 7:0
  10287. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  10288. * (if the rx bandwidth was >= 80 MHz)
  10289. * Value: RSSI dB units w.r.t. noise floor
  10290. * - RSSI3_EXT80
  10291. * Bits 7:0
  10292. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  10293. * (if the rx bandwidth was >= 160 MHz)
  10294. * Value: RSSI dB units w.r.t. noise floor
  10295. *
  10296. * - TSF32
  10297. * Bits 31:0
  10298. * Purpose: specify the time the rx PPDU was received, in TSF units
  10299. * Value: 32 LSBs of the TSF
  10300. * - TIMESTAMP_MICROSEC
  10301. * Bits 31:0
  10302. * Purpose: specify the time the rx PPDU was received, in microsecond units
  10303. * Value: PPDU rx time, in microseconds
  10304. * - VHT_SIG_A1
  10305. * Bits 23:0
  10306. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  10307. * from the rx PPDU
  10308. * Value:
  10309. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10310. * VHT-SIG-A1 data.
  10311. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10312. * first 24 bits of the HT-SIG data.
  10313. * Otherwise, this field is invalid.
  10314. * Refer to the the 802.11 protocol for the definition of the
  10315. * HT-SIG and VHT-SIG-A1 fields
  10316. * - VHT_SIG_A2
  10317. * Bits 23:0
  10318. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  10319. * from the rx PPDU
  10320. * Value:
  10321. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10322. * VHT-SIG-A2 data.
  10323. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10324. * last 24 bits of the HT-SIG data.
  10325. * Otherwise, this field is invalid.
  10326. * Refer to the the 802.11 protocol for the definition of the
  10327. * HT-SIG and VHT-SIG-A2 fields
  10328. * - PREAMBLE_TYPE
  10329. * Bits 31:24
  10330. * Purpose: indicate the PHY format of the received burst
  10331. * Value:
  10332. * 0x4: Legacy (OFDM/CCK)
  10333. * 0x8: HT
  10334. * 0x9: HT with TxBF
  10335. * 0xC: VHT
  10336. * 0xD: VHT with TxBF
  10337. * - SERVICE
  10338. * Bits 31:24
  10339. * Purpose: TBD
  10340. * Value: TBD
  10341. *
  10342. * Rx MSDU descriptor fields:
  10343. * - FW_RX_DESC_BYTES
  10344. * Bits 15:0
  10345. * Purpose: Indicate how many bytes in the Rx indication are used for
  10346. * FW Rx descriptors
  10347. *
  10348. * Payload fields:
  10349. * - MPDU_COUNT
  10350. * Bits 7:0
  10351. * Purpose: Indicate how many sequential MPDUs share the same status.
  10352. * All MPDUs within the indicated list are from the same RA-TA-TID.
  10353. * - MPDU_STATUS
  10354. * Bits 15:8
  10355. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  10356. * received successfully.
  10357. * Value:
  10358. * 0x1: success
  10359. * 0x2: FCS error
  10360. * 0x3: duplicate error
  10361. * 0x4: replay error
  10362. * 0x5: invalid peer
  10363. */
  10364. /* header fields */
  10365. #define HTT_RX_IND_EXT_TID_M 0x1f00
  10366. #define HTT_RX_IND_EXT_TID_S 8
  10367. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  10368. #define HTT_RX_IND_FLUSH_VALID_S 13
  10369. #define HTT_RX_IND_REL_VALID_M 0x4000
  10370. #define HTT_RX_IND_REL_VALID_S 14
  10371. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  10372. #define HTT_RX_IND_PEER_ID_S 16
  10373. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  10374. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  10375. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  10376. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  10377. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  10378. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  10379. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  10380. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  10381. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  10382. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  10383. /* rx PPDU descriptor fields */
  10384. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  10385. #define HTT_RX_IND_RSSI_CMB_S 0
  10386. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  10387. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  10388. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  10389. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  10390. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  10391. #define HTT_RX_IND_PHY_ERR_S 24
  10392. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  10393. #define HTT_RX_IND_LEGACY_RATE_S 25
  10394. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  10395. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  10396. #define HTT_RX_IND_END_VALID_M 0x40000000
  10397. #define HTT_RX_IND_END_VALID_S 30
  10398. #define HTT_RX_IND_START_VALID_M 0x80000000
  10399. #define HTT_RX_IND_START_VALID_S 31
  10400. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  10401. #define HTT_RX_IND_RSSI_PRI20_S 0
  10402. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  10403. #define HTT_RX_IND_RSSI_EXT20_S 8
  10404. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  10405. #define HTT_RX_IND_RSSI_EXT40_S 16
  10406. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  10407. #define HTT_RX_IND_RSSI_EXT80_S 24
  10408. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  10409. #define HTT_RX_IND_VHT_SIG_A1_S 0
  10410. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  10411. #define HTT_RX_IND_VHT_SIG_A2_S 0
  10412. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  10413. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  10414. #define HTT_RX_IND_SERVICE_M 0xff000000
  10415. #define HTT_RX_IND_SERVICE_S 24
  10416. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  10417. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  10418. /* rx MSDU descriptor fields */
  10419. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  10420. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  10421. /* payload fields */
  10422. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  10423. #define HTT_RX_IND_MPDU_COUNT_S 0
  10424. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  10425. #define HTT_RX_IND_MPDU_STATUS_S 8
  10426. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  10427. do { \
  10428. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  10429. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  10430. } while (0)
  10431. #define HTT_RX_IND_EXT_TID_GET(word) \
  10432. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  10433. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  10434. do { \
  10435. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  10436. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  10437. } while (0)
  10438. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  10439. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  10440. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  10441. do { \
  10442. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  10443. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  10444. } while (0)
  10445. #define HTT_RX_IND_REL_VALID_GET(word) \
  10446. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  10447. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  10448. do { \
  10449. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  10450. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  10451. } while (0)
  10452. #define HTT_RX_IND_PEER_ID_GET(word) \
  10453. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  10454. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  10455. do { \
  10456. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  10457. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  10458. } while (0)
  10459. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  10460. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  10461. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  10462. do { \
  10463. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  10464. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  10465. } while (0)
  10466. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  10467. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  10468. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  10469. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  10470. do { \
  10471. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  10472. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  10473. } while (0)
  10474. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  10475. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  10476. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  10477. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  10478. do { \
  10479. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  10480. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  10481. } while (0)
  10482. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  10483. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  10484. HTT_RX_IND_REL_SEQ_NUM_START_S)
  10485. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  10486. do { \
  10487. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  10488. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  10489. } while (0)
  10490. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  10491. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  10492. HTT_RX_IND_REL_SEQ_NUM_END_S)
  10493. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  10494. do { \
  10495. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  10496. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  10497. } while (0)
  10498. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  10499. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  10500. HTT_RX_IND_NUM_MPDU_RANGES_S)
  10501. /* FW rx PPDU descriptor fields */
  10502. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  10503. do { \
  10504. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  10505. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  10506. } while (0)
  10507. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  10508. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  10509. HTT_RX_IND_RSSI_CMB_S)
  10510. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  10511. do { \
  10512. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  10513. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  10514. } while (0)
  10515. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  10516. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  10517. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  10518. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  10519. do { \
  10520. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  10521. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  10522. } while (0)
  10523. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  10524. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  10525. HTT_RX_IND_PHY_ERR_CODE_S)
  10526. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  10527. do { \
  10528. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  10529. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  10530. } while (0)
  10531. #define HTT_RX_IND_PHY_ERR_GET(word) \
  10532. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  10533. HTT_RX_IND_PHY_ERR_S)
  10534. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  10535. do { \
  10536. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  10537. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  10538. } while (0)
  10539. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  10540. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  10541. HTT_RX_IND_LEGACY_RATE_S)
  10542. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  10543. do { \
  10544. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  10545. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  10546. } while (0)
  10547. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  10548. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  10549. HTT_RX_IND_LEGACY_RATE_SEL_S)
  10550. #define HTT_RX_IND_END_VALID_SET(word, value) \
  10551. do { \
  10552. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  10553. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  10554. } while (0)
  10555. #define HTT_RX_IND_END_VALID_GET(word) \
  10556. (((word) & HTT_RX_IND_END_VALID_M) >> \
  10557. HTT_RX_IND_END_VALID_S)
  10558. #define HTT_RX_IND_START_VALID_SET(word, value) \
  10559. do { \
  10560. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  10561. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  10562. } while (0)
  10563. #define HTT_RX_IND_START_VALID_GET(word) \
  10564. (((word) & HTT_RX_IND_START_VALID_M) >> \
  10565. HTT_RX_IND_START_VALID_S)
  10566. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  10567. do { \
  10568. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  10569. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  10570. } while (0)
  10571. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  10572. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  10573. HTT_RX_IND_RSSI_PRI20_S)
  10574. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  10575. do { \
  10576. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  10577. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  10578. } while (0)
  10579. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  10580. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  10581. HTT_RX_IND_RSSI_EXT20_S)
  10582. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  10583. do { \
  10584. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  10585. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  10586. } while (0)
  10587. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  10588. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  10589. HTT_RX_IND_RSSI_EXT40_S)
  10590. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  10591. do { \
  10592. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  10593. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  10594. } while (0)
  10595. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  10596. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  10597. HTT_RX_IND_RSSI_EXT80_S)
  10598. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  10599. do { \
  10600. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  10601. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  10602. } while (0)
  10603. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  10604. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  10605. HTT_RX_IND_VHT_SIG_A1_S)
  10606. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  10607. do { \
  10608. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  10609. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  10610. } while (0)
  10611. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  10612. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  10613. HTT_RX_IND_VHT_SIG_A2_S)
  10614. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  10615. do { \
  10616. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  10617. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  10618. } while (0)
  10619. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  10620. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  10621. HTT_RX_IND_PREAMBLE_TYPE_S)
  10622. #define HTT_RX_IND_SERVICE_SET(word, value) \
  10623. do { \
  10624. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  10625. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  10626. } while (0)
  10627. #define HTT_RX_IND_SERVICE_GET(word) \
  10628. (((word) & HTT_RX_IND_SERVICE_M) >> \
  10629. HTT_RX_IND_SERVICE_S)
  10630. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  10631. do { \
  10632. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  10633. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  10634. } while (0)
  10635. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  10636. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  10637. HTT_RX_IND_SA_ANT_MATRIX_S)
  10638. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  10639. do { \
  10640. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  10641. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  10642. } while (0)
  10643. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  10644. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  10645. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  10646. do { \
  10647. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  10648. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  10649. } while (0)
  10650. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  10651. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  10652. #define HTT_RX_IND_HL_BYTES \
  10653. (HTT_RX_IND_HDR_BYTES + \
  10654. 4 /* single FW rx MSDU descriptor */ + \
  10655. 4 /* single MPDU range information element */)
  10656. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  10657. /* Could we use one macro entry? */
  10658. #define HTT_WORD_SET(word, field, value) \
  10659. do { \
  10660. HTT_CHECK_SET_VAL(field, value); \
  10661. (word) |= ((value) << field ## _S); \
  10662. } while (0)
  10663. #define HTT_WORD_GET(word, field) \
  10664. (((word) & field ## _M) >> field ## _S)
  10665. PREPACK struct hl_htt_rx_ind_base {
  10666. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  10667. } POSTPACK;
  10668. /*
  10669. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  10670. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  10671. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  10672. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  10673. * htt_rx_ind_hl_rx_desc_t.
  10674. */
  10675. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  10676. struct htt_rx_ind_hl_rx_desc_t {
  10677. A_UINT8 ver;
  10678. A_UINT8 len;
  10679. struct {
  10680. A_UINT8
  10681. first_msdu: 1,
  10682. last_msdu: 1,
  10683. c3_failed: 1,
  10684. c4_failed: 1,
  10685. ipv6: 1,
  10686. tcp: 1,
  10687. udp: 1,
  10688. reserved: 1;
  10689. } flags;
  10690. /* NOTE: no reserved space - don't append any new fields here */
  10691. };
  10692. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  10693. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10694. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  10695. #define HTT_RX_IND_HL_RX_DESC_VER 0
  10696. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  10697. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10698. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  10699. #define HTT_RX_IND_HL_FLAG_OFFSET \
  10700. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10701. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  10702. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  10703. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  10704. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  10705. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  10706. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  10707. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  10708. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  10709. /* This structure is used in HL, the basic descriptor information
  10710. * used by host. the structure is translated by FW from HW desc
  10711. * or generated by FW. But in HL monitor mode, the host would use
  10712. * the same structure with LL.
  10713. */
  10714. PREPACK struct hl_htt_rx_desc_base {
  10715. A_UINT32
  10716. seq_num:12,
  10717. encrypted:1,
  10718. chan_info_present:1,
  10719. resv0:2,
  10720. mcast_bcast:1,
  10721. fragment:1,
  10722. key_id_oct:8,
  10723. resv1:6;
  10724. A_UINT32
  10725. pn_31_0;
  10726. union {
  10727. struct {
  10728. A_UINT16 pn_47_32;
  10729. A_UINT16 pn_63_48;
  10730. } pn16;
  10731. A_UINT32 pn_63_32;
  10732. } u0;
  10733. A_UINT32
  10734. pn_95_64;
  10735. A_UINT32
  10736. pn_127_96;
  10737. } POSTPACK;
  10738. /*
  10739. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  10740. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  10741. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  10742. * Please see htt_chan_change_t for description of the fields.
  10743. */
  10744. PREPACK struct htt_chan_info_t
  10745. {
  10746. A_UINT32 primary_chan_center_freq_mhz: 16,
  10747. contig_chan1_center_freq_mhz: 16;
  10748. A_UINT32 contig_chan2_center_freq_mhz: 16,
  10749. phy_mode: 8,
  10750. reserved: 8;
  10751. } POSTPACK;
  10752. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  10753. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  10754. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  10755. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  10756. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  10757. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  10758. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  10759. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  10760. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  10761. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  10762. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  10763. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  10764. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  10765. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  10766. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  10767. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  10768. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  10769. /* Channel information */
  10770. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  10771. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  10772. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  10773. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  10774. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  10775. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  10776. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  10777. #define HTT_CHAN_INFO_PHY_MODE_S 16
  10778. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  10779. do { \
  10780. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  10781. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  10782. } while (0)
  10783. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  10784. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  10785. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  10786. do { \
  10787. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  10788. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  10789. } while (0)
  10790. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  10791. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  10792. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  10793. do { \
  10794. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  10795. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  10796. } while (0)
  10797. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  10798. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  10799. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  10800. do { \
  10801. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  10802. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  10803. } while (0)
  10804. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  10805. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  10806. /*
  10807. * @brief target -> host message definition for FW offloaded pkts
  10808. *
  10809. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  10810. *
  10811. * @details
  10812. * The following field definitions describe the format of the firmware
  10813. * offload deliver message sent from the target to the host.
  10814. *
  10815. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  10816. *
  10817. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  10818. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  10819. * | reserved_1 | msg type |
  10820. * |--------------------------------------------------------------------------|
  10821. * | phy_timestamp_l32 |
  10822. * |--------------------------------------------------------------------------|
  10823. * | WORD2 (see below) |
  10824. * |--------------------------------------------------------------------------|
  10825. * | seqno | framectrl |
  10826. * |--------------------------------------------------------------------------|
  10827. * | reserved_3 | vdev_id | tid_num|
  10828. * |--------------------------------------------------------------------------|
  10829. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  10830. * |--------------------------------------------------------------------------|
  10831. *
  10832. * where:
  10833. * STAT = status
  10834. * F = format (802.3 vs. 802.11)
  10835. *
  10836. * definition for word 2
  10837. *
  10838. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  10839. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  10840. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  10841. * |--------------------------------------------------------------------------|
  10842. *
  10843. * where:
  10844. * PR = preamble
  10845. * BF = beamformed
  10846. */
  10847. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  10848. {
  10849. A_UINT32 /* word 0 */
  10850. msg_type:8, /* [ 7: 0] */
  10851. reserved_1:24; /* [31: 8] */
  10852. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  10853. A_UINT32 /* word 2 */
  10854. /* preamble:
  10855. * 0-OFDM,
  10856. * 1-CCk,
  10857. * 2-HT,
  10858. * 3-VHT
  10859. */
  10860. preamble: 2, /* [1:0] */
  10861. /* mcs:
  10862. * In case of HT preamble interpret
  10863. * MCS along with NSS.
  10864. * Valid values for HT are 0 to 7.
  10865. * HT mcs 0 with NSS 2 is mcs 8.
  10866. * Valid values for VHT are 0 to 9.
  10867. */
  10868. mcs: 4, /* [5:2] */
  10869. /* rate:
  10870. * This is applicable only for
  10871. * CCK and OFDM preamble type
  10872. * rate 0: OFDM 48 Mbps,
  10873. * 1: OFDM 24 Mbps,
  10874. * 2: OFDM 12 Mbps
  10875. * 3: OFDM 6 Mbps
  10876. * 4: OFDM 54 Mbps
  10877. * 5: OFDM 36 Mbps
  10878. * 6: OFDM 18 Mbps
  10879. * 7: OFDM 9 Mbps
  10880. * rate 0: CCK 11 Mbps Long
  10881. * 1: CCK 5.5 Mbps Long
  10882. * 2: CCK 2 Mbps Long
  10883. * 3: CCK 1 Mbps Long
  10884. * 4: CCK 11 Mbps Short
  10885. * 5: CCK 5.5 Mbps Short
  10886. * 6: CCK 2 Mbps Short
  10887. */
  10888. rate : 3, /* [ 8: 6] */
  10889. rssi : 8, /* [16: 9] units=dBm */
  10890. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10891. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10892. stbc : 1, /* [22] */
  10893. sgi : 1, /* [23] */
  10894. ldpc : 1, /* [24] */
  10895. beamformed: 1, /* [25] */
  10896. reserved_2: 6; /* [31:26] */
  10897. A_UINT32 /* word 3 */
  10898. framectrl:16, /* [15: 0] */
  10899. seqno:16; /* [31:16] */
  10900. A_UINT32 /* word 4 */
  10901. tid_num:5, /* [ 4: 0] actual TID number */
  10902. vdev_id:8, /* [12: 5] */
  10903. reserved_3:19; /* [31:13] */
  10904. A_UINT32 /* word 5 */
  10905. /* status:
  10906. * 0: tx_ok
  10907. * 1: retry
  10908. * 2: drop
  10909. * 3: filtered
  10910. * 4: abort
  10911. * 5: tid delete
  10912. * 6: sw abort
  10913. * 7: dropped by peer migration
  10914. */
  10915. status:3, /* [2:0] */
  10916. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  10917. tx_mpdu_bytes:16, /* [19:4] */
  10918. /* Indicates retry count of offloaded/local generated Data tx frames */
  10919. tx_retry_cnt:6, /* [25:20] */
  10920. reserved_4:6; /* [31:26] */
  10921. } POSTPACK;
  10922. /* FW offload deliver ind message header fields */
  10923. /* DWORD one */
  10924. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  10925. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  10926. /* DWORD two */
  10927. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  10928. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  10929. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  10930. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  10931. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  10932. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  10933. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  10934. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  10935. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  10936. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  10937. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  10938. #define HTT_FW_OFFLOAD_IND_BW_S 19
  10939. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  10940. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  10941. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  10942. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  10943. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  10944. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  10945. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  10946. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  10947. /* DWORD three*/
  10948. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  10949. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  10950. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  10951. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  10952. /* DWORD four */
  10953. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  10954. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  10955. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  10956. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  10957. /* DWORD five */
  10958. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10959. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10960. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10961. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10962. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10963. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10964. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10965. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10966. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10967. do { \
  10968. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10969. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10970. } while (0)
  10971. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10972. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10973. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10974. do { \
  10975. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10976. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10977. } while (0)
  10978. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10979. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10980. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10981. do { \
  10982. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10983. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10984. } while (0)
  10985. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10986. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10987. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10988. do { \
  10989. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10990. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10991. } while (0)
  10992. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10993. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  10994. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  10995. do { \
  10996. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  10997. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  10998. } while (0)
  10999. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  11000. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  11001. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  11002. do { \
  11003. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  11004. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  11005. } while (0)
  11006. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  11007. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  11008. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  11009. do { \
  11010. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  11011. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  11012. } while (0)
  11013. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  11014. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  11015. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  11016. do { \
  11017. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  11018. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  11019. } while (0)
  11020. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  11021. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  11022. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  11023. do { \
  11024. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  11025. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  11026. } while (0)
  11027. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  11028. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  11029. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  11030. do { \
  11031. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  11032. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  11033. } while (0)
  11034. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  11035. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  11036. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  11037. do { \
  11038. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  11039. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  11040. } while (0)
  11041. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  11042. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  11043. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  11044. do { \
  11045. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  11046. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  11047. } while (0)
  11048. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  11049. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  11050. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  11051. do { \
  11052. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  11053. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  11054. } while (0)
  11055. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  11056. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  11057. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  11058. do { \
  11059. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  11060. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  11061. } while (0)
  11062. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  11063. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  11064. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  11065. do { \
  11066. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  11067. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  11068. } while (0)
  11069. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  11070. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  11071. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  11072. do { \
  11073. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  11074. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  11075. } while (0)
  11076. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  11077. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  11078. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  11079. do { \
  11080. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  11081. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  11082. } while (0)
  11083. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  11084. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  11085. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  11086. do { \
  11087. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  11088. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  11089. } while (0)
  11090. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  11091. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  11092. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  11093. do { \
  11094. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  11095. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  11096. } while (0)
  11097. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  11098. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  11099. /*
  11100. * @brief target -> host rx reorder flush message definition
  11101. *
  11102. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  11103. *
  11104. * @details
  11105. * The following field definitions describe the format of the rx flush
  11106. * message sent from the target to the host.
  11107. * The message consists of a 4-octet header, followed by one or more
  11108. * 4-octet payload information elements.
  11109. *
  11110. * |31 24|23 8|7 0|
  11111. * |--------------------------------------------------------------|
  11112. * | TID | peer ID | msg type |
  11113. * |--------------------------------------------------------------|
  11114. * | seq num end | seq num start | MPDU status | reserved |
  11115. * |--------------------------------------------------------------|
  11116. * First DWORD:
  11117. * - MSG_TYPE
  11118. * Bits 7:0
  11119. * Purpose: identifies this as an rx flush message
  11120. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  11121. * - PEER_ID
  11122. * Bits 23:8 (only bits 18:8 actually used)
  11123. * Purpose: identify which peer's rx data is being flushed
  11124. * Value: (rx) peer ID
  11125. * - TID
  11126. * Bits 31:24 (only bits 27:24 actually used)
  11127. * Purpose: Specifies which traffic identifier's rx data is being flushed
  11128. * Value: traffic identifier
  11129. * Second DWORD:
  11130. * - MPDU_STATUS
  11131. * Bits 15:8
  11132. * Purpose:
  11133. * Indicate whether the flushed MPDUs should be discarded or processed.
  11134. * Value:
  11135. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  11136. * stages of rx processing
  11137. * other: discard the MPDUs
  11138. * It is anticipated that flush messages will always have
  11139. * MPDU status == 1, but the status flag is included for
  11140. * flexibility.
  11141. * - SEQ_NUM_START
  11142. * Bits 23:16
  11143. * Purpose:
  11144. * Indicate the start of a series of consecutive MPDUs being flushed.
  11145. * Not all MPDUs within this range are necessarily valid - the host
  11146. * must check each sequence number within this range to see if the
  11147. * corresponding MPDU is actually present.
  11148. * Value:
  11149. * The sequence number for the first MPDU in the sequence.
  11150. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11151. * - SEQ_NUM_END
  11152. * Bits 30:24
  11153. * Purpose:
  11154. * Indicate the end of a series of consecutive MPDUs being flushed.
  11155. * Value:
  11156. * The sequence number one larger than the sequence number of the
  11157. * last MPDU being flushed.
  11158. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11159. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  11160. * are to be released for further rx processing.
  11161. * Not all MPDUs within this range are necessarily valid - the host
  11162. * must check each sequence number within this range to see if the
  11163. * corresponding MPDU is actually present.
  11164. */
  11165. /* first DWORD */
  11166. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  11167. #define HTT_RX_FLUSH_PEER_ID_S 8
  11168. #define HTT_RX_FLUSH_TID_M 0xff000000
  11169. #define HTT_RX_FLUSH_TID_S 24
  11170. /* second DWORD */
  11171. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  11172. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  11173. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  11174. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  11175. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  11176. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  11177. #define HTT_RX_FLUSH_BYTES 8
  11178. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  11179. do { \
  11180. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  11181. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  11182. } while (0)
  11183. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  11184. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  11185. #define HTT_RX_FLUSH_TID_SET(word, value) \
  11186. do { \
  11187. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  11188. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  11189. } while (0)
  11190. #define HTT_RX_FLUSH_TID_GET(word) \
  11191. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  11192. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  11193. do { \
  11194. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  11195. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  11196. } while (0)
  11197. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  11198. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  11199. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  11200. do { \
  11201. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  11202. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  11203. } while (0)
  11204. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  11205. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  11206. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  11207. do { \
  11208. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  11209. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  11210. } while (0)
  11211. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  11212. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  11213. /*
  11214. * @brief target -> host rx pn check indication message
  11215. *
  11216. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  11217. *
  11218. * @details
  11219. * The following field definitions describe the format of the Rx PN check
  11220. * indication message sent from the target to the host.
  11221. * The message consists of a 4-octet header, followed by the start and
  11222. * end sequence numbers to be released, followed by the PN IEs. Each PN
  11223. * IE is one octet containing the sequence number that failed the PN
  11224. * check.
  11225. *
  11226. * |31 24|23 8|7 0|
  11227. * |--------------------------------------------------------------|
  11228. * | TID | peer ID | msg type |
  11229. * |--------------------------------------------------------------|
  11230. * | Reserved | PN IE count | seq num end | seq num start|
  11231. * |--------------------------------------------------------------|
  11232. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  11233. * |--------------------------------------------------------------|
  11234. * First DWORD:
  11235. * - MSG_TYPE
  11236. * Bits 7:0
  11237. * Purpose: Identifies this as an rx pn check indication message
  11238. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  11239. * - PEER_ID
  11240. * Bits 23:8 (only bits 18:8 actually used)
  11241. * Purpose: identify which peer
  11242. * Value: (rx) peer ID
  11243. * - TID
  11244. * Bits 31:24 (only bits 27:24 actually used)
  11245. * Purpose: identify traffic identifier
  11246. * Value: traffic identifier
  11247. * Second DWORD:
  11248. * - SEQ_NUM_START
  11249. * Bits 7:0
  11250. * Purpose:
  11251. * Indicates the starting sequence number of the MPDU in this
  11252. * series of MPDUs that went though PN check.
  11253. * Value:
  11254. * The sequence number for the first MPDU in the sequence.
  11255. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11256. * - SEQ_NUM_END
  11257. * Bits 15:8
  11258. * Purpose:
  11259. * Indicates the ending sequence number of the MPDU in this
  11260. * series of MPDUs that went though PN check.
  11261. * Value:
  11262. * The sequence number one larger then the sequence number of the last
  11263. * MPDU being flushed.
  11264. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11265. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  11266. * for invalid PN numbers and are ready to be released for further processing.
  11267. * Not all MPDUs within this range are necessarily valid - the host
  11268. * must check each sequence number within this range to see if the
  11269. * corresponding MPDU is actually present.
  11270. * - PN_IE_COUNT
  11271. * Bits 23:16
  11272. * Purpose:
  11273. * Used to determine the variable number of PN information elements in this
  11274. * message
  11275. *
  11276. * PN information elements:
  11277. * - PN_IE_x-
  11278. * Purpose:
  11279. * Each PN information element contains the sequence number of the MPDU that
  11280. * has failed the target PN check.
  11281. * Value:
  11282. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  11283. * that failed the PN check.
  11284. */
  11285. /* first DWORD */
  11286. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  11287. #define HTT_RX_PN_IND_PEER_ID_S 8
  11288. #define HTT_RX_PN_IND_TID_M 0xff000000
  11289. #define HTT_RX_PN_IND_TID_S 24
  11290. /* second DWORD */
  11291. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  11292. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  11293. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  11294. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  11295. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  11296. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  11297. #define HTT_RX_PN_IND_BYTES 8
  11298. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  11299. do { \
  11300. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  11301. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  11302. } while (0)
  11303. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  11304. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  11305. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  11306. do { \
  11307. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  11308. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  11309. } while (0)
  11310. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  11311. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  11312. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  11313. do { \
  11314. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  11315. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  11316. } while (0)
  11317. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  11318. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  11319. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  11320. do { \
  11321. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  11322. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  11323. } while (0)
  11324. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  11325. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  11326. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  11327. do { \
  11328. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  11329. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  11330. } while (0)
  11331. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  11332. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  11333. /*
  11334. * @brief target -> host rx offload deliver message for LL system
  11335. *
  11336. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  11337. *
  11338. * @details
  11339. * In a low latency system this message is sent whenever the offload
  11340. * manager flushes out the packets it has coalesced in its coalescing buffer.
  11341. * The DMA of the actual packets into host memory is done before sending out
  11342. * this message. This message indicates only how many MSDUs to reap. The
  11343. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  11344. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  11345. * DMA'd by the MAC directly into host memory these packets do not contain
  11346. * the MAC descriptors in the header portion of the packet. Instead they contain
  11347. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  11348. * message, the packets are delivered directly to the NW stack without going
  11349. * through the regular reorder buffering and PN checking path since it has
  11350. * already been done in target.
  11351. *
  11352. * |31 24|23 16|15 8|7 0|
  11353. * |-----------------------------------------------------------------------|
  11354. * | Total MSDU count | reserved | msg type |
  11355. * |-----------------------------------------------------------------------|
  11356. *
  11357. * @brief target -> host rx offload deliver message for HL system
  11358. *
  11359. * @details
  11360. * In a high latency system this message is sent whenever the offload manager
  11361. * flushes out the packets it has coalesced in its coalescing buffer. The
  11362. * actual packets are also carried along with this message. When the host
  11363. * receives this message, it is expected to deliver these packets to the NW
  11364. * stack directly instead of routing them through the reorder buffering and
  11365. * PN checking path since it has already been done in target.
  11366. *
  11367. * |31 24|23 16|15 8|7 0|
  11368. * |-----------------------------------------------------------------------|
  11369. * | Total MSDU count | reserved | msg type |
  11370. * |-----------------------------------------------------------------------|
  11371. * | peer ID | MSDU length |
  11372. * |-----------------------------------------------------------------------|
  11373. * | MSDU payload | FW Desc | tid | vdev ID |
  11374. * |-----------------------------------------------------------------------|
  11375. * | MSDU payload contd. |
  11376. * |-----------------------------------------------------------------------|
  11377. * | peer ID | MSDU length |
  11378. * |-----------------------------------------------------------------------|
  11379. * | MSDU payload | FW Desc | tid | vdev ID |
  11380. * |-----------------------------------------------------------------------|
  11381. * | MSDU payload contd. |
  11382. * |-----------------------------------------------------------------------|
  11383. *
  11384. */
  11385. /* first DWORD */
  11386. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  11387. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  11388. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  11389. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  11390. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  11391. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  11392. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  11393. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  11394. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  11395. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  11396. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  11397. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  11398. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  11399. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  11400. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  11401. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  11402. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  11403. do { \
  11404. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  11405. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  11406. } while (0)
  11407. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  11408. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  11409. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  11410. do { \
  11411. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  11412. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  11413. } while (0)
  11414. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  11415. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  11416. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  11417. do { \
  11418. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  11419. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  11420. } while (0)
  11421. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  11422. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  11423. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  11424. do { \
  11425. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  11426. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  11427. } while (0)
  11428. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  11429. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  11430. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  11431. do { \
  11432. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  11433. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  11434. } while (0)
  11435. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  11436. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  11437. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  11438. do { \
  11439. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  11440. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  11441. } while (0)
  11442. /**
  11443. * @brief target -> host rx peer map/unmap message definition
  11444. *
  11445. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  11446. *
  11447. * @details
  11448. * The following diagram shows the format of the rx peer map message sent
  11449. * from the target to the host. This layout assumes the target operates
  11450. * as little-endian.
  11451. *
  11452. * This message always contains a SW peer ID. The main purpose of the
  11453. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11454. * with, so that the host can use that peer ID to determine which peer
  11455. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11456. * other purposes, such as identifying during tx completions which peer
  11457. * the tx frames in question were transmitted to.
  11458. *
  11459. * In certain generations of chips, the peer map message also contains
  11460. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  11461. * to identify which peer the frame needs to be forwarded to (i.e. the
  11462. * peer associated with the Destination MAC Address within the packet),
  11463. * and particularly which vdev needs to transmit the frame (for cases
  11464. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  11465. * meaning as AST_INDEX_0.
  11466. * This DA-based peer ID that is provided for certain rx frames
  11467. * (the rx frames that need to be re-transmitted as tx frames)
  11468. * is the ID that the HW uses for referring to the peer in question,
  11469. * rather than the peer ID that the SW+FW use to refer to the peer.
  11470. *
  11471. *
  11472. * |31 24|23 16|15 8|7 0|
  11473. * |-----------------------------------------------------------------------|
  11474. * | SW peer ID | VDEV ID | msg type |
  11475. * |-----------------------------------------------------------------------|
  11476. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11477. * |-----------------------------------------------------------------------|
  11478. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11479. * |-----------------------------------------------------------------------|
  11480. *
  11481. *
  11482. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  11483. *
  11484. * The following diagram shows the format of the rx peer unmap message sent
  11485. * from the target to the host.
  11486. *
  11487. * |31 24|23 16|15 8|7 0|
  11488. * |-----------------------------------------------------------------------|
  11489. * | SW peer ID | VDEV ID | msg type |
  11490. * |-----------------------------------------------------------------------|
  11491. *
  11492. * The following field definitions describe the format of the rx peer map
  11493. * and peer unmap messages sent from the target to the host.
  11494. * - MSG_TYPE
  11495. * Bits 7:0
  11496. * Purpose: identifies this as an rx peer map or peer unmap message
  11497. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  11498. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  11499. * - VDEV_ID
  11500. * Bits 15:8
  11501. * Purpose: Indicates which virtual device the peer is associated
  11502. * with.
  11503. * Value: vdev ID (used in the host to look up the vdev object)
  11504. * - PEER_ID (a.k.a. SW_PEER_ID)
  11505. * Bits 31:16
  11506. * Purpose: The peer ID (index) that WAL is allocating (map) or
  11507. * freeing (unmap)
  11508. * Value: (rx) peer ID
  11509. * - MAC_ADDR_L32 (peer map only)
  11510. * Bits 31:0
  11511. * Purpose: Identifies which peer node the peer ID is for.
  11512. * Value: lower 4 bytes of peer node's MAC address
  11513. * - MAC_ADDR_U16 (peer map only)
  11514. * Bits 15:0
  11515. * Purpose: Identifies which peer node the peer ID is for.
  11516. * Value: upper 2 bytes of peer node's MAC address
  11517. * - HW_PEER_ID
  11518. * Bits 31:16
  11519. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11520. * address, so for rx frames marked for rx --> tx forwarding, the
  11521. * host can determine from the HW peer ID provided as meta-data with
  11522. * the rx frame which peer the frame is supposed to be forwarded to.
  11523. * Value: ID used by the MAC HW to identify the peer
  11524. */
  11525. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  11526. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  11527. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  11528. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  11529. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  11530. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  11531. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11532. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  11533. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  11534. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  11535. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  11536. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  11537. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  11538. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  11539. do { \
  11540. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  11541. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  11542. } while (0)
  11543. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  11544. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  11545. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  11546. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  11547. do { \
  11548. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  11549. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  11550. } while (0)
  11551. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  11552. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  11553. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  11554. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  11555. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  11556. do { \
  11557. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  11558. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  11559. } while (0)
  11560. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  11561. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  11562. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11563. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  11564. #define HTT_RX_PEER_MAP_BYTES 12
  11565. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  11566. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  11567. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  11568. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  11569. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  11570. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  11571. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  11572. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  11573. #define HTT_RX_PEER_UNMAP_BYTES 4
  11574. /**
  11575. * @brief target -> host rx peer map V2 message definition
  11576. *
  11577. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  11578. *
  11579. * @details
  11580. * The following diagram shows the format of the rx peer map v2 message sent
  11581. * from the target to the host. This layout assumes the target operates
  11582. * as little-endian.
  11583. *
  11584. * This message always contains a SW peer ID. The main purpose of the
  11585. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11586. * with, so that the host can use that peer ID to determine which peer
  11587. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11588. * other purposes, such as identifying during tx completions which peer
  11589. * the tx frames in question were transmitted to.
  11590. *
  11591. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  11592. * is used during rx --> tx frame forwarding to identify which peer the
  11593. * frame needs to be forwarded to (i.e. the peer associated with the
  11594. * Destination MAC Address within the packet), and particularly which vdev
  11595. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  11596. * This DA-based peer ID that is provided for certain rx frames
  11597. * (the rx frames that need to be re-transmitted as tx frames)
  11598. * is the ID that the HW uses for referring to the peer in question,
  11599. * rather than the peer ID that the SW+FW use to refer to the peer.
  11600. *
  11601. * The HW peer id here is the same meaning as AST_INDEX_0.
  11602. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  11603. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  11604. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  11605. * AST is valid.
  11606. *
  11607. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  11608. * |-------------------------------------------------------------------------|
  11609. * | SW peer ID | VDEV ID | msg type |
  11610. * |-------------------------------------------------------------------------|
  11611. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11612. * |-------------------------------------------------------------------------|
  11613. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11614. * |-------------------------------------------------------------------------|
  11615. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  11616. * |-------------------------------------------------------------------------|
  11617. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  11618. * |-------------------------------------------------------------------------|
  11619. * |TID valid low pri| TID valid hi pri | AST index 2 |
  11620. * |-------------------------------------------------------------------------|
  11621. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  11622. * |-------------------------------------------------------------------------|
  11623. * | Reserved_2 |
  11624. * |-------------------------------------------------------------------------|
  11625. * Where:
  11626. * NH = Next Hop
  11627. * ASTVM = AST valid mask
  11628. * OA = on-chip AST valid bit
  11629. * ASTFM = AST flow mask
  11630. *
  11631. * The following field definitions describe the format of the rx peer map v2
  11632. * messages sent from the target to the host.
  11633. * - MSG_TYPE
  11634. * Bits 7:0
  11635. * Purpose: identifies this as an rx peer map v2 message
  11636. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  11637. * - VDEV_ID
  11638. * Bits 15:8
  11639. * Purpose: Indicates which virtual device the peer is associated with.
  11640. * Value: vdev ID (used in the host to look up the vdev object)
  11641. * - SW_PEER_ID
  11642. * Bits 31:16
  11643. * Purpose: The peer ID (index) that WAL is allocating
  11644. * Value: (rx) peer ID
  11645. * - MAC_ADDR_L32
  11646. * Bits 31:0
  11647. * Purpose: Identifies which peer node the peer ID is for.
  11648. * Value: lower 4 bytes of peer node's MAC address
  11649. * - MAC_ADDR_U16
  11650. * Bits 15:0
  11651. * Purpose: Identifies which peer node the peer ID is for.
  11652. * Value: upper 2 bytes of peer node's MAC address
  11653. * - HW_PEER_ID / AST_INDEX_0
  11654. * Bits 31:16
  11655. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11656. * address, so for rx frames marked for rx --> tx forwarding, the
  11657. * host can determine from the HW peer ID provided as meta-data with
  11658. * the rx frame which peer the frame is supposed to be forwarded to.
  11659. * Value: ID used by the MAC HW to identify the peer
  11660. * - AST_HASH_VALUE
  11661. * Bits 15:0
  11662. * Purpose: Indicates AST Hash value is required for the TCL AST index
  11663. * override feature.
  11664. * - NEXT_HOP
  11665. * Bit 16
  11666. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  11667. * (Wireless Distribution System).
  11668. * - AST_VALID_MASK
  11669. * Bits 19:17
  11670. * Purpose: Indicate if the AST 1 through AST 3 are valid
  11671. * - ONCHIP_AST_VALID_FLAG
  11672. * Bit 20
  11673. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  11674. * is valid.
  11675. * - AST_INDEX_1
  11676. * Bits 15:0
  11677. * Purpose: indicate the second AST index for this peer
  11678. * - AST_0_FLOW_MASK
  11679. * Bits 19:16
  11680. * Purpose: identify the which flow the AST 0 entry corresponds to.
  11681. * - AST_1_FLOW_MASK
  11682. * Bits 23:20
  11683. * Purpose: identify the which flow the AST 1 entry corresponds to.
  11684. * - AST_2_FLOW_MASK
  11685. * Bits 27:24
  11686. * Purpose: identify the which flow the AST 2 entry corresponds to.
  11687. * - AST_3_FLOW_MASK
  11688. * Bits 31:28
  11689. * Purpose: identify the which flow the AST 3 entry corresponds to.
  11690. * - AST_INDEX_2
  11691. * Bits 15:0
  11692. * Purpose: indicate the third AST index for this peer
  11693. * - TID_VALID_HI_PRI
  11694. * Bits 23:16
  11695. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  11696. * - TID_VALID_LOW_PRI
  11697. * Bits 31:24
  11698. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  11699. * - AST_INDEX_3
  11700. * Bits 15:0
  11701. * Purpose: indicate the fourth AST index for this peer
  11702. * - ONCHIP_AST_IDX / RESERVED
  11703. * Bits 31:16
  11704. * Purpose: This field is valid only when split AST feature is enabled.
  11705. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  11706. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11707. * address, this ast_idx is used for LMAC modules for RXPCU.
  11708. * Value: ID used by the LMAC HW to identify the peer
  11709. */
  11710. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  11711. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  11712. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  11713. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  11714. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  11715. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  11716. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  11717. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  11718. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  11719. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  11720. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  11721. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  11722. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  11723. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  11724. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  11725. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  11726. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  11727. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  11728. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  11729. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  11730. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  11731. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  11732. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  11733. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  11734. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  11735. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  11736. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  11737. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  11738. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  11739. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  11740. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  11741. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  11742. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  11743. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  11744. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  11745. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  11746. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  11747. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  11748. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  11749. do { \
  11750. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  11751. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  11752. } while (0)
  11753. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  11754. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  11755. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  11756. do { \
  11757. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  11758. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  11759. } while (0)
  11760. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  11761. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  11762. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  11763. do { \
  11764. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  11765. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  11766. } while (0)
  11767. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  11768. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  11769. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  11770. do { \
  11771. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  11772. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  11773. } while (0)
  11774. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  11775. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  11776. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  11777. do { \
  11778. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  11779. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  11780. } while (0)
  11781. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  11782. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  11783. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  11784. do { \
  11785. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  11786. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  11787. } while (0)
  11788. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  11789. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  11790. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  11791. do { \
  11792. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  11793. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  11794. } while (0)
  11795. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  11796. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  11797. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11798. do { \
  11799. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  11800. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  11801. } while (0)
  11802. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  11803. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  11804. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  11805. do { \
  11806. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  11807. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  11808. } while (0)
  11809. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  11810. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  11811. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  11812. do { \
  11813. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  11814. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  11815. } while (0)
  11816. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  11817. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  11818. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  11819. do { \
  11820. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  11821. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  11822. } while (0)
  11823. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  11824. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  11825. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  11826. do { \
  11827. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  11828. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  11829. } while (0)
  11830. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  11831. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  11832. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  11833. do { \
  11834. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  11835. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  11836. } while (0)
  11837. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  11838. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  11839. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  11840. do { \
  11841. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  11842. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  11843. } while (0)
  11844. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  11845. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  11846. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  11847. do { \
  11848. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  11849. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  11850. } while (0)
  11851. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  11852. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  11853. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  11854. do { \
  11855. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  11856. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  11857. } while (0)
  11858. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  11859. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  11860. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  11861. do { \
  11862. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  11863. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  11864. } while (0)
  11865. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  11866. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  11867. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11868. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  11869. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  11870. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  11871. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  11872. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  11873. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  11874. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  11875. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  11876. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  11877. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  11878. #define HTT_RX_PEER_MAP_V2_BYTES 32
  11879. /**
  11880. * @brief target -> host rx peer map V3 message definition
  11881. *
  11882. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  11883. *
  11884. * @details
  11885. * The following diagram shows the format of the rx peer map v3 message sent
  11886. * from the target to the host.
  11887. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  11888. * This layout assumes the target operates as little-endian.
  11889. *
  11890. * |31 24|23 20|19|18|17|16|15 8|7 0|
  11891. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  11892. * | SW peer ID | VDEV ID | msg type |
  11893. * |-----------------+--------------------+-----------------+-----------------|
  11894. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11895. * |-----------------+--------------------+-----------------+-----------------|
  11896. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  11897. * |-----------------+--------+-----------+-----------------+-----------------|
  11898. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  11899. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  11900. * | (8bits) | | (4bits) | |
  11901. * |-----------------+--------+--+--+--+--------------------------------------|
  11902. * | RESERVED |E |O | | |
  11903. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  11904. * | |V |V | | |
  11905. * |-----------------+--------------------+-----------------------------------|
  11906. * | HTT_MSDU_IDX_ | RESERVED | |
  11907. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  11908. * | (8bits) | | |
  11909. * |-----------------+--------------------+-----------------------------------|
  11910. * | Reserved_2 |
  11911. * |--------------------------------------------------------------------------|
  11912. * | Reserved_3 |
  11913. * |--------------------------------------------------------------------------|
  11914. *
  11915. * Where:
  11916. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  11917. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  11918. * NH = Next Hop
  11919. * The following field definitions describe the format of the rx peer map v3
  11920. * messages sent from the target to the host.
  11921. * - MSG_TYPE
  11922. * Bits 7:0
  11923. * Purpose: identifies this as a peer map v3 message
  11924. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  11925. * - VDEV_ID
  11926. * Bits 15:8
  11927. * Purpose: Indicates which virtual device the peer is associated with.
  11928. * - SW_PEER_ID
  11929. * Bits 31:16
  11930. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  11931. * - MAC_ADDR_L32
  11932. * Bits 31:0
  11933. * Purpose: Identifies which peer node the peer ID is for.
  11934. * Value: lower 4 bytes of peer node's MAC address
  11935. * - MAC_ADDR_U16
  11936. * Bits 15:0
  11937. * Purpose: Identifies which peer node the peer ID is for.
  11938. * Value: upper 2 bytes of peer node's MAC address
  11939. * - MULTICAST_SW_PEER_ID
  11940. * Bits 31:16
  11941. * Purpose: The multicast peer ID (index)
  11942. * Value: set to HTT_INVALID_PEER if not valid
  11943. * - HW_PEER_ID / AST_INDEX
  11944. * Bits 15:0
  11945. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11946. * address, so for rx frames marked for rx --> tx forwarding, the
  11947. * host can determine from the HW peer ID provided as meta-data with
  11948. * the rx frame which peer the frame is supposed to be forwarded to.
  11949. * - CACHE_SET_NUM
  11950. * Bits 19:16
  11951. * Purpose: Cache Set Number for AST_INDEX
  11952. * Cache set number that should be used to cache the index based
  11953. * search results, for address and flow search.
  11954. * This value should be equal to LSB 4 bits of the hash value
  11955. * of match data, in case of search index points to an entry which
  11956. * may be used in content based search also. The value can be
  11957. * anything when the entry pointed by search index will not be
  11958. * used for content based search.
  11959. * - HTT_MSDU_IDX_VALID_MASK
  11960. * Bits 31:24
  11961. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11962. * - ONCHIP_AST_IDX / RESERVED
  11963. * Bits 15:0
  11964. * Purpose: This field is valid only when split AST feature is enabled.
  11965. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11966. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11967. * address, this ast_idx is used for LMAC modules for RXPCU.
  11968. * - NEXT_HOP
  11969. * Bits 16
  11970. * Purpose: Flag indicates next_hop AST entry used for WDS
  11971. * (Wireless Distribution System).
  11972. * - ONCHIP_AST_VALID
  11973. * Bits 17
  11974. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11975. * - EXT_AST_VALID
  11976. * Bits 18
  11977. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11978. * - EXT_AST_INDEX
  11979. * Bits 15:0
  11980. * Purpose: This field describes Extended AST index
  11981. * Valid if EXT_AST_VALID flag set
  11982. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11983. * Bits 31:24
  11984. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11985. */
  11986. /* dword 0 */
  11987. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11988. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11989. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11990. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11991. /* dword 1 */
  11992. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11993. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  11994. /* dword 2 */
  11995. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  11996. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  11997. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  11998. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  11999. /* dword 3 */
  12000. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  12001. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  12002. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  12003. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  12004. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  12005. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  12006. /* dword 4 */
  12007. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  12008. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  12009. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  12010. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  12011. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  12012. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  12013. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  12014. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  12015. /* dword 5 */
  12016. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  12017. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  12018. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  12019. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  12020. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  12021. do { \
  12022. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  12023. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  12024. } while (0)
  12025. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  12026. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  12027. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  12028. do { \
  12029. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  12030. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  12031. } while (0)
  12032. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  12033. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  12034. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  12035. do { \
  12036. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  12037. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  12038. } while (0)
  12039. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  12040. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  12041. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  12042. do { \
  12043. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  12044. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  12045. } while (0)
  12046. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  12047. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  12048. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  12049. do { \
  12050. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  12051. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  12052. } while (0)
  12053. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  12054. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  12055. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  12056. do { \
  12057. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  12058. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  12059. } while (0)
  12060. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  12061. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  12062. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  12063. do { \
  12064. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  12065. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  12066. } while (0)
  12067. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  12068. (((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)
  12069. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  12070. do { \
  12071. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  12072. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  12073. } while (0)
  12074. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  12075. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  12076. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  12077. do { \
  12078. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  12079. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  12080. } while (0)
  12081. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  12082. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  12083. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  12084. do { \
  12085. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  12086. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  12087. } while (0)
  12088. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  12089. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  12090. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  12091. do { \
  12092. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  12093. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  12094. } while (0)
  12095. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  12096. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  12097. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  12098. do { \
  12099. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  12100. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  12101. } while (0)
  12102. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  12103. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  12104. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  12105. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  12106. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  12107. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  12108. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  12109. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  12110. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  12111. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  12112. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  12113. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  12114. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  12115. #define HTT_RX_PEER_MAP_V3_BYTES 32
  12116. /**
  12117. * @brief target -> host rx peer unmap V2 message definition
  12118. *
  12119. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  12120. *
  12121. * The following diagram shows the format of the rx peer unmap message sent
  12122. * from the target to the host.
  12123. *
  12124. * |31 24|23 16|15 8|7 0|
  12125. * |-----------------------------------------------------------------------|
  12126. * | SW peer ID | VDEV ID | msg type |
  12127. * |-----------------------------------------------------------------------|
  12128. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12129. * |-----------------------------------------------------------------------|
  12130. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  12131. * |-----------------------------------------------------------------------|
  12132. * | Peer Delete Duration |
  12133. * |-----------------------------------------------------------------------|
  12134. * | Reserved_0 | WDS Free Count |
  12135. * |-----------------------------------------------------------------------|
  12136. * | Reserved_1 |
  12137. * |-----------------------------------------------------------------------|
  12138. * | Reserved_2 |
  12139. * |-----------------------------------------------------------------------|
  12140. *
  12141. *
  12142. * The following field definitions describe the format of the rx peer unmap
  12143. * messages sent from the target to the host.
  12144. * - MSG_TYPE
  12145. * Bits 7:0
  12146. * Purpose: identifies this as an rx peer unmap v2 message
  12147. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  12148. * - VDEV_ID
  12149. * Bits 15:8
  12150. * Purpose: Indicates which virtual device the peer is associated
  12151. * with.
  12152. * Value: vdev ID (used in the host to look up the vdev object)
  12153. * - SW_PEER_ID
  12154. * Bits 31:16
  12155. * Purpose: The peer ID (index) that WAL is freeing
  12156. * Value: (rx) peer ID
  12157. * - MAC_ADDR_L32
  12158. * Bits 31:0
  12159. * Purpose: Identifies which peer node the peer ID is for.
  12160. * Value: lower 4 bytes of peer node's MAC address
  12161. * - MAC_ADDR_U16
  12162. * Bits 15:0
  12163. * Purpose: Identifies which peer node the peer ID is for.
  12164. * Value: upper 2 bytes of peer node's MAC address
  12165. * - NEXT_HOP
  12166. * Bits 16
  12167. * Purpose: Bit indicates next_hop AST entry used for WDS
  12168. * (Wireless Distribution System).
  12169. * - PEER_DELETE_DURATION
  12170. * Bits 31:0
  12171. * Purpose: Time taken to delete peer, in msec,
  12172. * Used for monitoring / debugging PEER delete response delay
  12173. * - PEER_WDS_FREE_COUNT
  12174. * Bits 15:0
  12175. * Purpose: Count of WDS entries deleted associated to peer deleted
  12176. */
  12177. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  12178. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  12179. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  12180. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  12181. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  12182. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  12183. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  12184. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  12185. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  12186. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  12187. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  12188. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  12189. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  12190. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  12191. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  12192. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  12193. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  12194. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  12195. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  12196. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  12197. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  12198. do { \
  12199. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  12200. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  12201. } while (0)
  12202. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  12203. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  12204. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  12205. do { \
  12206. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  12207. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  12208. } while (0)
  12209. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  12210. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  12211. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  12212. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  12213. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  12214. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  12215. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  12216. /**
  12217. * @brief target -> host rx peer mlo map message definition
  12218. *
  12219. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  12220. *
  12221. * @details
  12222. * The following diagram shows the format of the rx mlo peer map message sent
  12223. * from the target to the host. This layout assumes the target operates
  12224. * as little-endian.
  12225. *
  12226. * MCC:
  12227. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  12228. *
  12229. * WIN:
  12230. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  12231. * It will be sent on the Assoc Link.
  12232. *
  12233. * This message always contains a MLO peer ID. The main purpose of the
  12234. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  12235. * with, so that the host can use that MLO peer ID to determine which peer
  12236. * transmitted the rx frame.
  12237. *
  12238. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  12239. * |-------------------------------------------------------------------------|
  12240. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  12241. * |-------------------------------------------------------------------------|
  12242. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12243. * |-------------------------------------------------------------------------|
  12244. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  12245. * |-------------------------------------------------------------------------|
  12246. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  12247. * |-------------------------------------------------------------------------|
  12248. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  12249. * |-------------------------------------------------------------------------|
  12250. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  12251. * |-------------------------------------------------------------------------|
  12252. * |RSVD |
  12253. * |-------------------------------------------------------------------------|
  12254. * |RSVD |
  12255. * |-------------------------------------------------------------------------|
  12256. * | htt_tlv_hdr_t |
  12257. * |-------------------------------------------------------------------------|
  12258. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12259. * |-------------------------------------------------------------------------|
  12260. * | htt_tlv_hdr_t |
  12261. * |-------------------------------------------------------------------------|
  12262. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12263. * |-------------------------------------------------------------------------|
  12264. * | htt_tlv_hdr_t |
  12265. * |-------------------------------------------------------------------------|
  12266. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12267. * |-------------------------------------------------------------------------|
  12268. *
  12269. * Where:
  12270. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  12271. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  12272. * V (valid) - 1 Bit Bit17
  12273. * CHIPID - 3 Bits
  12274. * TIDMASK - 8 Bits
  12275. * CACHE_SET_NUM - 8 Bits
  12276. *
  12277. * The following field definitions describe the format of the rx MLO peer map
  12278. * messages sent from the target to the host.
  12279. * - MSG_TYPE
  12280. * Bits 7:0
  12281. * Purpose: identifies this as an rx mlo peer map message
  12282. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  12283. *
  12284. * - MLO_PEER_ID
  12285. * Bits 23:8
  12286. * Purpose: The MLO peer ID (index).
  12287. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  12288. * Value: MLO peer ID
  12289. *
  12290. * - NUMLINK
  12291. * Bits: 26:24 (3Bits)
  12292. * Purpose: Indicate the max number of logical links supported per client.
  12293. * Value: number of logical links
  12294. *
  12295. * - PRC
  12296. * Bits: 29:27 (3Bits)
  12297. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  12298. * if there is migration of the primary chip.
  12299. * Value: Primary REO CHIPID
  12300. *
  12301. * - MAC_ADDR_L32
  12302. * Bits 31:0
  12303. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  12304. * Value: lower 4 bytes of peer node's MAC address
  12305. *
  12306. * - MAC_ADDR_U16
  12307. * Bits 15:0
  12308. * Purpose: Identifies which peer node the peer ID is for.
  12309. * Value: upper 2 bytes of peer node's MAC address
  12310. *
  12311. * - PRIMARY_TCL_AST_IDX
  12312. * Bits 15:0
  12313. * Purpose: Primary TCL AST index for this peer.
  12314. *
  12315. * - V
  12316. * 1 Bit Position 16
  12317. * Purpose: If the ast idx is valid.
  12318. *
  12319. * - CHIPID
  12320. * Bits 19:17
  12321. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  12322. *
  12323. * - TIDMASK
  12324. * Bits 27:20
  12325. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  12326. *
  12327. * - CACHE_SET_NUM
  12328. * Bits 31:28
  12329. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  12330. * Cache set number that should be used to cache the index based
  12331. * search results, for address and flow search.
  12332. * This value should be equal to LSB four bits of the hash value
  12333. * of match data, in case of search index points to an entry which
  12334. * may be used in content based search also. The value can be
  12335. * anything when the entry pointed by search index will not be
  12336. * used for content based search.
  12337. *
  12338. * - htt_tlv_hdr_t
  12339. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  12340. *
  12341. * Bits 11:0
  12342. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  12343. *
  12344. * Bits 23:12
  12345. * Purpose: Length, Length of the value that follows the header
  12346. *
  12347. * Bits 31:28
  12348. * Purpose: Reserved.
  12349. *
  12350. *
  12351. * - SW_PEER_ID
  12352. * Bits 15:0
  12353. * Purpose: The peer ID (index) that WAL is allocating
  12354. * Value: (rx) peer ID
  12355. *
  12356. * - VDEV_ID
  12357. * Bits 23:16
  12358. * Purpose: Indicates which virtual device the peer is associated with.
  12359. * Value: vdev ID (used in the host to look up the vdev object)
  12360. *
  12361. * - CHIPID
  12362. * Bits 26:24
  12363. * Purpose: Indicates which Chip id the peer is associated with.
  12364. * Value: chip ID (Provided by Host as part of QMI exchange)
  12365. */
  12366. typedef enum {
  12367. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  12368. } MLO_PEER_MAP_TLV_TAG_ID;
  12369. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  12370. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  12371. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  12372. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  12373. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  12374. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  12375. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  12376. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  12377. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  12378. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  12379. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  12380. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  12381. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  12382. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  12383. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  12384. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  12385. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  12386. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  12387. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  12388. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  12389. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  12390. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  12391. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  12392. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  12393. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  12394. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  12395. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  12396. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  12397. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  12398. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  12399. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  12400. do { \
  12401. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  12402. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  12403. } while (0)
  12404. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  12405. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  12406. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  12407. do { \
  12408. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  12409. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  12410. } while (0)
  12411. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  12412. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  12413. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  12414. do { \
  12415. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  12416. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  12417. } while (0)
  12418. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  12419. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  12420. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  12421. do { \
  12422. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  12423. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  12424. } while (0)
  12425. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  12426. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  12427. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  12428. do { \
  12429. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  12430. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  12431. } while (0)
  12432. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  12433. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  12434. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  12435. do { \
  12436. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  12437. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  12438. } while (0)
  12439. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  12440. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  12441. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  12442. do { \
  12443. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  12444. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  12445. } while (0)
  12446. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  12447. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  12448. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  12449. do { \
  12450. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  12451. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  12452. } while (0)
  12453. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  12454. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  12455. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  12456. do { \
  12457. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  12458. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  12459. } while (0)
  12460. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  12461. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  12462. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  12463. do { \
  12464. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  12465. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  12466. } while (0)
  12467. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  12468. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  12469. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  12470. do { \
  12471. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  12472. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  12473. } while (0)
  12474. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  12475. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  12476. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  12477. do { \
  12478. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  12479. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  12480. } while (0)
  12481. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  12482. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  12483. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  12484. do { \
  12485. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  12486. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  12487. } while (0)
  12488. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  12489. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  12490. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  12491. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  12492. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  12493. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  12494. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  12495. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  12496. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  12497. *
  12498. * The following diagram shows the format of the rx mlo peer unmap message sent
  12499. * from the target to the host.
  12500. *
  12501. * |31 24|23 16|15 8|7 0|
  12502. * |-----------------------------------------------------------------------|
  12503. * | RSVD_24_31 | MLO peer ID | msg type |
  12504. * |-----------------------------------------------------------------------|
  12505. */
  12506. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  12507. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  12508. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  12509. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  12510. /**
  12511. * @brief target -> host message specifying security parameters
  12512. *
  12513. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  12514. *
  12515. * @details
  12516. * The following diagram shows the format of the security specification
  12517. * message sent from the target to the host.
  12518. * This security specification message tells the host whether a PN check is
  12519. * necessary on rx data frames, and if so, how large the PN counter is.
  12520. * This message also tells the host about the security processing to apply
  12521. * to defragmented rx frames - specifically, whether a Message Integrity
  12522. * Check is required, and the Michael key to use.
  12523. *
  12524. * |31 24|23 16|15|14 8|7 0|
  12525. * |-----------------------------------------------------------------------|
  12526. * | peer ID | U| security type | msg type |
  12527. * |-----------------------------------------------------------------------|
  12528. * | Michael Key K0 |
  12529. * |-----------------------------------------------------------------------|
  12530. * | Michael Key K1 |
  12531. * |-----------------------------------------------------------------------|
  12532. * | WAPI RSC Low0 |
  12533. * |-----------------------------------------------------------------------|
  12534. * | WAPI RSC Low1 |
  12535. * |-----------------------------------------------------------------------|
  12536. * | WAPI RSC Hi0 |
  12537. * |-----------------------------------------------------------------------|
  12538. * | WAPI RSC Hi1 |
  12539. * |-----------------------------------------------------------------------|
  12540. *
  12541. * The following field definitions describe the format of the security
  12542. * indication message sent from the target to the host.
  12543. * - MSG_TYPE
  12544. * Bits 7:0
  12545. * Purpose: identifies this as a security specification message
  12546. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  12547. * - SEC_TYPE
  12548. * Bits 14:8
  12549. * Purpose: specifies which type of security applies to the peer
  12550. * Value: htt_sec_type enum value
  12551. * - UNICAST
  12552. * Bit 15
  12553. * Purpose: whether this security is applied to unicast or multicast data
  12554. * Value: 1 -> unicast, 0 -> multicast
  12555. * - PEER_ID
  12556. * Bits 31:16
  12557. * Purpose: The ID number for the peer the security specification is for
  12558. * Value: peer ID
  12559. * - MICHAEL_KEY_K0
  12560. * Bits 31:0
  12561. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  12562. * Value: Michael Key K0 (if security type is TKIP)
  12563. * - MICHAEL_KEY_K1
  12564. * Bits 31:0
  12565. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  12566. * Value: Michael Key K1 (if security type is TKIP)
  12567. * - WAPI_RSC_LOW0
  12568. * Bits 31:0
  12569. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  12570. * Value: WAPI RSC Low0 (if security type is WAPI)
  12571. * - WAPI_RSC_LOW1
  12572. * Bits 31:0
  12573. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  12574. * Value: WAPI RSC Low1 (if security type is WAPI)
  12575. * - WAPI_RSC_HI0
  12576. * Bits 31:0
  12577. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  12578. * Value: WAPI RSC Hi0 (if security type is WAPI)
  12579. * - WAPI_RSC_HI1
  12580. * Bits 31:0
  12581. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  12582. * Value: WAPI RSC Hi1 (if security type is WAPI)
  12583. */
  12584. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  12585. #define HTT_SEC_IND_SEC_TYPE_S 8
  12586. #define HTT_SEC_IND_UNICAST_M 0x00008000
  12587. #define HTT_SEC_IND_UNICAST_S 15
  12588. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  12589. #define HTT_SEC_IND_PEER_ID_S 16
  12590. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  12591. do { \
  12592. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  12593. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  12594. } while (0)
  12595. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  12596. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  12597. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  12598. do { \
  12599. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  12600. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  12601. } while (0)
  12602. #define HTT_SEC_IND_UNICAST_GET(word) \
  12603. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  12604. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  12605. do { \
  12606. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  12607. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  12608. } while (0)
  12609. #define HTT_SEC_IND_PEER_ID_GET(word) \
  12610. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  12611. #define HTT_SEC_IND_BYTES 28
  12612. /**
  12613. * @brief target -> host rx ADDBA / DELBA message definitions
  12614. *
  12615. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  12616. *
  12617. * @details
  12618. * The following diagram shows the format of the rx ADDBA message sent
  12619. * from the target to the host:
  12620. *
  12621. * |31 20|19 16|15 8|7 0|
  12622. * |---------------------------------------------------------------------|
  12623. * | peer ID | TID | window size | msg type |
  12624. * |---------------------------------------------------------------------|
  12625. *
  12626. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  12627. *
  12628. * The following diagram shows the format of the rx DELBA message sent
  12629. * from the target to the host:
  12630. *
  12631. * |31 20|19 16|15 10|9 8|7 0|
  12632. * |---------------------------------------------------------------------|
  12633. * | peer ID | TID | window size | IR| msg type |
  12634. * |---------------------------------------------------------------------|
  12635. *
  12636. * The following field definitions describe the format of the rx ADDBA
  12637. * and DELBA messages sent from the target to the host.
  12638. * - MSG_TYPE
  12639. * Bits 7:0
  12640. * Purpose: identifies this as an rx ADDBA or DELBA message
  12641. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  12642. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  12643. * - IR (initiator / recipient)
  12644. * Bits 9:8 (DELBA only)
  12645. * Purpose: specify whether the DELBA handshake was initiated by the
  12646. * local STA/AP, or by the peer STA/AP
  12647. * Value:
  12648. * 0 - unspecified
  12649. * 1 - initiator (a.k.a. originator)
  12650. * 2 - recipient (a.k.a. responder)
  12651. * 3 - unused / reserved
  12652. * - WIN_SIZE
  12653. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  12654. * Purpose: Specifies the length of the block ack window (max = 64).
  12655. * Value:
  12656. * block ack window length specified by the received ADDBA/DELBA
  12657. * management message.
  12658. * - TID
  12659. * Bits 19:16
  12660. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12661. * Value:
  12662. * TID specified by the received ADDBA or DELBA management message.
  12663. * - PEER_ID
  12664. * Bits 31:20
  12665. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12666. * Value:
  12667. * ID (hash value) used by the host for fast, direct lookup of
  12668. * host SW peer info, including rx reorder states.
  12669. */
  12670. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  12671. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  12672. #define HTT_RX_ADDBA_TID_M 0xf0000
  12673. #define HTT_RX_ADDBA_TID_S 16
  12674. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  12675. #define HTT_RX_ADDBA_PEER_ID_S 20
  12676. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  12677. do { \
  12678. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  12679. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  12680. } while (0)
  12681. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  12682. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12683. #define HTT_RX_ADDBA_TID_SET(word, value) \
  12684. do { \
  12685. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  12686. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  12687. } while (0)
  12688. #define HTT_RX_ADDBA_TID_GET(word) \
  12689. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  12690. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  12691. do { \
  12692. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  12693. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  12694. } while (0)
  12695. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  12696. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  12697. #define HTT_RX_ADDBA_BYTES 4
  12698. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  12699. #define HTT_RX_DELBA_INITIATOR_S 8
  12700. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  12701. #define HTT_RX_DELBA_WIN_SIZE_S 10
  12702. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  12703. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  12704. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  12705. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  12706. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  12707. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  12708. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  12709. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  12710. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12711. do { \
  12712. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12713. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12714. } while (0)
  12715. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12716. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12717. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  12718. do { \
  12719. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  12720. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  12721. } while (0)
  12722. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  12723. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  12724. #define HTT_RX_DELBA_BYTES 4
  12725. /**
  12726. * @brief target -> host rx ADDBA / DELBA message definitions
  12727. *
  12728. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN
  12729. *
  12730. * @details
  12731. * The following diagram shows the format of the rx ADDBA extn message sent
  12732. * from the target to the host:
  12733. *
  12734. * |31 20|19 16|15 13|12 8|7 0|
  12735. * |---------------------------------------------------------------------|
  12736. * | peer ID | TID | reserved | msg type |
  12737. * |---------------------------------------------------------------------|
  12738. * | reserved | window size |
  12739. * |---------------------------------------------------------------------|
  12740. *
  12741. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA_EXTN
  12742. *
  12743. * The following diagram shows the format of the rx DELBA message sent
  12744. * from the target to the host:
  12745. *
  12746. * |31 20|19 16|15 13|12 10|9 8|7 0|
  12747. * |---------------------------------------------------------------------|
  12748. * | peer ID | TID | reserved | IR| msg type |
  12749. * |---------------------------------------------------------------------|
  12750. * | reserved | window size |
  12751. * |---------------------------------------------------------------------|
  12752. *
  12753. * The following field definitions describe the format of the rx ADDBA
  12754. * and DELBA messages sent from the target to the host.
  12755. * - MSG_TYPE
  12756. * Bits 7:0
  12757. * Purpose: identifies this as an rx ADDBA or DELBA message
  12758. * Value: ADDBA -> 0x31 (HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN),
  12759. * DELBA -> 0x32 (HTT_T2H_MSG_TYPE_RX_DELBA_EXTN)
  12760. * - IR (initiator / recipient)
  12761. * Bits 9:8 (DELBA only)
  12762. * Purpose: specify whether the DELBA handshake was initiated by the
  12763. * local STA/AP, or by the peer STA/AP
  12764. * Value:
  12765. * 0 - unspecified
  12766. * 1 - initiator (a.k.a. originator)
  12767. * 2 - recipient (a.k.a. responder)
  12768. * 3 - unused / reserved
  12769. * Value:
  12770. * block ack window length specified by the received ADDBA/DELBA
  12771. * management message.
  12772. * - TID
  12773. * Bits 19:16
  12774. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12775. * Value:
  12776. * TID specified by the received ADDBA or DELBA management message.
  12777. * - PEER_ID
  12778. * Bits 31:20
  12779. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12780. * Value:
  12781. * ID (hash value) used by the host for fast, direct lookup of
  12782. * host SW peer info, including rx reorder states.
  12783. * == DWORD 1
  12784. * - WIN_SIZE
  12785. * Bits 12:0 for ADDBA, bits 12:0 for DELBA
  12786. * Purpose: Specifies the length of the block ack window (max = 8191).
  12787. */
  12788. #define HTT_RX_ADDBA_EXTN_TID_M 0xf0000
  12789. #define HTT_RX_ADDBA_EXTN_TID_S 16
  12790. #define HTT_RX_ADDBA_EXTN_PEER_ID_M 0xfff00000
  12791. #define HTT_RX_ADDBA_EXTN_PEER_ID_S 20
  12792. /*--- Dword 0 ---*/
  12793. #define HTT_RX_ADDBA_EXTN_TID_SET(word, value) \
  12794. do { \
  12795. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_TID, value); \
  12796. (word) |= (value) << HTT_RX_ADDBA_EXTN_TID_S; \
  12797. } while (0)
  12798. #define HTT_RX_ADDBA_EXTN_TID_GET(word) \
  12799. (((word) & HTT_RX_ADDBA_EXTN_TID_M) >> HTT_RX_ADDBA_EXTN_TID_S)
  12800. #define HTT_RX_ADDBA_EXTN_PEER_ID_SET(word, value) \
  12801. do { \
  12802. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_PEER_ID, value); \
  12803. (word) |= (value) << HTT_RX_ADDBA_EXTN_PEER_ID_S; \
  12804. } while (0)
  12805. #define HTT_RX_ADDBA_EXTN_PEER_ID_GET(word) \
  12806. (((word) & HTT_RX_ADDBA_EXTN_PEER_ID_M) >> HTT_RX_ADDBA_EXTN_PEER_ID_S)
  12807. /*--- Dword 1 ---*/
  12808. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_M 0x1fff
  12809. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_S 0
  12810. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_SET(word, value) \
  12811. do { \
  12812. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_WIN_SIZE, value); \
  12813. (word) |= (value) << HTT_RX_ADDBA_EXTN_WIN_SIZE_S; \
  12814. } while (0)
  12815. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_GET(word) \
  12816. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12817. #define HTT_RX_ADDBA_EXTN_BYTES 8
  12818. #define HTT_RX_DELBA_EXTN_INITIATOR_M 0x00000300
  12819. #define HTT_RX_DELBA_EXTN_INITIATOR_S 8
  12820. #define HTT_RX_DELBA_EXTN_TID_M 0xf0000
  12821. #define HTT_RX_DELBA_EXTN_TID_S 16
  12822. #define HTT_RX_DELBA_EXTN_PEER_ID_M 0xfff00000
  12823. #define HTT_RX_DELBA_EXTN_PEER_ID_S 20
  12824. /*--- Dword 0 ---*/
  12825. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12826. do { \
  12827. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12828. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12829. } while (0)
  12830. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12831. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12832. #define HTT_RX_DELBA_EXTN_TID_SET(word, value) \
  12833. do { \
  12834. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_TID, value); \
  12835. (word) |= (value) << HTT_RX_DELBA_EXTN_TID_S; \
  12836. } while (0)
  12837. #define HTT_RX_DELBA_EXTN_TID_GET(word) \
  12838. (((word) & HTT_RX_DELBA_EXTN_TID_M) >> HTT_RX_DELBA_EXTN_TID_S)
  12839. #define HTT_RX_DELBA_EXTN_PEER_ID_SET(word, value) \
  12840. do { \
  12841. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_PEER_ID, value); \
  12842. (word) |= (value) << HTT_RX_DELBA_EXTN_PEER_ID_S; \
  12843. } while (0)
  12844. #define HTT_RX_DELBA_EXTN_PEER_ID_GET(word) \
  12845. (((word) & HTT_RX_DELBA_EXTN_PEER_ID_M) >> HTT_RX_DELBA_EXTN_PEER_ID_S)
  12846. /*--- Dword 1 ---*/
  12847. #define HTT_RX_DELBA_EXTN_WIN_SIZE_M 0x1fff
  12848. #define HTT_RX_DELBA_EXTN_WIN_SIZE_S 0
  12849. #define HTT_RX_DELBA_EXTN_WIN_SIZE_SET(word, value) \
  12850. do { \
  12851. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_WIN_SIZE, value); \
  12852. (word) |= (value) << HTT_RX_DELBA_EXTN_WIN_SIZE_S; \
  12853. } while (0)
  12854. #define HTT_RX_DELBA_EXTN_WIN_SIZE_GET(word) \
  12855. (((word) & HTT_RX_DELBA_EXTN_WIN_SIZE_M) >> HTT_RX_DELBA_EXTN_WIN_SIZE_S)
  12856. #define HTT_RX_DELBA_EXTN_BYTES 8
  12857. /**
  12858. * @brief tx queue group information element definition
  12859. *
  12860. * @details
  12861. * The following diagram shows the format of the tx queue group
  12862. * information element, which can be included in target --> host
  12863. * messages to specify the number of tx "credits" (tx descriptors
  12864. * for LL, or tx buffers for HL) available to a particular group
  12865. * of host-side tx queues, and which host-side tx queues belong to
  12866. * the group.
  12867. *
  12868. * |31|30 24|23 16|15|14|13 0|
  12869. * |------------------------------------------------------------------------|
  12870. * | X| reserved | tx queue grp ID | A| S| credit count |
  12871. * |------------------------------------------------------------------------|
  12872. * | vdev ID mask | AC mask |
  12873. * |------------------------------------------------------------------------|
  12874. *
  12875. * The following definitions describe the fields within the tx queue group
  12876. * information element:
  12877. * - credit_count
  12878. * Bits 13:1
  12879. * Purpose: specify how many tx credits are available to the tx queue group
  12880. * Value: An absolute or relative, positive or negative credit value
  12881. * The 'A' bit specifies whether the value is absolute or relative.
  12882. * The 'S' bit specifies whether the value is positive or negative.
  12883. * A negative value can only be relative, not absolute.
  12884. * An absolute value replaces any prior credit value the host has for
  12885. * the tx queue group in question.
  12886. * A relative value is added to the prior credit value the host has for
  12887. * the tx queue group in question.
  12888. * - sign
  12889. * Bit 14
  12890. * Purpose: specify whether the credit count is positive or negative
  12891. * Value: 0 -> positive, 1 -> negative
  12892. * - absolute
  12893. * Bit 15
  12894. * Purpose: specify whether the credit count is absolute or relative
  12895. * Value: 0 -> relative, 1 -> absolute
  12896. * - txq_group_id
  12897. * Bits 23:16
  12898. * Purpose: indicate which tx queue group's credit and/or membership are
  12899. * being specified
  12900. * Value: 0 to max_tx_queue_groups-1
  12901. * - reserved
  12902. * Bits 30:16
  12903. * Value: 0x0
  12904. * - eXtension
  12905. * Bit 31
  12906. * Purpose: specify whether another tx queue group info element follows
  12907. * Value: 0 -> no more tx queue group information elements
  12908. * 1 -> another tx queue group information element immediately follows
  12909. * - ac_mask
  12910. * Bits 15:0
  12911. * Purpose: specify which Access Categories belong to the tx queue group
  12912. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  12913. * the tx queue group.
  12914. * The AC bit-mask values are obtained by left-shifting by the
  12915. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  12916. * - vdev_id_mask
  12917. * Bits 31:16
  12918. * Purpose: specify which vdev's tx queues belong to the tx queue group
  12919. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  12920. * belong to the tx queue group.
  12921. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  12922. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  12923. */
  12924. PREPACK struct htt_txq_group {
  12925. A_UINT32
  12926. credit_count: 14,
  12927. sign: 1,
  12928. absolute: 1,
  12929. tx_queue_group_id: 8,
  12930. reserved0: 7,
  12931. extension: 1;
  12932. A_UINT32
  12933. ac_mask: 16,
  12934. vdev_id_mask: 16;
  12935. } POSTPACK;
  12936. /* first word */
  12937. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  12938. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  12939. #define HTT_TXQ_GROUP_SIGN_S 14
  12940. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  12941. #define HTT_TXQ_GROUP_ABS_S 15
  12942. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  12943. #define HTT_TXQ_GROUP_ID_S 16
  12944. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  12945. #define HTT_TXQ_GROUP_EXT_S 31
  12946. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  12947. /* second word */
  12948. #define HTT_TXQ_GROUP_AC_MASK_S 0
  12949. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  12950. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  12951. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  12952. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  12953. do { \
  12954. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  12955. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  12956. } while (0)
  12957. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  12958. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  12959. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  12960. do { \
  12961. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  12962. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  12963. } while (0)
  12964. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  12965. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  12966. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  12967. do { \
  12968. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  12969. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  12970. } while (0)
  12971. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  12972. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  12973. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  12974. do { \
  12975. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  12976. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  12977. } while (0)
  12978. #define HTT_TXQ_GROUP_ID_GET(_info) \
  12979. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  12980. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  12981. do { \
  12982. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  12983. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  12984. } while (0)
  12985. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  12986. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  12987. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  12988. do { \
  12989. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  12990. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  12991. } while (0)
  12992. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  12993. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  12994. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  12995. do { \
  12996. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  12997. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  12998. } while (0)
  12999. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  13000. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  13001. /**
  13002. * @brief target -> host TX completion indication message definition
  13003. *
  13004. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  13005. *
  13006. * @details
  13007. * The following diagram shows the format of the TX completion indication sent
  13008. * from the target to the host
  13009. *
  13010. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  13011. * |-------------------------------------------------------------------|
  13012. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  13013. * |-------------------------------------------------------------------|
  13014. * payload:| MSDU1 ID | MSDU0 ID |
  13015. * |-------------------------------------------------------------------|
  13016. * : MSDU3 ID | MSDU2 ID :
  13017. * |-------------------------------------------------------------------|
  13018. * | struct htt_tx_compl_ind_append_retries |
  13019. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13020. * | struct htt_tx_compl_ind_append_tx_tstamp |
  13021. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13022. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  13023. * |-------------------------------------------------------------------|
  13024. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  13025. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13026. * | MSDU0 tx_tsf64_low |
  13027. * |-------------------------------------------------------------------|
  13028. * | MSDU0 tx_tsf64_high |
  13029. * |-------------------------------------------------------------------|
  13030. * | MSDU1 tx_tsf64_low |
  13031. * |-------------------------------------------------------------------|
  13032. * | MSDU1 tx_tsf64_high |
  13033. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13034. * | phy_timestamp |
  13035. * |-------------------------------------------------------------------|
  13036. * | rate specs (see below) |
  13037. * |-------------------------------------------------------------------|
  13038. * | seqctrl | framectrl |
  13039. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13040. * Where:
  13041. * A0 = append (a.k.a. append0)
  13042. * A1 = append1
  13043. * TP = MSDU tx power presence
  13044. * A2 = append2
  13045. * A3 = append3
  13046. * A4 = append4
  13047. *
  13048. * The following field definitions describe the format of the TX completion
  13049. * indication sent from the target to the host
  13050. * Header fields:
  13051. * - msg_type
  13052. * Bits 7:0
  13053. * Purpose: identifies this as HTT TX completion indication
  13054. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  13055. * - status
  13056. * Bits 10:8
  13057. * Purpose: the TX completion status of payload fragmentations descriptors
  13058. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  13059. * - tid
  13060. * Bits 14:11
  13061. * Purpose: the tid associated with those fragmentation descriptors. It is
  13062. * valid or not, depending on the tid_invalid bit.
  13063. * Value: 0 to 15
  13064. * - tid_invalid
  13065. * Bits 15:15
  13066. * Purpose: this bit indicates whether the tid field is valid or not
  13067. * Value: 0 indicates valid; 1 indicates invalid
  13068. * - num
  13069. * Bits 23:16
  13070. * Purpose: the number of payload in this indication
  13071. * Value: 1 to 255
  13072. * - append (a.k.a. append0)
  13073. * Bits 24:24
  13074. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  13075. * the number of tx retries for one MSDU at the end of this message
  13076. * Value: 0 indicates no appending; 1 indicates appending
  13077. * - append1
  13078. * Bits 25:25
  13079. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  13080. * contains the timestamp info for each TX msdu id in payload.
  13081. * The order of the timestamps matches the order of the MSDU IDs.
  13082. * Note that a big-endian host needs to account for the reordering
  13083. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  13084. * conversion) when determining which tx timestamp corresponds to
  13085. * which MSDU ID.
  13086. * Value: 0 indicates no appending; 1 indicates appending
  13087. * - msdu_tx_power_presence
  13088. * Bits 26:26
  13089. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  13090. * for each MSDU referenced by the TX_COMPL_IND message.
  13091. * The tx power is reported in 0.5 dBm units.
  13092. * The order of the per-MSDU tx power reports matches the order
  13093. * of the MSDU IDs.
  13094. * Note that a big-endian host needs to account for the reordering
  13095. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  13096. * conversion) when determining which Tx Power corresponds to
  13097. * which MSDU ID.
  13098. * Value: 0 indicates MSDU tx power reports are not appended,
  13099. * 1 indicates MSDU tx power reports are appended
  13100. * - append2
  13101. * Bits 27:27
  13102. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  13103. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  13104. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  13105. * same for all MSDUs within a single PPDU, the RSSI is duplicated
  13106. * for each MSDU, for convenience.
  13107. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  13108. * this append2 bit is set).
  13109. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  13110. * dB above the noise floor.
  13111. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  13112. * 1 indicates MSDU ACK RSSI values are appended.
  13113. * - append3
  13114. * Bits 28:28
  13115. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  13116. * contains the tx tsf info based on wlan global TSF for
  13117. * each TX msdu id in payload.
  13118. * The order of the tx tsf matches the order of the MSDU IDs.
  13119. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  13120. * values to indicate the the lower 32 bits and higher 32 bits of
  13121. * the tx tsf.
  13122. * The tx_tsf64 here represents the time MSDU was acked and the
  13123. * tx_tsf64 has microseconds units.
  13124. * Value: 0 indicates no appending; 1 indicates appending
  13125. * - append4
  13126. * Bits 29:29
  13127. * Purpose: Indicate whether data frame control fields and fields required
  13128. * for radio tap header are appended for each MSDU in TX_COMP_IND
  13129. * message. The order of the this message matches the order of
  13130. * the MSDU IDs.
  13131. * Value: 0 indicates frame control fields and fields required for
  13132. * radio tap header values are not appended,
  13133. * 1 indicates frame control fields and fields required for
  13134. * radio tap header values are appended.
  13135. * Payload fields:
  13136. * - hmsdu_id
  13137. * Bits 15:0
  13138. * Purpose: this ID is used to track the Tx buffer in host
  13139. * Value: 0 to "size of host MSDU descriptor pool - 1"
  13140. */
  13141. PREPACK struct htt_tx_data_hdr_information {
  13142. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  13143. A_UINT32 /* word 1 */
  13144. /* preamble:
  13145. * 0-OFDM,
  13146. * 1-CCk,
  13147. * 2-HT,
  13148. * 3-VHT
  13149. */
  13150. preamble: 2, /* [1:0] */
  13151. /* mcs:
  13152. * In case of HT preamble interpret
  13153. * MCS along with NSS.
  13154. * Valid values for HT are 0 to 7.
  13155. * HT mcs 0 with NSS 2 is mcs 8.
  13156. * Valid values for VHT are 0 to 9.
  13157. */
  13158. mcs: 4, /* [5:2] */
  13159. /* rate:
  13160. * This is applicable only for
  13161. * CCK and OFDM preamble type
  13162. * rate 0: OFDM 48 Mbps,
  13163. * 1: OFDM 24 Mbps,
  13164. * 2: OFDM 12 Mbps
  13165. * 3: OFDM 6 Mbps
  13166. * 4: OFDM 54 Mbps
  13167. * 5: OFDM 36 Mbps
  13168. * 6: OFDM 18 Mbps
  13169. * 7: OFDM 9 Mbps
  13170. * rate 0: CCK 11 Mbps Long
  13171. * 1: CCK 5.5 Mbps Long
  13172. * 2: CCK 2 Mbps Long
  13173. * 3: CCK 1 Mbps Long
  13174. * 4: CCK 11 Mbps Short
  13175. * 5: CCK 5.5 Mbps Short
  13176. * 6: CCK 2 Mbps Short
  13177. */
  13178. rate : 3, /* [ 8: 6] */
  13179. rssi : 8, /* [16: 9] units=dBm */
  13180. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  13181. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  13182. stbc : 1, /* [22] */
  13183. sgi : 1, /* [23] */
  13184. ldpc : 1, /* [24] */
  13185. beamformed: 1, /* [25] */
  13186. /* tx_retry_cnt:
  13187. * Indicates retry count of data tx frames provided by the host.
  13188. */
  13189. tx_retry_cnt: 6; /* [31:26] */
  13190. A_UINT32 /* word 2 */
  13191. framectrl:16, /* [15: 0] */
  13192. seqno:16; /* [31:16] */
  13193. } POSTPACK;
  13194. #define HTT_TX_COMPL_IND_STATUS_S 8
  13195. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  13196. #define HTT_TX_COMPL_IND_TID_S 11
  13197. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  13198. #define HTT_TX_COMPL_IND_TID_INV_S 15
  13199. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  13200. #define HTT_TX_COMPL_IND_NUM_S 16
  13201. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  13202. #define HTT_TX_COMPL_IND_APPEND_S 24
  13203. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  13204. #define HTT_TX_COMPL_IND_APPEND1_S 25
  13205. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  13206. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  13207. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  13208. #define HTT_TX_COMPL_IND_APPEND2_S 27
  13209. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  13210. #define HTT_TX_COMPL_IND_APPEND3_S 28
  13211. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  13212. #define HTT_TX_COMPL_IND_APPEND4_S 29
  13213. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  13214. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  13215. do { \
  13216. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  13217. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  13218. } while (0)
  13219. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  13220. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  13221. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  13222. do { \
  13223. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  13224. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  13225. } while (0)
  13226. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  13227. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  13228. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  13229. do { \
  13230. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  13231. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  13232. } while (0)
  13233. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  13234. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  13235. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  13236. do { \
  13237. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  13238. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  13239. } while (0)
  13240. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  13241. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  13242. HTT_TX_COMPL_IND_TID_INV_S)
  13243. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  13244. do { \
  13245. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  13246. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  13247. } while (0)
  13248. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  13249. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  13250. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  13251. do { \
  13252. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  13253. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  13254. } while (0)
  13255. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  13256. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  13257. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  13258. do { \
  13259. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  13260. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  13261. } while (0)
  13262. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  13263. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  13264. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  13265. do { \
  13266. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  13267. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  13268. } while (0)
  13269. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  13270. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  13271. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  13272. do { \
  13273. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  13274. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  13275. } while (0)
  13276. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  13277. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  13278. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  13279. do { \
  13280. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  13281. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  13282. } while (0)
  13283. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  13284. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  13285. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  13286. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  13287. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  13288. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  13289. #define HTT_TX_COMPL_IND_STAT_OK 0
  13290. /* DISCARD:
  13291. * current meaning:
  13292. * MSDUs were queued for transmission but filtered by HW or SW
  13293. * without any over the air attempts
  13294. * legacy meaning (HL Rome):
  13295. * MSDUs were discarded by the target FW without any over the air
  13296. * attempts due to lack of space
  13297. */
  13298. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  13299. /* NO_ACK:
  13300. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  13301. */
  13302. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  13303. /* POSTPONE:
  13304. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  13305. * be downloaded again later (in the appropriate order), when they are
  13306. * deliverable.
  13307. */
  13308. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  13309. /*
  13310. * The PEER_DEL tx completion status is used for HL cases
  13311. * where the peer the frame is for has been deleted.
  13312. * The host has already discarded its copy of the frame, but
  13313. * it still needs the tx completion to restore its credit.
  13314. */
  13315. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  13316. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  13317. #define HTT_TX_COMPL_IND_STAT_DROP 5
  13318. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  13319. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  13320. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  13321. PREPACK struct htt_tx_compl_ind_base {
  13322. A_UINT32 hdr;
  13323. A_UINT16 payload[1/*or more*/];
  13324. } POSTPACK;
  13325. PREPACK struct htt_tx_compl_ind_append_retries {
  13326. A_UINT16 msdu_id;
  13327. A_UINT8 tx_retries;
  13328. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  13329. 0: this is the last append_retries struct */
  13330. } POSTPACK;
  13331. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  13332. A_UINT32 timestamp[1/*or more*/];
  13333. } POSTPACK;
  13334. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  13335. A_UINT32 tx_tsf64_low;
  13336. A_UINT32 tx_tsf64_high;
  13337. } POSTPACK;
  13338. /* htt_tx_data_hdr_information payload extension fields: */
  13339. /* DWORD zero */
  13340. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  13341. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  13342. /* DWORD one */
  13343. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  13344. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  13345. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  13346. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  13347. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  13348. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  13349. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  13350. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  13351. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  13352. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  13353. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  13354. #define HTT_FW_TX_DATA_HDR_BW_S 19
  13355. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  13356. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  13357. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  13358. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  13359. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  13360. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  13361. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  13362. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  13363. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  13364. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  13365. /* DWORD two */
  13366. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  13367. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  13368. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  13369. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  13370. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  13371. do { \
  13372. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  13373. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  13374. } while (0)
  13375. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  13376. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  13377. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  13378. do { \
  13379. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  13380. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  13381. } while (0)
  13382. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  13383. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  13384. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  13385. do { \
  13386. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  13387. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  13388. } while (0)
  13389. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  13390. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  13391. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  13392. do { \
  13393. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  13394. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  13395. } while (0)
  13396. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  13397. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  13398. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  13399. do { \
  13400. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  13401. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  13402. } while (0)
  13403. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  13404. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  13405. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  13406. do { \
  13407. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  13408. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  13409. } while (0)
  13410. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  13411. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  13412. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  13413. do { \
  13414. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  13415. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  13416. } while (0)
  13417. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  13418. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  13419. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  13420. do { \
  13421. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  13422. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  13423. } while (0)
  13424. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  13425. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  13426. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  13427. do { \
  13428. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  13429. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  13430. } while (0)
  13431. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  13432. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  13433. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  13434. do { \
  13435. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  13436. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  13437. } while (0)
  13438. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  13439. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  13440. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  13441. do { \
  13442. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  13443. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  13444. } while (0)
  13445. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  13446. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  13447. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  13448. do { \
  13449. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  13450. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  13451. } while (0)
  13452. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  13453. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  13454. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  13455. do { \
  13456. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  13457. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  13458. } while (0)
  13459. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  13460. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  13461. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  13462. do { \
  13463. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  13464. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  13465. } while (0)
  13466. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  13467. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  13468. /**
  13469. * @brief target -> host rate-control update indication message
  13470. *
  13471. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  13472. *
  13473. * @details
  13474. * The following diagram shows the format of the RC Update message
  13475. * sent from the target to the host, while processing the tx-completion
  13476. * of a transmitted PPDU.
  13477. *
  13478. * |31 24|23 16|15 8|7 0|
  13479. * |-------------------------------------------------------------|
  13480. * | peer ID | vdev ID | msg_type |
  13481. * |-------------------------------------------------------------|
  13482. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  13483. * |-------------------------------------------------------------|
  13484. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  13485. * |-------------------------------------------------------------|
  13486. * | : |
  13487. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  13488. * | : |
  13489. * |-------------------------------------------------------------|
  13490. * | : |
  13491. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  13492. * | : |
  13493. * |-------------------------------------------------------------|
  13494. * : :
  13495. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13496. *
  13497. */
  13498. typedef struct {
  13499. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  13500. A_UINT32 rate_code_flags;
  13501. A_UINT32 flags; /* Encodes information such as excessive
  13502. retransmission, aggregate, some info
  13503. from .11 frame control,
  13504. STBC, LDPC, (SGI and Tx Chain Mask
  13505. are encoded in ptx_rc->flags field),
  13506. AMPDU truncation (BT/time based etc.),
  13507. RTS/CTS attempt */
  13508. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  13509. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  13510. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  13511. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  13512. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  13513. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  13514. } HTT_RC_TX_DONE_PARAMS;
  13515. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  13516. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  13517. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  13518. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  13519. #define HTT_RC_UPDATE_VDEVID_S 8
  13520. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  13521. #define HTT_RC_UPDATE_PEERID_S 16
  13522. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  13523. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  13524. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  13525. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  13526. do { \
  13527. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  13528. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  13529. } while (0)
  13530. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  13531. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  13532. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  13533. do { \
  13534. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  13535. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  13536. } while (0)
  13537. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  13538. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  13539. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  13540. do { \
  13541. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  13542. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  13543. } while (0)
  13544. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  13545. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  13546. /**
  13547. * @brief target -> host rx fragment indication message definition
  13548. *
  13549. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  13550. *
  13551. * @details
  13552. * The following field definitions describe the format of the rx fragment
  13553. * indication message sent from the target to the host.
  13554. * The rx fragment indication message shares the format of the
  13555. * rx indication message, but not all fields from the rx indication message
  13556. * are relevant to the rx fragment indication message.
  13557. *
  13558. *
  13559. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  13560. * |-----------+-------------------+---------------------+-------------|
  13561. * | peer ID | |FV| ext TID | msg type |
  13562. * |-------------------------------------------------------------------|
  13563. * | | flush | flush |
  13564. * | | end | start |
  13565. * | | seq num | seq num |
  13566. * |-------------------------------------------------------------------|
  13567. * | reserved | FW rx desc bytes |
  13568. * |-------------------------------------------------------------------|
  13569. * | | FW MSDU Rx |
  13570. * | | desc B0 |
  13571. * |-------------------------------------------------------------------|
  13572. * Header fields:
  13573. * - MSG_TYPE
  13574. * Bits 7:0
  13575. * Purpose: identifies this as an rx fragment indication message
  13576. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  13577. * - EXT_TID
  13578. * Bits 12:8
  13579. * Purpose: identify the traffic ID of the rx data, including
  13580. * special "extended" TID values for multicast, broadcast, and
  13581. * non-QoS data frames
  13582. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  13583. * - FLUSH_VALID (FV)
  13584. * Bit 13
  13585. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  13586. * is valid
  13587. * Value:
  13588. * 1 -> flush IE is valid and needs to be processed
  13589. * 0 -> flush IE is not valid and should be ignored
  13590. * - PEER_ID
  13591. * Bits 31:16
  13592. * Purpose: Identify, by ID, which peer sent the rx data
  13593. * Value: ID of the peer who sent the rx data
  13594. * - FLUSH_SEQ_NUM_START
  13595. * Bits 5:0
  13596. * Purpose: Indicate the start of a series of MPDUs to flush
  13597. * Not all MPDUs within this series are necessarily valid - the host
  13598. * must check each sequence number within this range to see if the
  13599. * corresponding MPDU is actually present.
  13600. * This field is only valid if the FV bit is set.
  13601. * Value:
  13602. * The sequence number for the first MPDUs to check to flush.
  13603. * The sequence number is masked by 0x3f.
  13604. * - FLUSH_SEQ_NUM_END
  13605. * Bits 11:6
  13606. * Purpose: Indicate the end of a series of MPDUs to flush
  13607. * Value:
  13608. * The sequence number one larger than the sequence number of the
  13609. * last MPDU to check to flush.
  13610. * The sequence number is masked by 0x3f.
  13611. * Not all MPDUs within this series are necessarily valid - the host
  13612. * must check each sequence number within this range to see if the
  13613. * corresponding MPDU is actually present.
  13614. * This field is only valid if the FV bit is set.
  13615. * Rx descriptor fields:
  13616. * - FW_RX_DESC_BYTES
  13617. * Bits 15:0
  13618. * Purpose: Indicate how many bytes in the Rx indication are used for
  13619. * FW Rx descriptors
  13620. * Value: 1
  13621. */
  13622. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  13623. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  13624. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  13625. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  13626. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  13627. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  13628. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  13629. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  13630. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  13631. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  13632. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  13633. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  13634. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  13635. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  13636. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  13637. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  13638. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  13639. #define HTT_RX_FRAG_IND_BYTES \
  13640. (4 /* msg hdr */ + \
  13641. 4 /* flush spec */ + \
  13642. 4 /* (unused) FW rx desc bytes spec */ + \
  13643. 4 /* FW rx desc */)
  13644. /**
  13645. * @brief target -> host test message definition
  13646. *
  13647. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  13648. *
  13649. * @details
  13650. * The following field definitions describe the format of the test
  13651. * message sent from the target to the host.
  13652. * The message consists of a 4-octet header, followed by a variable
  13653. * number of 32-bit integer values, followed by a variable number
  13654. * of 8-bit character values.
  13655. *
  13656. * |31 16|15 8|7 0|
  13657. * |-----------------------------------------------------------|
  13658. * | num chars | num ints | msg type |
  13659. * |-----------------------------------------------------------|
  13660. * | int 0 |
  13661. * |-----------------------------------------------------------|
  13662. * | int 1 |
  13663. * |-----------------------------------------------------------|
  13664. * | ... |
  13665. * |-----------------------------------------------------------|
  13666. * | char 3 | char 2 | char 1 | char 0 |
  13667. * |-----------------------------------------------------------|
  13668. * | | | ... | char 4 |
  13669. * |-----------------------------------------------------------|
  13670. * - MSG_TYPE
  13671. * Bits 7:0
  13672. * Purpose: identifies this as a test message
  13673. * Value: HTT_MSG_TYPE_TEST
  13674. * - NUM_INTS
  13675. * Bits 15:8
  13676. * Purpose: indicate how many 32-bit integers follow the message header
  13677. * - NUM_CHARS
  13678. * Bits 31:16
  13679. * Purpose: indicate how many 8-bit characters follow the series of integers
  13680. */
  13681. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  13682. #define HTT_RX_TEST_NUM_INTS_S 8
  13683. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  13684. #define HTT_RX_TEST_NUM_CHARS_S 16
  13685. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  13686. do { \
  13687. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  13688. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  13689. } while (0)
  13690. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  13691. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  13692. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  13693. do { \
  13694. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  13695. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  13696. } while (0)
  13697. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  13698. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  13699. /**
  13700. * @brief target -> host packet log message
  13701. *
  13702. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  13703. *
  13704. * @details
  13705. * The following field definitions describe the format of the packet log
  13706. * message sent from the target to the host.
  13707. * The message consists of a 4-octet header,followed by a variable number
  13708. * of 32-bit character values.
  13709. *
  13710. * |31 16|15 12|11 10|9 8|7 0|
  13711. * |------------------------------------------------------------------|
  13712. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  13713. * |------------------------------------------------------------------|
  13714. * | payload |
  13715. * |------------------------------------------------------------------|
  13716. * - MSG_TYPE
  13717. * Bits 7:0
  13718. * Purpose: identifies this as a pktlog message
  13719. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  13720. * - mac_id
  13721. * Bits 9:8
  13722. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  13723. * Value: 0-3
  13724. * - pdev_id
  13725. * Bits 11:10
  13726. * Purpose: pdev_id
  13727. * Value: 0-3
  13728. * 0 (for rings at SOC level),
  13729. * 1/2/3 PDEV -> 0/1/2
  13730. * - payload_size
  13731. * Bits 31:16
  13732. * Purpose: explicitly specify the payload size
  13733. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  13734. */
  13735. PREPACK struct htt_pktlog_msg {
  13736. A_UINT32 header;
  13737. A_UINT32 payload[1/* or more */];
  13738. } POSTPACK;
  13739. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  13740. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  13741. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  13742. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  13743. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  13744. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  13745. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  13746. do { \
  13747. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  13748. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  13749. } while (0)
  13750. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  13751. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  13752. HTT_T2H_PKTLOG_MAC_ID_S)
  13753. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  13754. do { \
  13755. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  13756. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  13757. } while (0)
  13758. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  13759. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  13760. HTT_T2H_PKTLOG_PDEV_ID_S)
  13761. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  13762. do { \
  13763. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  13764. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  13765. } while (0)
  13766. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  13767. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  13768. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  13769. /*
  13770. * Rx reorder statistics
  13771. * NB: all the fields must be defined in 4 octets size.
  13772. */
  13773. struct rx_reorder_stats {
  13774. /* Non QoS MPDUs received */
  13775. A_UINT32 deliver_non_qos;
  13776. /* MPDUs received in-order */
  13777. A_UINT32 deliver_in_order;
  13778. /* Flush due to reorder timer expired */
  13779. A_UINT32 deliver_flush_timeout;
  13780. /* Flush due to move out of window */
  13781. A_UINT32 deliver_flush_oow;
  13782. /* Flush due to DELBA */
  13783. A_UINT32 deliver_flush_delba;
  13784. /* MPDUs dropped due to FCS error */
  13785. A_UINT32 fcs_error;
  13786. /* MPDUs dropped due to monitor mode non-data packet */
  13787. A_UINT32 mgmt_ctrl;
  13788. /* Unicast-data MPDUs dropped due to invalid peer */
  13789. A_UINT32 invalid_peer;
  13790. /* MPDUs dropped due to duplication (non aggregation) */
  13791. A_UINT32 dup_non_aggr;
  13792. /* MPDUs dropped due to processed before */
  13793. A_UINT32 dup_past;
  13794. /* MPDUs dropped due to duplicate in reorder queue */
  13795. A_UINT32 dup_in_reorder;
  13796. /* Reorder timeout happened */
  13797. A_UINT32 reorder_timeout;
  13798. /* invalid bar ssn */
  13799. A_UINT32 invalid_bar_ssn;
  13800. /* reorder reset due to bar ssn */
  13801. A_UINT32 ssn_reset;
  13802. /* Flush due to delete peer */
  13803. A_UINT32 deliver_flush_delpeer;
  13804. /* Flush due to offload*/
  13805. A_UINT32 deliver_flush_offload;
  13806. /* Flush due to out of buffer*/
  13807. A_UINT32 deliver_flush_oob;
  13808. /* MPDUs dropped due to PN check fail */
  13809. A_UINT32 pn_fail;
  13810. /* MPDUs dropped due to unable to allocate memory */
  13811. A_UINT32 store_fail;
  13812. /* Number of times the tid pool alloc succeeded */
  13813. A_UINT32 tid_pool_alloc_succ;
  13814. /* Number of times the MPDU pool alloc succeeded */
  13815. A_UINT32 mpdu_pool_alloc_succ;
  13816. /* Number of times the MSDU pool alloc succeeded */
  13817. A_UINT32 msdu_pool_alloc_succ;
  13818. /* Number of times the tid pool alloc failed */
  13819. A_UINT32 tid_pool_alloc_fail;
  13820. /* Number of times the MPDU pool alloc failed */
  13821. A_UINT32 mpdu_pool_alloc_fail;
  13822. /* Number of times the MSDU pool alloc failed */
  13823. A_UINT32 msdu_pool_alloc_fail;
  13824. /* Number of times the tid pool freed */
  13825. A_UINT32 tid_pool_free;
  13826. /* Number of times the MPDU pool freed */
  13827. A_UINT32 mpdu_pool_free;
  13828. /* Number of times the MSDU pool freed */
  13829. A_UINT32 msdu_pool_free;
  13830. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  13831. A_UINT32 msdu_queued;
  13832. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  13833. A_UINT32 msdu_recycled;
  13834. /* Number of MPDUs with invalid peer but A2 found in AST */
  13835. A_UINT32 invalid_peer_a2_in_ast;
  13836. /* Number of MPDUs with invalid peer but A3 found in AST */
  13837. A_UINT32 invalid_peer_a3_in_ast;
  13838. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  13839. A_UINT32 invalid_peer_bmc_mpdus;
  13840. /* Number of MSDUs with err attention word */
  13841. A_UINT32 rxdesc_err_att;
  13842. /* Number of MSDUs with flag of peer_idx_invalid */
  13843. A_UINT32 rxdesc_err_peer_idx_inv;
  13844. /* Number of MSDUs with flag of peer_idx_timeout */
  13845. A_UINT32 rxdesc_err_peer_idx_to;
  13846. /* Number of MSDUs with flag of overflow */
  13847. A_UINT32 rxdesc_err_ov;
  13848. /* Number of MSDUs with flag of msdu_length_err */
  13849. A_UINT32 rxdesc_err_msdu_len;
  13850. /* Number of MSDUs with flag of mpdu_length_err */
  13851. A_UINT32 rxdesc_err_mpdu_len;
  13852. /* Number of MSDUs with flag of tkip_mic_err */
  13853. A_UINT32 rxdesc_err_tkip_mic;
  13854. /* Number of MSDUs with flag of decrypt_err */
  13855. A_UINT32 rxdesc_err_decrypt;
  13856. /* Number of MSDUs with flag of fcs_err */
  13857. A_UINT32 rxdesc_err_fcs;
  13858. /* Number of Unicast (bc_mc bit is not set in attention word)
  13859. * frames with invalid peer handler
  13860. */
  13861. A_UINT32 rxdesc_uc_msdus_inv_peer;
  13862. /* Number of unicast frame directly (direct bit is set in attention word)
  13863. * to DUT with invalid peer handler
  13864. */
  13865. A_UINT32 rxdesc_direct_msdus_inv_peer;
  13866. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  13867. * frames with invalid peer handler
  13868. */
  13869. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  13870. /* Number of MSDUs dropped due to no first MSDU flag */
  13871. A_UINT32 rxdesc_no_1st_msdu;
  13872. /* Number of MSDUs dropped due to ring overflow */
  13873. A_UINT32 msdu_drop_ring_ov;
  13874. /* Number of MSDUs dropped due to FC mismatch */
  13875. A_UINT32 msdu_drop_fc_mismatch;
  13876. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  13877. A_UINT32 msdu_drop_mgmt_remote_ring;
  13878. /* Number of MSDUs dropped due to errors not reported in attention word */
  13879. A_UINT32 msdu_drop_misc;
  13880. /* Number of MSDUs go to offload before reorder */
  13881. A_UINT32 offload_msdu_wal;
  13882. /* Number of data frame dropped by offload after reorder */
  13883. A_UINT32 offload_msdu_reorder;
  13884. /* Number of MPDUs with sequence number in the past and within the BA window */
  13885. A_UINT32 dup_past_within_window;
  13886. /* Number of MPDUs with sequence number in the past and outside the BA window */
  13887. A_UINT32 dup_past_outside_window;
  13888. /* Number of MSDUs with decrypt/MIC error */
  13889. A_UINT32 rxdesc_err_decrypt_mic;
  13890. /* Number of data MSDUs received on both local and remote rings */
  13891. A_UINT32 data_msdus_on_both_rings;
  13892. /* MPDUs never filled */
  13893. A_UINT32 holes_not_filled;
  13894. };
  13895. /*
  13896. * Rx Remote buffer statistics
  13897. * NB: all the fields must be defined in 4 octets size.
  13898. */
  13899. struct rx_remote_buffer_mgmt_stats {
  13900. /* Total number of MSDUs reaped for Rx processing */
  13901. A_UINT32 remote_reaped;
  13902. /* MSDUs recycled within firmware */
  13903. A_UINT32 remote_recycled;
  13904. /* MSDUs stored by Data Rx */
  13905. A_UINT32 data_rx_msdus_stored;
  13906. /* Number of HTT indications from WAL Rx MSDU */
  13907. A_UINT32 wal_rx_ind;
  13908. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  13909. A_UINT32 wal_rx_ind_unconsumed;
  13910. /* Number of HTT indications from Data Rx MSDU */
  13911. A_UINT32 data_rx_ind;
  13912. /* Number of unconsumed HTT indications from Data Rx MSDU */
  13913. A_UINT32 data_rx_ind_unconsumed;
  13914. /* Number of HTT indications from ATHBUF */
  13915. A_UINT32 athbuf_rx_ind;
  13916. /* Number of remote buffers requested for refill */
  13917. A_UINT32 refill_buf_req;
  13918. /* Number of remote buffers filled by the host */
  13919. A_UINT32 refill_buf_rsp;
  13920. /* Number of times MAC hw_index = f/w write_index */
  13921. A_INT32 mac_no_bufs;
  13922. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  13923. A_INT32 fw_indices_equal;
  13924. /* Number of times f/w finds no buffers to post */
  13925. A_INT32 host_no_bufs;
  13926. };
  13927. /*
  13928. * TXBF MU/SU packets and NDPA statistics
  13929. * NB: all the fields must be defined in 4 octets size.
  13930. */
  13931. struct rx_txbf_musu_ndpa_pkts_stats {
  13932. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  13933. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  13934. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  13935. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  13936. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  13937. A_UINT32 reserved[3]; /* must be set to 0x0 */
  13938. };
  13939. /*
  13940. * htt_dbg_stats_status -
  13941. * present - The requested stats have been delivered in full.
  13942. * This indicates that either the stats information was contained
  13943. * in its entirety within this message, or else this message
  13944. * completes the delivery of the requested stats info that was
  13945. * partially delivered through earlier STATS_CONF messages.
  13946. * partial - The requested stats have been delivered in part.
  13947. * One or more subsequent STATS_CONF messages with the same
  13948. * cookie value will be sent to deliver the remainder of the
  13949. * information.
  13950. * error - The requested stats could not be delivered, for example due
  13951. * to a shortage of memory to construct a message holding the
  13952. * requested stats.
  13953. * invalid - The requested stat type is either not recognized, or the
  13954. * target is configured to not gather the stats type in question.
  13955. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13956. * series_done - This special value indicates that no further stats info
  13957. * elements are present within a series of stats info elems
  13958. * (within a stats upload confirmation message).
  13959. */
  13960. enum htt_dbg_stats_status {
  13961. HTT_DBG_STATS_STATUS_PRESENT = 0,
  13962. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  13963. HTT_DBG_STATS_STATUS_ERROR = 2,
  13964. HTT_DBG_STATS_STATUS_INVALID = 3,
  13965. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  13966. };
  13967. /**
  13968. * @brief target -> host statistics upload
  13969. *
  13970. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  13971. *
  13972. * @details
  13973. * The following field definitions describe the format of the HTT target
  13974. * to host stats upload confirmation message.
  13975. * The message contains a cookie echoed from the HTT host->target stats
  13976. * upload request, which identifies which request the confirmation is
  13977. * for, and a series of tag-length-value stats information elements.
  13978. * The tag-length header for each stats info element also includes a
  13979. * status field, to indicate whether the request for the stat type in
  13980. * question was fully met, partially met, unable to be met, or invalid
  13981. * (if the stat type in question is disabled in the target).
  13982. * A special value of all 1's in this status field is used to indicate
  13983. * the end of the series of stats info elements.
  13984. *
  13985. *
  13986. * |31 16|15 8|7 5|4 0|
  13987. * |------------------------------------------------------------|
  13988. * | reserved | msg type |
  13989. * |------------------------------------------------------------|
  13990. * | cookie LSBs |
  13991. * |------------------------------------------------------------|
  13992. * | cookie MSBs |
  13993. * |------------------------------------------------------------|
  13994. * | stats entry length | reserved | S |stat type|
  13995. * |------------------------------------------------------------|
  13996. * | |
  13997. * | type-specific stats info |
  13998. * | |
  13999. * |------------------------------------------------------------|
  14000. * | stats entry length | reserved | S |stat type|
  14001. * |------------------------------------------------------------|
  14002. * | |
  14003. * | type-specific stats info |
  14004. * | |
  14005. * |------------------------------------------------------------|
  14006. * | n/a | reserved | 111 | n/a |
  14007. * |------------------------------------------------------------|
  14008. * Header fields:
  14009. * - MSG_TYPE
  14010. * Bits 7:0
  14011. * Purpose: identifies this is a statistics upload confirmation message
  14012. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  14013. * - COOKIE_LSBS
  14014. * Bits 31:0
  14015. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14016. * message with its preceding host->target stats request message.
  14017. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14018. * - COOKIE_MSBS
  14019. * Bits 31:0
  14020. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14021. * message with its preceding host->target stats request message.
  14022. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14023. *
  14024. * Stats Information Element tag-length header fields:
  14025. * - STAT_TYPE
  14026. * Bits 4:0
  14027. * Purpose: identifies the type of statistics info held in the
  14028. * following information element
  14029. * Value: htt_dbg_stats_type
  14030. * - STATUS
  14031. * Bits 7:5
  14032. * Purpose: indicate whether the requested stats are present
  14033. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  14034. * the completion of the stats entry series
  14035. * - LENGTH
  14036. * Bits 31:16
  14037. * Purpose: indicate the stats information size
  14038. * Value: This field specifies the number of bytes of stats information
  14039. * that follows the element tag-length header.
  14040. * It is expected but not required that this length is a multiple of
  14041. * 4 bytes. Even if the length is not an integer multiple of 4, the
  14042. * subsequent stats entry header will begin on a 4-byte aligned
  14043. * boundary.
  14044. */
  14045. #define HTT_T2H_STATS_COOKIE_SIZE 8
  14046. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  14047. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  14048. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  14049. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  14050. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  14051. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  14052. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  14053. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14054. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  14055. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  14056. do { \
  14057. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  14058. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  14059. } while (0)
  14060. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  14061. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  14062. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  14063. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  14064. do { \
  14065. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  14066. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  14067. } while (0)
  14068. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  14069. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  14070. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  14071. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14072. do { \
  14073. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  14074. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  14075. } while (0)
  14076. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  14077. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  14078. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  14079. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  14080. #define HTT_MAX_AGGR 64
  14081. #define HTT_HL_MAX_AGGR 18
  14082. /**
  14083. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  14084. *
  14085. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  14086. *
  14087. * @details
  14088. * The following field definitions describe the format of the HTT host
  14089. * to target frag_desc/msdu_ext bank configuration message.
  14090. * The message contains the based address and the min and max id of the
  14091. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  14092. * MSDU_EXT/FRAG_DESC.
  14093. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  14094. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  14095. * the hardware does the mapping/translation.
  14096. *
  14097. * Total banks that can be configured is configured to 16.
  14098. *
  14099. * This should be called before any TX has be initiated by the HTT
  14100. *
  14101. * |31 16|15 8|7 5|4 0|
  14102. * |------------------------------------------------------------|
  14103. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  14104. * |------------------------------------------------------------|
  14105. * | BANK0_BASE_ADDRESS (bits 31:0) |
  14106. #if HTT_PADDR64
  14107. * | BANK0_BASE_ADDRESS (bits 63:32) |
  14108. #endif
  14109. * |------------------------------------------------------------|
  14110. * | ... |
  14111. * |------------------------------------------------------------|
  14112. * | BANK15_BASE_ADDRESS (bits 31:0) |
  14113. #if HTT_PADDR64
  14114. * | BANK15_BASE_ADDRESS (bits 63:32) |
  14115. #endif
  14116. * |------------------------------------------------------------|
  14117. * | BANK0_MAX_ID | BANK0_MIN_ID |
  14118. * |------------------------------------------------------------|
  14119. * | ... |
  14120. * |------------------------------------------------------------|
  14121. * | BANK15_MAX_ID | BANK15_MIN_ID |
  14122. * |------------------------------------------------------------|
  14123. * Header fields:
  14124. * - MSG_TYPE
  14125. * Bits 7:0
  14126. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  14127. * for systems with 64-bit format for bus addresses:
  14128. * - BANKx_BASE_ADDRESS_LO
  14129. * Bits 31:0
  14130. * Purpose: Provide a mechanism to specify the base address of the
  14131. * MSDU_EXT bank physical/bus address.
  14132. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  14133. * - BANKx_BASE_ADDRESS_HI
  14134. * Bits 31:0
  14135. * Purpose: Provide a mechanism to specify the base address of the
  14136. * MSDU_EXT bank physical/bus address.
  14137. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  14138. * for systems with 32-bit format for bus addresses:
  14139. * - BANKx_BASE_ADDRESS
  14140. * Bits 31:0
  14141. * Purpose: Provide a mechanism to specify the base address of the
  14142. * MSDU_EXT bank physical/bus address.
  14143. * Value: MSDU_EXT bank physical / bus address
  14144. * - BANKx_MIN_ID
  14145. * Bits 15:0
  14146. * Purpose: Provide a mechanism to specify the min index that needs to
  14147. * mapped.
  14148. * - BANKx_MAX_ID
  14149. * Bits 31:16
  14150. * Purpose: Provide a mechanism to specify the max index that needs to
  14151. * mapped.
  14152. *
  14153. */
  14154. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  14155. * safe value.
  14156. * @note MAX supported banks is 16.
  14157. */
  14158. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  14159. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  14160. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  14161. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  14162. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  14163. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  14164. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  14165. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  14166. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  14167. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  14168. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  14169. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  14170. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  14171. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  14172. do { \
  14173. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  14174. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  14175. } while (0)
  14176. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  14177. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  14178. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  14179. do { \
  14180. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  14181. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  14182. } while (0)
  14183. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  14184. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  14185. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  14186. do { \
  14187. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  14188. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  14189. } while (0)
  14190. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  14191. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  14192. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  14193. do { \
  14194. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  14195. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  14196. } while (0)
  14197. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  14198. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  14199. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  14200. do { \
  14201. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  14202. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  14203. } while (0)
  14204. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  14205. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  14206. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  14207. do { \
  14208. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  14209. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  14210. } while (0)
  14211. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  14212. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  14213. /*
  14214. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  14215. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  14216. * addresses are stored in a XXX-bit field.
  14217. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  14218. * htt_tx_frag_desc64_bank_cfg_t structs.
  14219. */
  14220. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  14221. _paddr_bits_, \
  14222. _paddr__bank_base_address_) \
  14223. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  14224. /** word 0 \
  14225. * msg_type: 8, \
  14226. * pdev_id: 2, \
  14227. * swap: 1, \
  14228. * reserved0: 5, \
  14229. * num_banks: 8, \
  14230. * desc_size: 8; \
  14231. */ \
  14232. A_UINT32 word0; \
  14233. /* \
  14234. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  14235. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  14236. * the second A_UINT32). \
  14237. */ \
  14238. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  14239. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  14240. } POSTPACK
  14241. /* define htt_tx_frag_desc32_bank_cfg_t */
  14242. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  14243. /* define htt_tx_frag_desc64_bank_cfg_t */
  14244. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  14245. /*
  14246. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  14247. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  14248. */
  14249. #if HTT_PADDR64
  14250. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  14251. #else
  14252. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  14253. #endif
  14254. /**
  14255. * @brief target -> host HTT TX Credit total count update message definition
  14256. *
  14257. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  14258. *
  14259. *|31 16|15|14 9| 8 |7 0 |
  14260. *|---------------------+--+----------+-------+----------|
  14261. *|cur htt credit delta | Q| reserved | sign | msg type |
  14262. *|------------------------------------------------------|
  14263. *
  14264. * Header fields:
  14265. * - MSG_TYPE
  14266. * Bits 7:0
  14267. * Purpose: identifies this as a htt tx credit delta update message
  14268. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  14269. * - SIGN
  14270. * Bits 8
  14271. * identifies whether credit delta is positive or negative
  14272. * Value:
  14273. * - 0x0: credit delta is positive, rebalance in some buffers
  14274. * - 0x1: credit delta is negative, rebalance out some buffers
  14275. * - reserved
  14276. * Bits 14:9
  14277. * Value: 0x0
  14278. * - TXQ_GRP
  14279. * Bit 15
  14280. * Purpose: indicates whether any tx queue group information elements
  14281. * are appended to the tx credit update message
  14282. * Value: 0 -> no tx queue group information element is present
  14283. * 1 -> a tx queue group information element immediately follows
  14284. * - DELTA_COUNT
  14285. * Bits 31:16
  14286. * Purpose: Specify current htt credit delta absolute count
  14287. */
  14288. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  14289. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  14290. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  14291. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  14292. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  14293. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  14294. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  14295. do { \
  14296. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  14297. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  14298. } while (0)
  14299. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  14300. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  14301. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  14302. do { \
  14303. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  14304. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  14305. } while (0)
  14306. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  14307. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  14308. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  14309. do { \
  14310. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  14311. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  14312. } while (0)
  14313. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  14314. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  14315. #define HTT_TX_CREDIT_MSG_BYTES 4
  14316. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  14317. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  14318. /**
  14319. * @brief HTT WDI_IPA Operation Response Message
  14320. *
  14321. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  14322. *
  14323. * @details
  14324. * HTT WDI_IPA Operation Response message is sent by target
  14325. * to host confirming suspend or resume operation.
  14326. * |31 24|23 16|15 8|7 0|
  14327. * |----------------+----------------+----------------+----------------|
  14328. * | op_code | Rsvd | msg_type |
  14329. * |-------------------------------------------------------------------|
  14330. * | Rsvd | Response len |
  14331. * |-------------------------------------------------------------------|
  14332. * | |
  14333. * | Response-type specific info |
  14334. * | |
  14335. * | |
  14336. * |-------------------------------------------------------------------|
  14337. * Header fields:
  14338. * - MSG_TYPE
  14339. * Bits 7:0
  14340. * Purpose: Identifies this as WDI_IPA Operation Response message
  14341. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  14342. * - OP_CODE
  14343. * Bits 31:16
  14344. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  14345. * value: = enum htt_wdi_ipa_op_code
  14346. * - RSP_LEN
  14347. * Bits 16:0
  14348. * Purpose: length for the response-type specific info
  14349. * value: = length in bytes for response-type specific info
  14350. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  14351. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  14352. */
  14353. PREPACK struct htt_wdi_ipa_op_response_t
  14354. {
  14355. /* DWORD 0: flags and meta-data */
  14356. A_UINT32
  14357. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  14358. reserved1: 8,
  14359. op_code: 16;
  14360. A_UINT32
  14361. rsp_len: 16,
  14362. reserved2: 16;
  14363. } POSTPACK;
  14364. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  14365. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  14366. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  14367. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  14368. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  14369. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  14370. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  14371. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  14372. do { \
  14373. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  14374. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  14375. } while (0)
  14376. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  14377. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  14378. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  14379. do { \
  14380. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  14381. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  14382. } while (0)
  14383. enum htt_phy_mode {
  14384. htt_phy_mode_11a = 0,
  14385. htt_phy_mode_11g = 1,
  14386. htt_phy_mode_11b = 2,
  14387. htt_phy_mode_11g_only = 3,
  14388. htt_phy_mode_11na_ht20 = 4,
  14389. htt_phy_mode_11ng_ht20 = 5,
  14390. htt_phy_mode_11na_ht40 = 6,
  14391. htt_phy_mode_11ng_ht40 = 7,
  14392. htt_phy_mode_11ac_vht20 = 8,
  14393. htt_phy_mode_11ac_vht40 = 9,
  14394. htt_phy_mode_11ac_vht80 = 10,
  14395. htt_phy_mode_11ac_vht20_2g = 11,
  14396. htt_phy_mode_11ac_vht40_2g = 12,
  14397. htt_phy_mode_11ac_vht80_2g = 13,
  14398. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  14399. htt_phy_mode_11ac_vht160 = 15,
  14400. htt_phy_mode_max,
  14401. };
  14402. /**
  14403. * @brief target -> host HTT channel change indication
  14404. *
  14405. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  14406. *
  14407. * @details
  14408. * Specify when a channel change occurs.
  14409. * This allows the host to precisely determine which rx frames arrived
  14410. * on the old channel and which rx frames arrived on the new channel.
  14411. *
  14412. *|31 |7 0 |
  14413. *|-------------------------------------------+----------|
  14414. *| reserved | msg type |
  14415. *|------------------------------------------------------|
  14416. *| primary_chan_center_freq_mhz |
  14417. *|------------------------------------------------------|
  14418. *| contiguous_chan1_center_freq_mhz |
  14419. *|------------------------------------------------------|
  14420. *| contiguous_chan2_center_freq_mhz |
  14421. *|------------------------------------------------------|
  14422. *| phy_mode |
  14423. *|------------------------------------------------------|
  14424. *
  14425. * Header fields:
  14426. * - MSG_TYPE
  14427. * Bits 7:0
  14428. * Purpose: identifies this as a htt channel change indication message
  14429. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  14430. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  14431. * Bits 31:0
  14432. * Purpose: identify the (center of the) new 20 MHz primary channel
  14433. * Value: center frequency of the 20 MHz primary channel, in MHz units
  14434. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  14435. * Bits 31:0
  14436. * Purpose: identify the (center of the) contiguous frequency range
  14437. * comprising the new channel.
  14438. * For example, if the new channel is a 80 MHz channel extending
  14439. * 60 MHz beyond the primary channel, this field would be 30 larger
  14440. * than the primary channel center frequency field.
  14441. * Value: center frequency of the contiguous frequency range comprising
  14442. * the full channel in MHz units
  14443. * (80+80 channels also use the CONTIG_CHAN2 field)
  14444. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  14445. * Bits 31:0
  14446. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  14447. * within a VHT 80+80 channel.
  14448. * This field is only relevant for VHT 80+80 channels.
  14449. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  14450. * channel (arbitrary value for cases besides VHT 80+80)
  14451. * - PHY_MODE
  14452. * Bits 31:0
  14453. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  14454. * and band
  14455. * Value: htt_phy_mode enum value
  14456. */
  14457. PREPACK struct htt_chan_change_t
  14458. {
  14459. /* DWORD 0: flags and meta-data */
  14460. A_UINT32
  14461. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  14462. reserved1: 24;
  14463. A_UINT32 primary_chan_center_freq_mhz;
  14464. A_UINT32 contig_chan1_center_freq_mhz;
  14465. A_UINT32 contig_chan2_center_freq_mhz;
  14466. A_UINT32 phy_mode;
  14467. } POSTPACK;
  14468. /*
  14469. * Due to historical / backwards-compatibility reasons, maintain the
  14470. * below htt_chan_change_msg struct definition, which needs to be
  14471. * consistent with the above htt_chan_change_t struct definition
  14472. * (aside from the htt_chan_change_t definition including the msg_type
  14473. * dword within the message, and the htt_chan_change_msg only containing
  14474. * the payload of the message that follows the msg_type dword).
  14475. */
  14476. PREPACK struct htt_chan_change_msg {
  14477. A_UINT32 chan_mhz; /* frequency in mhz */
  14478. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  14479. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  14480. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  14481. } POSTPACK;
  14482. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  14483. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  14484. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  14485. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  14486. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  14487. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  14488. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  14489. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  14490. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  14491. do { \
  14492. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  14493. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  14494. } while (0)
  14495. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  14496. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  14497. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  14498. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  14499. do { \
  14500. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  14501. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  14502. } while (0)
  14503. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  14504. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  14505. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  14506. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  14507. do { \
  14508. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  14509. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  14510. } while (0)
  14511. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  14512. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  14513. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  14514. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  14515. do { \
  14516. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  14517. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  14518. } while (0)
  14519. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  14520. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  14521. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  14522. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  14523. /**
  14524. * @brief rx offload packet error message
  14525. *
  14526. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  14527. *
  14528. * @details
  14529. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  14530. * of target payload like mic err.
  14531. *
  14532. * |31 24|23 16|15 8|7 0|
  14533. * |----------------+----------------+----------------+----------------|
  14534. * | tid | vdev_id | msg_sub_type | msg_type |
  14535. * |-------------------------------------------------------------------|
  14536. * : (sub-type dependent content) :
  14537. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14538. * Header fields:
  14539. * - msg_type
  14540. * Bits 7:0
  14541. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  14542. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  14543. * - msg_sub_type
  14544. * Bits 15:8
  14545. * Purpose: Identifies which type of rx error is reported by this message
  14546. * value: htt_rx_ofld_pkt_err_type
  14547. * - vdev_id
  14548. * Bits 23:16
  14549. * Purpose: Identifies which vdev received the erroneous rx frame
  14550. * value:
  14551. * - tid
  14552. * Bits 31:24
  14553. * Purpose: Identifies the traffic type of the rx frame
  14554. * value:
  14555. *
  14556. * - The payload fields used if the sub-type == MIC error are shown below.
  14557. * Note - MIC err is per MSDU, while PN is per MPDU.
  14558. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  14559. * with MIC err in A-MSDU case, so FW will send only one HTT message
  14560. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  14561. * instead of sending separate HTT messages for each wrong MSDU within
  14562. * the MPDU.
  14563. *
  14564. * |31 24|23 16|15 8|7 0|
  14565. * |----------------+----------------+----------------+----------------|
  14566. * | Rsvd | key_id | peer_id |
  14567. * |-------------------------------------------------------------------|
  14568. * | receiver MAC addr 31:0 |
  14569. * |-------------------------------------------------------------------|
  14570. * | Rsvd | receiver MAC addr 47:32 |
  14571. * |-------------------------------------------------------------------|
  14572. * | transmitter MAC addr 31:0 |
  14573. * |-------------------------------------------------------------------|
  14574. * | Rsvd | transmitter MAC addr 47:32 |
  14575. * |-------------------------------------------------------------------|
  14576. * | PN 31:0 |
  14577. * |-------------------------------------------------------------------|
  14578. * | Rsvd | PN 47:32 |
  14579. * |-------------------------------------------------------------------|
  14580. * - peer_id
  14581. * Bits 15:0
  14582. * Purpose: identifies which peer is frame is from
  14583. * value:
  14584. * - key_id
  14585. * Bits 23:16
  14586. * Purpose: identifies key_id of rx frame
  14587. * value:
  14588. * - RA_31_0 (receiver MAC addr 31:0)
  14589. * Bits 31:0
  14590. * Purpose: identifies by MAC address which vdev received the frame
  14591. * value: MAC address lower 4 bytes
  14592. * - RA_47_32 (receiver MAC addr 47:32)
  14593. * Bits 15:0
  14594. * Purpose: identifies by MAC address which vdev received the frame
  14595. * value: MAC address upper 2 bytes
  14596. * - TA_31_0 (transmitter MAC addr 31:0)
  14597. * Bits 31:0
  14598. * Purpose: identifies by MAC address which peer transmitted the frame
  14599. * value: MAC address lower 4 bytes
  14600. * - TA_47_32 (transmitter MAC addr 47:32)
  14601. * Bits 15:0
  14602. * Purpose: identifies by MAC address which peer transmitted the frame
  14603. * value: MAC address upper 2 bytes
  14604. * - PN_31_0
  14605. * Bits 31:0
  14606. * Purpose: Identifies pn of rx frame
  14607. * value: PN lower 4 bytes
  14608. * - PN_47_32
  14609. * Bits 15:0
  14610. * Purpose: Identifies pn of rx frame
  14611. * value:
  14612. * TKIP or CCMP: PN upper 2 bytes
  14613. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  14614. */
  14615. enum htt_rx_ofld_pkt_err_type {
  14616. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  14617. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  14618. };
  14619. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  14620. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  14621. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  14622. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  14623. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  14624. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  14625. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  14626. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  14627. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  14628. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  14629. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  14630. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  14631. do { \
  14632. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  14633. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  14634. } while (0)
  14635. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  14636. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  14637. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  14638. do { \
  14639. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  14640. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  14641. } while (0)
  14642. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  14643. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  14644. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  14645. do { \
  14646. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  14647. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  14648. } while (0)
  14649. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  14650. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  14651. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  14652. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  14653. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  14654. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  14655. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  14656. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  14657. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  14658. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  14659. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  14660. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  14661. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  14662. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  14663. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  14664. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  14665. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  14666. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  14667. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  14668. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  14669. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  14670. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  14671. do { \
  14672. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  14673. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  14674. } while (0)
  14675. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  14676. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  14677. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  14678. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  14679. do { \
  14680. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  14681. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  14682. } while (0)
  14683. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  14684. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  14685. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  14686. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  14687. do { \
  14688. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  14689. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  14690. } while (0)
  14691. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  14692. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  14693. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  14694. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  14695. do { \
  14696. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  14697. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  14698. } while (0)
  14699. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  14700. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  14701. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  14702. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  14703. do { \
  14704. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  14705. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  14706. } while (0)
  14707. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  14708. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  14709. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  14710. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  14711. do { \
  14712. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  14713. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  14714. } while (0)
  14715. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  14716. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  14717. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  14718. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  14719. do { \
  14720. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  14721. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  14722. } while (0)
  14723. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  14724. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  14725. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  14726. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  14727. do { \
  14728. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  14729. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  14730. } while (0)
  14731. /**
  14732. * @brief target -> host peer rate report message
  14733. *
  14734. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  14735. *
  14736. * @details
  14737. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  14738. * justified rate of all the peers.
  14739. *
  14740. * |31 24|23 16|15 8|7 0|
  14741. * |----------------+----------------+----------------+----------------|
  14742. * | peer_count | | msg_type |
  14743. * |-------------------------------------------------------------------|
  14744. * : Payload (variant number of peer rate report) :
  14745. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14746. * Header fields:
  14747. * - msg_type
  14748. * Bits 7:0
  14749. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  14750. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  14751. * - reserved
  14752. * Bits 15:8
  14753. * Purpose:
  14754. * value:
  14755. * - peer_count
  14756. * Bits 31:16
  14757. * Purpose: Specify how many peer rate report elements are present in the payload.
  14758. * value:
  14759. *
  14760. * Payload:
  14761. * There are variant number of peer rate report follow the first 32 bits.
  14762. * The peer rate report is defined as follows.
  14763. *
  14764. * |31 20|19 16|15 0|
  14765. * |-----------------------+---------+---------------------------------|-
  14766. * | reserved | phy | peer_id | \
  14767. * |-------------------------------------------------------------------| -> report #0
  14768. * | rate | /
  14769. * |-----------------------+---------+---------------------------------|-
  14770. * | reserved | phy | peer_id | \
  14771. * |-------------------------------------------------------------------| -> report #1
  14772. * | rate | /
  14773. * |-----------------------+---------+---------------------------------|-
  14774. * | reserved | phy | peer_id | \
  14775. * |-------------------------------------------------------------------| -> report #2
  14776. * | rate | /
  14777. * |-------------------------------------------------------------------|-
  14778. * : :
  14779. * : :
  14780. * : :
  14781. * :-------------------------------------------------------------------:
  14782. *
  14783. * - peer_id
  14784. * Bits 15:0
  14785. * Purpose: identify the peer
  14786. * value:
  14787. * - phy
  14788. * Bits 19:16
  14789. * Purpose: identify which phy is in use
  14790. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  14791. * Please see enum htt_peer_report_phy_type for detail.
  14792. * - reserved
  14793. * Bits 31:20
  14794. * Purpose:
  14795. * value:
  14796. * - rate
  14797. * Bits 31:0
  14798. * Purpose: represent the justified rate of the peer specified by peer_id
  14799. * value:
  14800. */
  14801. enum htt_peer_rate_report_phy_type {
  14802. HTT_PEER_RATE_REPORT_11B = 0,
  14803. HTT_PEER_RATE_REPORT_11A_G,
  14804. HTT_PEER_RATE_REPORT_11N,
  14805. HTT_PEER_RATE_REPORT_11AC,
  14806. };
  14807. #define HTT_PEER_RATE_REPORT_SIZE 8
  14808. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  14809. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  14810. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  14811. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  14812. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  14813. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  14814. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  14815. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  14816. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  14817. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  14818. do { \
  14819. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  14820. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  14821. } while (0)
  14822. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  14823. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  14824. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  14825. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  14826. do { \
  14827. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  14828. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  14829. } while (0)
  14830. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  14831. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  14832. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  14833. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  14834. do { \
  14835. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  14836. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  14837. } while (0)
  14838. /**
  14839. * @brief target -> host flow pool map message
  14840. *
  14841. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  14842. *
  14843. * @details
  14844. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  14845. * a flow of descriptors.
  14846. *
  14847. * This message is in TLV format and indicates the parameters to be setup a
  14848. * flow in the host. Each entry indicates that a particular flow ID is ready to
  14849. * receive descriptors from a specified pool.
  14850. *
  14851. * The message would appear as follows:
  14852. *
  14853. * |31 24|23 16|15 8|7 0|
  14854. * |----------------+----------------+----------------+----------------|
  14855. * header | reserved | num_flows | msg_type |
  14856. * |-------------------------------------------------------------------|
  14857. * | |
  14858. * : payload :
  14859. * | |
  14860. * |-------------------------------------------------------------------|
  14861. *
  14862. * The header field is one DWORD long and is interpreted as follows:
  14863. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  14864. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  14865. * this message
  14866. * b'16-31 - reserved: These bits are reserved for future use
  14867. *
  14868. * Payload:
  14869. * The payload would contain multiple objects of the following structure. Each
  14870. * object represents a flow.
  14871. *
  14872. * |31 24|23 16|15 8|7 0|
  14873. * |----------------+----------------+----------------+----------------|
  14874. * header | reserved | num_flows | msg_type |
  14875. * |-------------------------------------------------------------------|
  14876. * payload0| flow_type |
  14877. * |-------------------------------------------------------------------|
  14878. * | flow_id |
  14879. * |-------------------------------------------------------------------|
  14880. * | reserved0 | flow_pool_id |
  14881. * |-------------------------------------------------------------------|
  14882. * | reserved1 | flow_pool_size |
  14883. * |-------------------------------------------------------------------|
  14884. * | reserved2 |
  14885. * |-------------------------------------------------------------------|
  14886. * payload1| flow_type |
  14887. * |-------------------------------------------------------------------|
  14888. * | flow_id |
  14889. * |-------------------------------------------------------------------|
  14890. * | reserved0 | flow_pool_id |
  14891. * |-------------------------------------------------------------------|
  14892. * | reserved1 | flow_pool_size |
  14893. * |-------------------------------------------------------------------|
  14894. * | reserved2 |
  14895. * |-------------------------------------------------------------------|
  14896. * | . |
  14897. * | . |
  14898. * | . |
  14899. * |-------------------------------------------------------------------|
  14900. *
  14901. * Each payload is 5 DWORDS long and is interpreted as follows:
  14902. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  14903. * this flow is associated. It can be VDEV, peer,
  14904. * or tid (AC). Based on enum htt_flow_type.
  14905. *
  14906. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14907. * object. For flow_type vdev it is set to the
  14908. * vdevid, for peer it is peerid and for tid, it is
  14909. * tid_num.
  14910. *
  14911. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  14912. * in the host for this flow
  14913. * b'16:31 - reserved0: This field in reserved for the future. In case
  14914. * we have a hierarchical implementation (HCM) of
  14915. * pools, it can be used to indicate the ID of the
  14916. * parent-pool.
  14917. *
  14918. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  14919. * Descriptors for this flow will be
  14920. * allocated from this pool in the host.
  14921. * b'16:31 - reserved1: This field in reserved for the future. In case
  14922. * we have a hierarchical implementation of pools,
  14923. * it can be used to indicate the max number of
  14924. * descriptors in the pool. The b'0:15 can be used
  14925. * to indicate min number of descriptors in the
  14926. * HCM scheme.
  14927. *
  14928. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  14929. * we have a hierarchical implementation of pools,
  14930. * b'0:15 can be used to indicate the
  14931. * priority-based borrowing (PBB) threshold of
  14932. * the flow's pool. The b'16:31 are still left
  14933. * reserved.
  14934. */
  14935. enum htt_flow_type {
  14936. FLOW_TYPE_VDEV = 0,
  14937. /* Insert new flow types above this line */
  14938. };
  14939. PREPACK struct htt_flow_pool_map_payload_t {
  14940. A_UINT32 flow_type;
  14941. A_UINT32 flow_id;
  14942. A_UINT32 flow_pool_id:16,
  14943. reserved0:16;
  14944. A_UINT32 flow_pool_size:16,
  14945. reserved1:16;
  14946. A_UINT32 reserved2;
  14947. } POSTPACK;
  14948. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  14949. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  14950. (sizeof(struct htt_flow_pool_map_payload_t))
  14951. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  14952. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  14953. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  14954. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  14955. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  14956. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  14957. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  14958. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  14959. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  14960. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  14961. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  14962. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  14963. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  14964. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  14965. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  14966. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  14967. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  14968. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  14969. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  14970. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  14971. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  14972. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  14973. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  14974. do { \
  14975. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  14976. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  14977. } while (0)
  14978. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  14979. do { \
  14980. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  14981. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  14982. } while (0)
  14983. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  14984. do { \
  14985. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  14986. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  14987. } while (0)
  14988. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  14989. do { \
  14990. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  14991. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  14992. } while (0)
  14993. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  14994. do { \
  14995. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  14996. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  14997. } while (0)
  14998. /**
  14999. * @brief target -> host flow pool unmap message
  15000. *
  15001. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  15002. *
  15003. * @details
  15004. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  15005. * down a flow of descriptors.
  15006. * This message indicates that for the flow (whose ID is provided) is wanting
  15007. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  15008. * pool of descriptors from where descriptors are being allocated for this
  15009. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  15010. * be unmapped by the host.
  15011. *
  15012. * The message would appear as follows:
  15013. *
  15014. * |31 24|23 16|15 8|7 0|
  15015. * |----------------+----------------+----------------+----------------|
  15016. * | reserved0 | msg_type |
  15017. * |-------------------------------------------------------------------|
  15018. * | flow_type |
  15019. * |-------------------------------------------------------------------|
  15020. * | flow_id |
  15021. * |-------------------------------------------------------------------|
  15022. * | reserved1 | flow_pool_id |
  15023. * |-------------------------------------------------------------------|
  15024. *
  15025. * The message is interpreted as follows:
  15026. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  15027. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  15028. * b'8:31 - reserved0: Reserved for future use
  15029. *
  15030. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  15031. * this flow is associated. It can be VDEV, peer,
  15032. * or tid (AC). Based on enum htt_flow_type.
  15033. *
  15034. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  15035. * object. For flow_type vdev it is set to the
  15036. * vdevid, for peer it is peerid and for tid, it is
  15037. * tid_num.
  15038. *
  15039. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  15040. * used in the host for this flow
  15041. * b'16:31 - reserved0: This field in reserved for the future.
  15042. *
  15043. */
  15044. PREPACK struct htt_flow_pool_unmap_t {
  15045. A_UINT32 msg_type:8,
  15046. reserved0:24;
  15047. A_UINT32 flow_type;
  15048. A_UINT32 flow_id;
  15049. A_UINT32 flow_pool_id:16,
  15050. reserved1:16;
  15051. } POSTPACK;
  15052. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  15053. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  15054. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  15055. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  15056. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  15057. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  15058. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  15059. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  15060. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  15061. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  15062. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  15063. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  15064. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  15065. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  15066. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  15067. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  15068. do { \
  15069. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  15070. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  15071. } while (0)
  15072. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  15073. do { \
  15074. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  15075. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  15076. } while (0)
  15077. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  15078. do { \
  15079. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  15080. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  15081. } while (0)
  15082. /**
  15083. * @brief target -> host SRING setup done message
  15084. *
  15085. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  15086. *
  15087. * @details
  15088. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  15089. * SRNG ring setup is done
  15090. *
  15091. * This message indicates whether the last setup operation is successful.
  15092. * It will be sent to host when host set respose_required bit in
  15093. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  15094. * The message would appear as follows:
  15095. *
  15096. * |31 24|23 16|15 8|7 0|
  15097. * |--------------- +----------------+----------------+----------------|
  15098. * | setup_status | ring_id | pdev_id | msg_type |
  15099. * |-------------------------------------------------------------------|
  15100. *
  15101. * The message is interpreted as follows:
  15102. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  15103. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  15104. * b'8:15 - pdev_id:
  15105. * 0 (for rings at SOC/UMAC level),
  15106. * 1/2/3 mac id (for rings at LMAC level)
  15107. * b'16:23 - ring_id: Identify the ring which is set up
  15108. * More details can be got from enum htt_srng_ring_id
  15109. * b'24:31 - setup_status: Indicate status of setup operation
  15110. * Refer to htt_ring_setup_status
  15111. */
  15112. PREPACK struct htt_sring_setup_done_t {
  15113. A_UINT32 msg_type: 8,
  15114. pdev_id: 8,
  15115. ring_id: 8,
  15116. setup_status: 8;
  15117. } POSTPACK;
  15118. enum htt_ring_setup_status {
  15119. htt_ring_setup_status_ok = 0,
  15120. htt_ring_setup_status_error,
  15121. };
  15122. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  15123. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  15124. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  15125. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  15126. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  15127. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  15128. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  15129. do { \
  15130. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  15131. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  15132. } while (0)
  15133. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  15134. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  15135. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  15136. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  15137. HTT_SRING_SETUP_DONE_RING_ID_S)
  15138. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  15139. do { \
  15140. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  15141. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  15142. } while (0)
  15143. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  15144. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  15145. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  15146. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  15147. HTT_SRING_SETUP_DONE_STATUS_S)
  15148. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  15149. do { \
  15150. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  15151. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  15152. } while (0)
  15153. /**
  15154. * @brief target -> flow map flow info
  15155. *
  15156. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  15157. *
  15158. * @details
  15159. * HTT TX map flow entry with tqm flow pointer
  15160. * Sent from firmware to host to add tqm flow pointer in corresponding
  15161. * flow search entry. Flow metadata is replayed back to host as part of this
  15162. * struct to enable host to find the specific flow search entry
  15163. *
  15164. * The message would appear as follows:
  15165. *
  15166. * |31 28|27 18|17 14|13 8|7 0|
  15167. * |-------+------------------------------------------+----------------|
  15168. * | rsvd0 | fse_hsh_idx | msg_type |
  15169. * |-------------------------------------------------------------------|
  15170. * | rsvd1 | tid | peer_id |
  15171. * |-------------------------------------------------------------------|
  15172. * | tqm_flow_pntr_lo |
  15173. * |-------------------------------------------------------------------|
  15174. * | tqm_flow_pntr_hi |
  15175. * |-------------------------------------------------------------------|
  15176. * | fse_meta_data |
  15177. * |-------------------------------------------------------------------|
  15178. *
  15179. * The message is interpreted as follows:
  15180. *
  15181. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  15182. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  15183. *
  15184. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  15185. * for this flow entry
  15186. *
  15187. * dword0 - b'28:31 - rsvd0: Reserved for future use
  15188. *
  15189. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  15190. *
  15191. * dword1 - b'14:17 - tid
  15192. *
  15193. * dword1 - b'18:31 - rsvd1: Reserved for future use
  15194. *
  15195. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  15196. *
  15197. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  15198. *
  15199. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  15200. * given by host
  15201. */
  15202. PREPACK struct htt_tx_map_flow_info {
  15203. A_UINT32
  15204. msg_type: 8,
  15205. fse_hsh_idx: 20,
  15206. rsvd0: 4;
  15207. A_UINT32
  15208. peer_id: 14,
  15209. tid: 4,
  15210. rsvd1: 14;
  15211. A_UINT32 tqm_flow_pntr_lo;
  15212. A_UINT32 tqm_flow_pntr_hi;
  15213. struct htt_tx_flow_metadata fse_meta_data;
  15214. } POSTPACK;
  15215. /* DWORD 0 */
  15216. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  15217. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  15218. /* DWORD 1 */
  15219. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  15220. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  15221. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  15222. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  15223. /* DWORD 0 */
  15224. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  15225. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  15226. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  15227. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  15228. do { \
  15229. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  15230. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  15231. } while (0)
  15232. /* DWORD 1 */
  15233. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  15234. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  15235. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  15236. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  15237. do { \
  15238. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  15239. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  15240. } while (0)
  15241. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  15242. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  15243. HTT_TX_MAP_FLOW_INFO_TID_S)
  15244. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  15245. do { \
  15246. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  15247. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  15248. } while (0)
  15249. /*
  15250. * htt_dbg_ext_stats_status -
  15251. * present - The requested stats have been delivered in full.
  15252. * This indicates that either the stats information was contained
  15253. * in its entirety within this message, or else this message
  15254. * completes the delivery of the requested stats info that was
  15255. * partially delivered through earlier STATS_CONF messages.
  15256. * partial - The requested stats have been delivered in part.
  15257. * One or more subsequent STATS_CONF messages with the same
  15258. * cookie value will be sent to deliver the remainder of the
  15259. * information.
  15260. * error - The requested stats could not be delivered, for example due
  15261. * to a shortage of memory to construct a message holding the
  15262. * requested stats.
  15263. * invalid - The requested stat type is either not recognized, or the
  15264. * target is configured to not gather the stats type in question.
  15265. */
  15266. enum htt_dbg_ext_stats_status {
  15267. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  15268. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  15269. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  15270. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  15271. };
  15272. /**
  15273. * @brief target -> host ppdu stats upload
  15274. *
  15275. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  15276. *
  15277. * @details
  15278. * The following field definitions describe the format of the HTT target
  15279. * to host ppdu stats indication message.
  15280. *
  15281. *
  15282. * |31 16|15 12|11 10|9 8|7 0 |
  15283. * |----------------------------------------------------------------------|
  15284. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  15285. * |----------------------------------------------------------------------|
  15286. * | ppdu_id |
  15287. * |----------------------------------------------------------------------|
  15288. * | Timestamp in us |
  15289. * |----------------------------------------------------------------------|
  15290. * | reserved |
  15291. * |----------------------------------------------------------------------|
  15292. * | type-specific stats info |
  15293. * | (see htt_ppdu_stats.h) |
  15294. * |----------------------------------------------------------------------|
  15295. * Header fields:
  15296. * - MSG_TYPE
  15297. * Bits 7:0
  15298. * Purpose: Identifies this is a PPDU STATS indication
  15299. * message.
  15300. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  15301. * - mac_id
  15302. * Bits 9:8
  15303. * Purpose: mac_id of this ppdu_id
  15304. * Value: 0-3
  15305. * - pdev_id
  15306. * Bits 11:10
  15307. * Purpose: pdev_id of this ppdu_id
  15308. * Value: 0-3
  15309. * 0 (for rings at SOC level),
  15310. * 1/2/3 PDEV -> 0/1/2
  15311. * - payload_size
  15312. * Bits 31:16
  15313. * Purpose: total tlv size
  15314. * Value: payload_size in bytes
  15315. */
  15316. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  15317. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  15318. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  15319. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  15320. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  15321. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  15322. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  15323. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  15324. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  15325. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  15326. do { \
  15327. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  15328. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  15329. } while (0)
  15330. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  15331. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  15332. HTT_T2H_PPDU_STATS_MAC_ID_S)
  15333. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  15334. do { \
  15335. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  15336. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  15337. } while (0)
  15338. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  15339. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  15340. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  15341. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  15342. do { \
  15343. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  15344. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  15345. } while (0)
  15346. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  15347. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  15348. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  15349. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  15350. do { \
  15351. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  15352. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  15353. } while (0)
  15354. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  15355. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  15356. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  15357. /* htt_t2h_ppdu_stats_ind_hdr_t
  15358. * This struct contains the fields within the header of the
  15359. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  15360. * stats info.
  15361. * This struct assumes little-endian layout, and thus is only
  15362. * suitable for use within processors known to be little-endian
  15363. * (such as the target).
  15364. * In contrast, the above macros provide endian-portable methods
  15365. * to get and set the bitfields within this PPDU_STATS_IND header.
  15366. */
  15367. typedef struct {
  15368. A_UINT32 msg_type: 8, /* bits 7:0 */
  15369. mac_id: 2, /* bits 9:8 */
  15370. pdev_id: 2, /* bits 11:10 */
  15371. reserved1: 4, /* bits 15:12 */
  15372. payload_size: 16; /* bits 31:16 */
  15373. A_UINT32 ppdu_id;
  15374. A_UINT32 timestamp_us;
  15375. A_UINT32 reserved2;
  15376. } htt_t2h_ppdu_stats_ind_hdr_t;
  15377. /**
  15378. * @brief target -> host extended statistics upload
  15379. *
  15380. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  15381. *
  15382. * @details
  15383. * The following field definitions describe the format of the HTT target
  15384. * to host stats upload confirmation message.
  15385. * The message contains a cookie echoed from the HTT host->target stats
  15386. * upload request, which identifies which request the confirmation is
  15387. * for, and a single stats can span over multiple HTT stats indication
  15388. * due to the HTT message size limitation so every HTT ext stats indication
  15389. * will have tag-length-value stats information elements.
  15390. * The tag-length header for each HTT stats IND message also includes a
  15391. * status field, to indicate whether the request for the stat type in
  15392. * question was fully met, partially met, unable to be met, or invalid
  15393. * (if the stat type in question is disabled in the target).
  15394. * A Done bit 1's indicate the end of the of stats info elements.
  15395. *
  15396. *
  15397. * |31 16|15 12|11|10 8|7 5|4 0|
  15398. * |--------------------------------------------------------------|
  15399. * | reserved | msg type |
  15400. * |--------------------------------------------------------------|
  15401. * | cookie LSBs |
  15402. * |--------------------------------------------------------------|
  15403. * | cookie MSBs |
  15404. * |--------------------------------------------------------------|
  15405. * | stats entry length | rsvd | D| S | stat type |
  15406. * |--------------------------------------------------------------|
  15407. * | type-specific stats info |
  15408. * | (see htt_stats.h) |
  15409. * |--------------------------------------------------------------|
  15410. * Header fields:
  15411. * - MSG_TYPE
  15412. * Bits 7:0
  15413. * Purpose: Identifies this is a extended statistics upload confirmation
  15414. * message.
  15415. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  15416. * - COOKIE_LSBS
  15417. * Bits 31:0
  15418. * Purpose: Provide a mechanism to match a target->host stats confirmation
  15419. * message with its preceding host->target stats request message.
  15420. * Value: LSBs of the opaque cookie specified by the host-side requestor
  15421. * - COOKIE_MSBS
  15422. * Bits 31:0
  15423. * Purpose: Provide a mechanism to match a target->host stats confirmation
  15424. * message with its preceding host->target stats request message.
  15425. * Value: MSBs of the opaque cookie specified by the host-side requestor
  15426. *
  15427. * Stats Information Element tag-length header fields:
  15428. * - STAT_TYPE
  15429. * Bits 7:0
  15430. * Purpose: identifies the type of statistics info held in the
  15431. * following information element
  15432. * Value: htt_dbg_ext_stats_type
  15433. * - STATUS
  15434. * Bits 10:8
  15435. * Purpose: indicate whether the requested stats are present
  15436. * Value: htt_dbg_ext_stats_status
  15437. * - DONE
  15438. * Bits 11
  15439. * Purpose:
  15440. * Indicates the completion of the stats entry, this will be the last
  15441. * stats conf HTT segment for the requested stats type.
  15442. * Value:
  15443. * 0 -> the stats retrieval is ongoing
  15444. * 1 -> the stats retrieval is complete
  15445. * - LENGTH
  15446. * Bits 31:16
  15447. * Purpose: indicate the stats information size
  15448. * Value: This field specifies the number of bytes of stats information
  15449. * that follows the element tag-length header.
  15450. * It is expected but not required that this length is a multiple of
  15451. * 4 bytes.
  15452. */
  15453. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  15454. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  15455. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  15456. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  15457. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  15458. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  15459. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  15460. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  15461. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  15462. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  15463. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  15464. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  15465. do { \
  15466. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  15467. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  15468. } while (0)
  15469. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  15470. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  15471. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  15472. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  15473. do { \
  15474. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  15475. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  15476. } while (0)
  15477. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  15478. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  15479. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  15480. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  15481. do { \
  15482. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  15483. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  15484. } while (0)
  15485. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  15486. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  15487. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  15488. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  15489. do { \
  15490. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  15491. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  15492. } while (0)
  15493. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  15494. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  15495. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  15496. /**
  15497. * @brief target -> host streaming statistics upload
  15498. *
  15499. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  15500. *
  15501. * @details
  15502. * The following field definitions describe the format of the HTT target
  15503. * to host streaming stats upload indication message.
  15504. * The host can use a STREAMING_STATS_REQ message to enable the target to
  15505. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  15506. * use the STREAMING_STATS_REQ message to halt the target's production of
  15507. * STREAMING_STATS_IND messages.
  15508. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  15509. * the stats enabled by the host's STREAMING_STATS_REQ message.
  15510. *
  15511. * |31 8|7 0|
  15512. * |--------------------------------------------------------------|
  15513. * | reserved | msg type |
  15514. * |--------------------------------------------------------------|
  15515. * | type-specific stats info |
  15516. * | (see htt_stats.h) |
  15517. * |--------------------------------------------------------------|
  15518. * Header fields:
  15519. * - MSG_TYPE
  15520. * Bits 7:0
  15521. * Purpose: Identifies this as a streaming statistics upload indication
  15522. * message.
  15523. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  15524. */
  15525. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  15526. typedef enum {
  15527. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  15528. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  15529. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  15530. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  15531. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  15532. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  15533. /* Reserved from 128 - 255 for target internal use.*/
  15534. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  15535. } HTT_PEER_TYPE;
  15536. /** macro to convert MAC address from char array to HTT word format */
  15537. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  15538. (phtt_mac_addr)->mac_addr31to0 = \
  15539. (((c_macaddr)[0] << 0) | \
  15540. ((c_macaddr)[1] << 8) | \
  15541. ((c_macaddr)[2] << 16) | \
  15542. ((c_macaddr)[3] << 24)); \
  15543. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  15544. } while (0)
  15545. /**
  15546. * @brief target -> host monitor mac header indication message
  15547. *
  15548. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  15549. *
  15550. * @details
  15551. * The following diagram shows the format of the monitor mac header message
  15552. * sent from the target to the host.
  15553. * This message is primarily sent when promiscuous rx mode is enabled.
  15554. * One message is sent per rx PPDU.
  15555. *
  15556. * |31 24|23 16|15 8|7 0|
  15557. * |-------------------------------------------------------------|
  15558. * | peer_id | reserved0 | msg_type |
  15559. * |-------------------------------------------------------------|
  15560. * | reserved1 | num_mpdu |
  15561. * |-------------------------------------------------------------|
  15562. * | struct hw_rx_desc |
  15563. * | (see wal_rx_desc.h) |
  15564. * |-------------------------------------------------------------|
  15565. * | struct ieee80211_frame_addr4 |
  15566. * | (see ieee80211_defs.h) |
  15567. * |-------------------------------------------------------------|
  15568. * | struct ieee80211_frame_addr4 |
  15569. * | (see ieee80211_defs.h) |
  15570. * |-------------------------------------------------------------|
  15571. * | ...... |
  15572. * |-------------------------------------------------------------|
  15573. *
  15574. * Header fields:
  15575. * - msg_type
  15576. * Bits 7:0
  15577. * Purpose: Identifies this is a monitor mac header indication message.
  15578. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  15579. * - peer_id
  15580. * Bits 31:16
  15581. * Purpose: Software peer id given by host during association,
  15582. * During promiscuous mode, the peer ID will be invalid (0xFF)
  15583. * for rx PPDUs received from unassociated peers.
  15584. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  15585. * - num_mpdu
  15586. * Bits 15:0
  15587. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  15588. * delivered within the message.
  15589. * Value: 1 to 32
  15590. * num_mpdu is limited to a maximum value of 32, due to buffer
  15591. * size limits. For PPDUs with more than 32 MPDUs, only the
  15592. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  15593. * the PPDU will be provided.
  15594. */
  15595. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  15596. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  15597. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  15598. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  15599. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  15600. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  15601. do { \
  15602. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  15603. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  15604. } while (0)
  15605. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  15606. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  15607. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  15608. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  15609. do { \
  15610. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  15611. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  15612. } while (0)
  15613. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  15614. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  15615. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  15616. /**
  15617. * @brief target -> host flow pool resize Message
  15618. *
  15619. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  15620. *
  15621. * @details
  15622. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  15623. * the flow pool associated with the specified ID is resized
  15624. *
  15625. * The message would appear as follows:
  15626. *
  15627. * |31 16|15 8|7 0|
  15628. * |---------------------------------+----------------+----------------|
  15629. * | reserved0 | Msg type |
  15630. * |-------------------------------------------------------------------|
  15631. * | flow pool new size | flow pool ID |
  15632. * |-------------------------------------------------------------------|
  15633. *
  15634. * The message is interpreted as follows:
  15635. * b'0:7 - msg_type: This will be set to 0x21
  15636. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  15637. *
  15638. * b'0:15 - flow pool ID: Existing flow pool ID
  15639. *
  15640. * b'16:31 - flow pool new size: new pool size for existing flow pool ID
  15641. *
  15642. */
  15643. PREPACK struct htt_flow_pool_resize_t {
  15644. A_UINT32 msg_type:8,
  15645. reserved0:24;
  15646. A_UINT32 flow_pool_id:16,
  15647. flow_pool_new_size:16;
  15648. } POSTPACK;
  15649. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  15650. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  15651. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  15652. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  15653. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  15654. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  15655. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  15656. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  15657. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  15658. do { \
  15659. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  15660. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  15661. } while (0)
  15662. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  15663. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  15664. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  15665. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  15666. do { \
  15667. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  15668. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  15669. } while (0)
  15670. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  15671. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  15672. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  15673. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  15674. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  15675. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  15676. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  15677. /*
  15678. * The read and write indices point to the data within the host buffer.
  15679. * Because the first 4 bytes of the host buffer is used for the read index and
  15680. * the next 4 bytes for the write index, the data itself starts at offset 8.
  15681. * The read index and write index are the byte offsets from the base of the
  15682. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  15683. * Refer the ASCII text picture below.
  15684. */
  15685. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  15686. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  15687. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  15688. /*
  15689. ***************************************************************************
  15690. *
  15691. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15692. *
  15693. ***************************************************************************
  15694. *
  15695. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  15696. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  15697. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  15698. * written into the Host memory region mentioned below.
  15699. *
  15700. * Read index is updated by the Host. At any point of time, the read index will
  15701. * indicate the index that will next be read by the Host. The read index is
  15702. * in units of bytes offset from the base of the meta-data buffer.
  15703. *
  15704. * Write index is updated by the FW. At any point of time, the write index will
  15705. * indicate from where the FW can start writing any new data. The write index is
  15706. * in units of bytes offset from the base of the meta-data buffer.
  15707. *
  15708. * If the Host is not fast enough in reading the CFR data, any new capture data
  15709. * would be dropped if there is no space left to write the new captures.
  15710. *
  15711. * The last 4 bytes of the memory region will have the magic pattern
  15712. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  15713. * not overrun the host buffer.
  15714. *
  15715. * ,--------------------. read and write indices store the
  15716. * | | byte offset from the base of the
  15717. * | ,--------+--------. meta-data buffer to the next
  15718. * | | | | location within the data buffer
  15719. * | | v v that will be read / written
  15720. * ************************************************************************
  15721. * * Read * Write * * Magic *
  15722. * * index * index * CFR data1 ...... CFR data N * pattern *
  15723. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  15724. * ************************************************************************
  15725. * |<---------- data buffer ---------->|
  15726. *
  15727. * |<----------------- meta-data buffer allocated in Host ----------------|
  15728. *
  15729. * Note:
  15730. * - Considering the 4 bytes needed to store the Read index (R) and the
  15731. * Write index (W), the initial value is as follows:
  15732. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  15733. * - Buffer empty condition:
  15734. * R = W
  15735. *
  15736. * Regarding CFR data format:
  15737. * --------------------------
  15738. *
  15739. * Each CFR tone is stored in HW as 16-bits with the following format:
  15740. * {bits[15:12], bits[11:6], bits[5:0]} =
  15741. * {unsigned exponent (4 bits),
  15742. * signed mantissa_real (6 bits),
  15743. * signed mantissa_imag (6 bits)}
  15744. *
  15745. * CFR_real = mantissa_real * 2^(exponent-5)
  15746. * CFR_imag = mantissa_imag * 2^(exponent-5)
  15747. *
  15748. *
  15749. * The CFR data is written to the 16-bit unsigned output array (buff) in
  15750. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  15751. *
  15752. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  15753. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  15754. * .
  15755. * .
  15756. * .
  15757. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  15758. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  15759. */
  15760. /* Bandwidth of peer CFR captures */
  15761. typedef enum {
  15762. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  15763. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  15764. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  15765. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  15766. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  15767. HTT_PEER_CFR_CAPTURE_BW_MAX,
  15768. } HTT_PEER_CFR_CAPTURE_BW;
  15769. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  15770. * was captured
  15771. */
  15772. typedef enum {
  15773. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  15774. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  15775. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  15776. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  15777. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  15778. } HTT_PEER_CFR_CAPTURE_MODE;
  15779. typedef enum {
  15780. /* This message type is currently used for the below purpose:
  15781. *
  15782. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  15783. * wmi_peer_cfr_capture_cmd.
  15784. * If payload_present bit is set to 0 then the associated memory region
  15785. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  15786. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  15787. * message; the CFR dump will be present at the end of the message,
  15788. * after the chan_phy_mode.
  15789. */
  15790. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  15791. /* Always keep this last */
  15792. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  15793. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  15794. /**
  15795. * @brief target -> host CFR dump completion indication message definition
  15796. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  15797. *
  15798. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  15799. *
  15800. * @details
  15801. * The following diagram shows the format of the Channel Frequency Response
  15802. * (CFR) dump completion indication. This inidcation is sent to the Host when
  15803. * the channel capture of a peer is copied by Firmware into the Host memory
  15804. *
  15805. * **************************************************************************
  15806. *
  15807. * Message format when the CFR capture message type is
  15808. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15809. *
  15810. * **************************************************************************
  15811. *
  15812. * |31 16|15 |8|7 0|
  15813. * |----------------------------------------------------------------|
  15814. * header: | reserved |P| msg_type |
  15815. * word 0 | | | |
  15816. * |----------------------------------------------------------------|
  15817. * payload: | cfr_capture_msg_type |
  15818. * word 1 | |
  15819. * |----------------------------------------------------------------|
  15820. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  15821. * word 2 | | | | | | | | |
  15822. * |----------------------------------------------------------------|
  15823. * | mac_addr31to0 |
  15824. * word 3 | |
  15825. * |----------------------------------------------------------------|
  15826. * | unused / reserved | mac_addr47to32 |
  15827. * word 4 | | |
  15828. * |----------------------------------------------------------------|
  15829. * | index |
  15830. * word 5 | |
  15831. * |----------------------------------------------------------------|
  15832. * | length |
  15833. * word 6 | |
  15834. * |----------------------------------------------------------------|
  15835. * | timestamp |
  15836. * word 7 | |
  15837. * |----------------------------------------------------------------|
  15838. * | counter |
  15839. * word 8 | |
  15840. * |----------------------------------------------------------------|
  15841. * | chan_mhz |
  15842. * word 9 | |
  15843. * |----------------------------------------------------------------|
  15844. * | band_center_freq1 |
  15845. * word 10 | |
  15846. * |----------------------------------------------------------------|
  15847. * | band_center_freq2 |
  15848. * word 11 | |
  15849. * |----------------------------------------------------------------|
  15850. * | chan_phy_mode |
  15851. * word 12 | |
  15852. * |----------------------------------------------------------------|
  15853. * where,
  15854. * P - payload present bit (payload_present explained below)
  15855. * req_id - memory request id (mem_req_id explained below)
  15856. * S - status field (status explained below)
  15857. * capbw - capture bandwidth (capture_bw explained below)
  15858. * mode - mode of capture (mode explained below)
  15859. * sts - space time streams (sts_count explained below)
  15860. * chbw - channel bandwidth (channel_bw explained below)
  15861. * captype - capture type (cap_type explained below)
  15862. *
  15863. * The following field definitions describe the format of the CFR dump
  15864. * completion indication sent from the target to the host
  15865. *
  15866. * Header fields:
  15867. *
  15868. * Word 0
  15869. * - msg_type
  15870. * Bits 7:0
  15871. * Purpose: Identifies this as CFR TX completion indication
  15872. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  15873. * - payload_present
  15874. * Bit 8
  15875. * Purpose: Identifies how CFR data is sent to host
  15876. * Value: 0 - If CFR Payload is written to host memory
  15877. * 1 - If CFR Payload is sent as part of HTT message
  15878. * (This is the requirement for SDIO/USB where it is
  15879. * not possible to write CFR data to host memory)
  15880. * - reserved
  15881. * Bits 31:9
  15882. * Purpose: Reserved
  15883. * Value: 0
  15884. *
  15885. * Payload fields:
  15886. *
  15887. * Word 1
  15888. * - cfr_capture_msg_type
  15889. * Bits 31:0
  15890. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  15891. * to specify the format used for the remainder of the message
  15892. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15893. * (currently only MSG_TYPE_1 is defined)
  15894. *
  15895. * Word 2
  15896. * - mem_req_id
  15897. * Bits 6:0
  15898. * Purpose: Contain the mem request id of the region where the CFR capture
  15899. * has been stored - of type WMI_HOST_MEM_REQ_ID
  15900. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  15901. this value is invalid)
  15902. * - status
  15903. * Bit 7
  15904. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  15905. * Value: 1 (True) - Successful; 0 (False) - Not successful
  15906. * - capture_bw
  15907. * Bits 10:8
  15908. * Purpose: Carry the bandwidth of the CFR capture
  15909. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  15910. * - mode
  15911. * Bits 13:11
  15912. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  15913. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  15914. * - sts_count
  15915. * Bits 16:14
  15916. * Purpose: Carry the number of space time streams
  15917. * Value: Number of space time streams
  15918. * - channel_bw
  15919. * Bits 19:17
  15920. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  15921. * measurement
  15922. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  15923. * - cap_type
  15924. * Bits 23:20
  15925. * Purpose: Carry the type of the capture
  15926. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  15927. * - vdev_id
  15928. * Bits 31:24
  15929. * Purpose: Carry the virtual device id
  15930. * Value: vdev ID
  15931. *
  15932. * Word 3
  15933. * - mac_addr31to0
  15934. * Bits 31:0
  15935. * Purpose: Contain the bits 31:0 of the peer MAC address
  15936. * Value: Bits 31:0 of the peer MAC address
  15937. *
  15938. * Word 4
  15939. * - mac_addr47to32
  15940. * Bits 15:0
  15941. * Purpose: Contain the bits 47:32 of the peer MAC address
  15942. * Value: Bits 47:32 of the peer MAC address
  15943. *
  15944. * Word 5
  15945. * - index
  15946. * Bits 31:0
  15947. * Purpose: Contain the index at which this CFR dump was written in the Host
  15948. * allocated memory. This index is the number of bytes from the base address.
  15949. * Value: Index position
  15950. *
  15951. * Word 6
  15952. * - length
  15953. * Bits 31:0
  15954. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  15955. * Value: Length of the CFR capture of the peer
  15956. *
  15957. * Word 7
  15958. * - timestamp
  15959. * Bits 31:0
  15960. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  15961. * clock used for this timestamp is private to the target and not visible to
  15962. * the host i.e., Host can interpret only the relative timestamp deltas from
  15963. * one message to the next, but can't interpret the absolute timestamp from a
  15964. * single message.
  15965. * Value: Timestamp in microseconds
  15966. *
  15967. * Word 8
  15968. * - counter
  15969. * Bits 31:0
  15970. * Purpose: Carry the count of the current CFR capture from FW. This is
  15971. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  15972. * in host memory)
  15973. * Value: Count of the current CFR capture
  15974. *
  15975. * Word 9
  15976. * - chan_mhz
  15977. * Bits 31:0
  15978. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  15979. * Value: Primary 20 channel frequency
  15980. *
  15981. * Word 10
  15982. * - band_center_freq1
  15983. * Bits 31:0
  15984. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  15985. * Value: Center frequency 1 in MHz
  15986. *
  15987. * Word 11
  15988. * - band_center_freq2
  15989. * Bits 31:0
  15990. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  15991. * the VDEV
  15992. * 80plus80 mode
  15993. * Value: Center frequency 2 in MHz
  15994. *
  15995. * Word 12
  15996. * - chan_phy_mode
  15997. * Bits 31:0
  15998. * Purpose: Carry the phy mode of the channel, of the VDEV
  15999. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  16000. */
  16001. PREPACK struct htt_cfr_dump_ind_type_1 {
  16002. A_UINT32 mem_req_id:7,
  16003. status:1,
  16004. capture_bw:3,
  16005. mode:3,
  16006. sts_count:3,
  16007. channel_bw:3,
  16008. cap_type:4,
  16009. vdev_id:8;
  16010. htt_mac_addr addr;
  16011. A_UINT32 index;
  16012. A_UINT32 length;
  16013. A_UINT32 timestamp;
  16014. A_UINT32 counter;
  16015. struct htt_chan_change_msg chan;
  16016. } POSTPACK;
  16017. PREPACK struct htt_cfr_dump_compl_ind {
  16018. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  16019. union {
  16020. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  16021. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  16022. /* If there is a need to change the memory layout and its associated
  16023. * HTT indication format, a new CFR capture message type can be
  16024. * introduced and added into this union.
  16025. */
  16026. };
  16027. } POSTPACK;
  16028. /*
  16029. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  16030. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  16031. */
  16032. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  16033. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  16034. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  16035. do { \
  16036. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  16037. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  16038. } while(0)
  16039. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  16040. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  16041. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  16042. /*
  16043. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  16044. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  16045. */
  16046. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  16047. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  16048. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  16049. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  16050. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  16051. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  16052. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  16053. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  16054. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  16055. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  16056. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  16057. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  16058. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  16059. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  16060. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  16061. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  16062. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  16063. do { \
  16064. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  16065. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  16066. } while (0)
  16067. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  16068. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  16069. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  16070. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  16071. do { \
  16072. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  16073. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  16074. } while (0)
  16075. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  16076. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  16077. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  16078. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  16079. do { \
  16080. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  16081. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  16082. } while (0)
  16083. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  16084. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  16085. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  16086. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  16087. do { \
  16088. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  16089. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  16090. } while (0)
  16091. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  16092. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  16093. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  16094. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  16095. do { \
  16096. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  16097. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  16098. } while (0)
  16099. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  16100. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  16101. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  16102. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  16103. do { \
  16104. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  16105. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  16106. } while (0)
  16107. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  16108. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  16109. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  16110. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  16111. do { \
  16112. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  16113. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  16114. } while (0)
  16115. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  16116. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  16117. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  16118. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  16119. do { \
  16120. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  16121. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  16122. } while (0)
  16123. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  16124. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  16125. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  16126. /**
  16127. * @brief target -> host peer (PPDU) stats message
  16128. *
  16129. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  16130. *
  16131. * @details
  16132. * This message is generated by FW when FW is sending stats to host
  16133. * about one or more PPDUs that the FW has transmitted to one or more peers.
  16134. * This message is sent autonomously by the target rather than upon request
  16135. * by the host.
  16136. * The following field definitions describe the format of the HTT target
  16137. * to host peer stats indication message.
  16138. *
  16139. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  16140. * or more PPDU stats records.
  16141. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  16142. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  16143. * then the message would start with the
  16144. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  16145. * below.
  16146. *
  16147. * |31 16|15|14|13 11|10 9|8|7 0|
  16148. * |-------------------------------------------------------------|
  16149. * | reserved |MSG_TYPE |
  16150. * |-------------------------------------------------------------|
  16151. * rec 0 | TLV header |
  16152. * rec 0 |-------------------------------------------------------------|
  16153. * rec 0 | ppdu successful bytes |
  16154. * rec 0 |-------------------------------------------------------------|
  16155. * rec 0 | ppdu retry bytes |
  16156. * rec 0 |-------------------------------------------------------------|
  16157. * rec 0 | ppdu failed bytes |
  16158. * rec 0 |-------------------------------------------------------------|
  16159. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  16160. * rec 0 |-------------------------------------------------------------|
  16161. * rec 0 | retried MSDUs | successful MSDUs |
  16162. * rec 0 |-------------------------------------------------------------|
  16163. * rec 0 | TX duration | failed MSDUs |
  16164. * rec 0 |-------------------------------------------------------------|
  16165. * ...
  16166. * |-------------------------------------------------------------|
  16167. * rec N | TLV header |
  16168. * rec N |-------------------------------------------------------------|
  16169. * rec N | ppdu successful bytes |
  16170. * rec N |-------------------------------------------------------------|
  16171. * rec N | ppdu retry bytes |
  16172. * rec N |-------------------------------------------------------------|
  16173. * rec N | ppdu failed bytes |
  16174. * rec N |-------------------------------------------------------------|
  16175. * rec N | peer id | S|SG| BW | BA |A|rate code|
  16176. * rec N |-------------------------------------------------------------|
  16177. * rec N | retried MSDUs | successful MSDUs |
  16178. * rec N |-------------------------------------------------------------|
  16179. * rec N | TX duration | failed MSDUs |
  16180. * rec N |-------------------------------------------------------------|
  16181. *
  16182. * where:
  16183. * A = is A-MPDU flag
  16184. * BA = block-ack failure flags
  16185. * BW = bandwidth spec
  16186. * SG = SGI enabled spec
  16187. * S = skipped rate ctrl
  16188. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  16189. *
  16190. * Header
  16191. * ------
  16192. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  16193. * dword0 - b'8:31 - reserved : Reserved for future use
  16194. *
  16195. * payload include below peer_stats information
  16196. * --------------------------------------------
  16197. * @TLV : HTT_PPDU_STATS_INFO_TLV
  16198. * @tx_success_bytes : total successful bytes in the PPDU.
  16199. * @tx_retry_bytes : total retried bytes in the PPDU.
  16200. * @tx_failed_bytes : total failed bytes in the PPDU.
  16201. * @tx_ratecode : rate code used for the PPDU.
  16202. * @is_ampdu : Indicates PPDU is AMPDU or not.
  16203. * @ba_ack_failed : BA/ACK failed for this PPDU
  16204. * b00 -> BA received
  16205. * b01 -> BA failed once
  16206. * b10 -> BA failed twice, when HW retry is enabled.
  16207. * @bw : BW
  16208. * b00 -> 20 MHz
  16209. * b01 -> 40 MHz
  16210. * b10 -> 80 MHz
  16211. * b11 -> 160 MHz (or 80+80)
  16212. * @sg : SGI enabled
  16213. * @s : skipped ratectrl
  16214. * @peer_id : peer id
  16215. * @tx_success_msdus : successful MSDUs
  16216. * @tx_retry_msdus : retried MSDUs
  16217. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  16218. * @tx_duration : Tx duration for the PPDU (microsecond units)
  16219. */
  16220. /**
  16221. * @brief target -> host backpressure event
  16222. *
  16223. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  16224. *
  16225. * @details
  16226. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  16227. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  16228. * This message will only be sent if the backpressure condition has existed
  16229. * continuously for an initial period (100 ms).
  16230. * Repeat messages with updated information will be sent after each
  16231. * subsequent period (100 ms) as long as the backpressure remains unabated.
  16232. * This message indicates the ring id along with current head and tail index
  16233. * locations (i.e. write and read indices).
  16234. * The backpressure time indicates the time in ms for which continuous
  16235. * backpressure has been observed in the ring.
  16236. *
  16237. * The message format is as follows:
  16238. *
  16239. * |31 24|23 16|15 8|7 0|
  16240. * |----------------+----------------+----------------+----------------|
  16241. * | ring_id | ring_type | pdev_id | msg_type |
  16242. * |-------------------------------------------------------------------|
  16243. * | tail_idx | head_idx |
  16244. * |-------------------------------------------------------------------|
  16245. * | backpressure_time_ms |
  16246. * |-------------------------------------------------------------------|
  16247. *
  16248. * The message is interpreted as follows:
  16249. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  16250. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  16251. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  16252. * 1, 2, 3 indicates pdev_id 0,1,2 and
  16253. * the msg is for LMAC ring.
  16254. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  16255. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  16256. * htt_backpressure_lmac_ring_id. This represents
  16257. * the ring id for which continuous backpressure
  16258. * is seen
  16259. *
  16260. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  16261. * the ring indicated by the ring_id
  16262. *
  16263. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  16264. * the ring indicated by the ring id
  16265. *
  16266. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continuous
  16267. * backpressure has been seen in the ring
  16268. * indicated by the ring_id.
  16269. * Units = milliseconds
  16270. */
  16271. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  16272. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  16273. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  16274. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  16275. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  16276. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  16277. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  16278. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  16279. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  16280. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  16281. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  16282. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  16283. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  16284. do { \
  16285. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  16286. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  16287. } while (0)
  16288. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  16289. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  16290. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  16291. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  16292. do { \
  16293. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  16294. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  16295. } while (0)
  16296. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  16297. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  16298. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  16299. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  16300. do { \
  16301. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  16302. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  16303. } while (0)
  16304. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  16305. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  16306. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  16307. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  16308. do { \
  16309. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  16310. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  16311. } while (0)
  16312. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  16313. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  16314. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  16315. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  16316. do { \
  16317. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  16318. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  16319. } while (0)
  16320. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  16321. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  16322. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  16323. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  16324. do { \
  16325. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  16326. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  16327. } while (0)
  16328. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  16329. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  16330. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  16331. enum htt_backpressure_ring_type {
  16332. HTT_SW_RING_TYPE_UMAC,
  16333. HTT_SW_RING_TYPE_LMAC,
  16334. HTT_SW_RING_TYPE_MAX,
  16335. };
  16336. /* Ring id for which the message is sent to host */
  16337. enum htt_backpressure_umac_ringid {
  16338. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  16339. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  16340. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  16341. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  16342. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  16343. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  16344. HTT_SW_RING_IDX_REO_REO2FW_RING,
  16345. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  16346. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  16347. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  16348. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  16349. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  16350. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  16351. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  16352. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  16353. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  16354. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  16355. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  16356. HTT_SW_UMAC_RING_IDX_MAX,
  16357. };
  16358. enum htt_backpressure_lmac_ringid {
  16359. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  16360. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  16361. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  16362. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  16363. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  16364. HTT_SW_RING_IDX_RXDMA2FW_RING,
  16365. HTT_SW_RING_IDX_RXDMA2SW_RING,
  16366. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  16367. HTT_SW_RING_IDX_RXDMA2REO_RING,
  16368. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  16369. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  16370. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  16371. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  16372. HTT_SW_LMAC_RING_IDX_MAX,
  16373. };
  16374. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  16375. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  16376. pdev_id: 8,
  16377. ring_type: 8, /* htt_backpressure_ring_type */
  16378. /*
  16379. * ring_id holds an enum value from either
  16380. * htt_backpressure_umac_ringid or
  16381. * htt_backpressure_lmac_ringid, based on
  16382. * the ring_type setting.
  16383. */
  16384. ring_id: 8;
  16385. A_UINT16 head_idx;
  16386. A_UINT16 tail_idx;
  16387. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  16388. } POSTPACK;
  16389. /*
  16390. * Defines two 32 bit words that can be used by the target to indicate a per
  16391. * user RU allocation and rate information.
  16392. *
  16393. * This information is currently provided in the "sw_response_reference_ptr"
  16394. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  16395. * "rx_ppdu_end_user_stats" TLV.
  16396. *
  16397. * VALID:
  16398. * The consumer of these words must explicitly check the valid bit,
  16399. * and only attempt interpretation of any of the remaining fields if
  16400. * the valid bit is set to 1.
  16401. *
  16402. * VERSION:
  16403. * The consumer of these words must also explicitly check the version bit,
  16404. * and only use the V0 definition if the VERSION field is set to 0.
  16405. *
  16406. * Version 1 is currently undefined, with the exception of the VALID and
  16407. * VERSION fields.
  16408. *
  16409. * Version 0:
  16410. *
  16411. * The fields below are duplicated per BW.
  16412. *
  16413. * The consumer must determine which BW field to use, based on the UL OFDMA
  16414. * PPDU BW indicated by HW.
  16415. *
  16416. * RU_START: RU26 start index for the user.
  16417. * Note that this is always using the RU26 index, regardless
  16418. * of the actual RU assigned to the user
  16419. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  16420. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  16421. *
  16422. * For example, 20MHz (the value in the top row is RU_START)
  16423. *
  16424. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  16425. * RU Size 1 (52): | | | | | |
  16426. * RU Size 2 (106): | | | |
  16427. * RU Size 3 (242): | |
  16428. *
  16429. * RU_SIZE: Indicates the RU size, as defined by enum
  16430. * htt_ul_ofdma_user_info_ru_size.
  16431. *
  16432. * LDPC: LDPC enabled (if 0, BCC is used)
  16433. *
  16434. * DCM: DCM enabled
  16435. *
  16436. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  16437. * |---------------------------------+--------------------------------|
  16438. * |Ver|Valid| FW internal |
  16439. * |---------------------------------+--------------------------------|
  16440. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  16441. * |---------------------------------+--------------------------------|
  16442. */
  16443. enum htt_ul_ofdma_user_info_ru_size {
  16444. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  16445. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  16446. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  16447. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  16448. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  16449. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  16450. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  16451. };
  16452. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  16453. struct htt_ul_ofdma_user_info_v0 {
  16454. A_UINT32 word0;
  16455. A_UINT32 word1;
  16456. };
  16457. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  16458. A_UINT32 w0_fw_rsvd:30; \
  16459. A_UINT32 w0_valid:1; \
  16460. A_UINT32 w0_version:1;
  16461. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  16462. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  16463. };
  16464. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  16465. A_UINT32 w1_nss:3; \
  16466. A_UINT32 w1_mcs:4; \
  16467. A_UINT32 w1_ldpc:1; \
  16468. A_UINT32 w1_dcm:1; \
  16469. A_UINT32 w1_ru_start:7; \
  16470. A_UINT32 w1_ru_size:3; \
  16471. A_UINT32 w1_trig_type:4; \
  16472. A_UINT32 w1_unused:9;
  16473. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  16474. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  16475. };
  16476. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  16477. A_UINT32 w0_fw_rsvd:27; \
  16478. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  16479. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  16480. 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) */
  16481. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  16482. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  16483. };
  16484. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  16485. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  16486. A_UINT32 w1_trig_type:4; \
  16487. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  16488. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  16489. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  16490. };
  16491. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  16492. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  16493. union {
  16494. A_UINT32 word0;
  16495. struct {
  16496. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  16497. };
  16498. };
  16499. union {
  16500. A_UINT32 word1;
  16501. struct {
  16502. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  16503. };
  16504. };
  16505. } POSTPACK;
  16506. /*
  16507. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  16508. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  16509. * this should be picked.
  16510. */
  16511. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  16512. union {
  16513. A_UINT32 word0;
  16514. struct {
  16515. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  16516. };
  16517. };
  16518. union {
  16519. A_UINT32 word1;
  16520. struct {
  16521. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  16522. };
  16523. };
  16524. } POSTPACK;
  16525. enum HTT_UL_OFDMA_TRIG_TYPE {
  16526. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  16527. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  16528. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  16529. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  16530. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  16531. };
  16532. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  16533. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  16534. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  16535. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  16536. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  16537. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  16538. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  16539. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  16540. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  16541. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  16542. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  16543. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  16544. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  16545. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  16546. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  16547. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  16548. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  16549. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  16550. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  16551. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  16552. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  16553. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  16554. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  16555. /*--- word 0 ---*/
  16556. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  16557. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  16558. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  16559. do { \
  16560. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  16561. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  16562. } while (0)
  16563. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  16564. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  16565. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  16566. do { \
  16567. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  16568. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  16569. } while (0)
  16570. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  16571. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  16572. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  16573. do { \
  16574. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  16575. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  16576. } while (0)
  16577. /*--- word 1 ---*/
  16578. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  16579. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  16580. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  16581. do { \
  16582. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  16583. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  16584. } while (0)
  16585. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  16586. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  16587. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  16588. do { \
  16589. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  16590. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  16591. } while (0)
  16592. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  16593. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  16594. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  16595. do { \
  16596. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  16597. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  16598. } while (0)
  16599. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  16600. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  16601. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  16602. do { \
  16603. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  16604. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  16605. } while (0)
  16606. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  16607. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  16608. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  16609. do { \
  16610. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  16611. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  16612. } while (0)
  16613. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  16614. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  16615. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  16616. do { \
  16617. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  16618. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  16619. } while (0)
  16620. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  16621. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  16622. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  16623. do { \
  16624. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  16625. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  16626. } while (0)
  16627. /**
  16628. * @brief target -> host channel calibration data message
  16629. *
  16630. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  16631. *
  16632. * @brief host -> target channel calibration data message
  16633. *
  16634. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  16635. *
  16636. * @details
  16637. * The following field definitions describe the format of the channel
  16638. * calibration data message sent from the target to the host when
  16639. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  16640. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  16641. * The message is defined as htt_chan_caldata_msg followed by a variable
  16642. * number of 32-bit character values.
  16643. *
  16644. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  16645. * |------------------------------------------------------------------|
  16646. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  16647. * |------------------------------------------------------------------|
  16648. * | payload size | mhz |
  16649. * |------------------------------------------------------------------|
  16650. * | center frequency 2 | center frequency 1 |
  16651. * |------------------------------------------------------------------|
  16652. * | check sum |
  16653. * |------------------------------------------------------------------|
  16654. * | payload |
  16655. * |------------------------------------------------------------------|
  16656. * message info field:
  16657. * - MSG_TYPE
  16658. * Bits 7:0
  16659. * Purpose: identifies this as a channel calibration data message
  16660. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  16661. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  16662. * - SUB_TYPE
  16663. * Bits 11:8
  16664. * Purpose: T2H: indicates whether target is providing chan cal data
  16665. * to the host to store, or requesting that the host
  16666. * download previously-stored data.
  16667. * H2T: indicates whether the host is providing the requested
  16668. * channel cal data, or if it is rejecting the data
  16669. * request because it does not have the requested data.
  16670. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  16671. * - CHKSUM_VALID
  16672. * Bit 12
  16673. * Purpose: indicates if the checksum field is valid
  16674. * value:
  16675. * - FRAG
  16676. * Bit 19:16
  16677. * Purpose: indicates the fragment index for message
  16678. * value: 0 for first fragment, 1 for second fragment, ...
  16679. * - APPEND
  16680. * Bit 20
  16681. * Purpose: indicates if this is the last fragment
  16682. * value: 0 = final fragment, 1 = more fragments will be appended
  16683. *
  16684. * channel and payload size field
  16685. * - MHZ
  16686. * Bits 15:0
  16687. * Purpose: indicates the channel primary frequency
  16688. * Value:
  16689. * - PAYLOAD_SIZE
  16690. * Bits 31:16
  16691. * Purpose: indicates the bytes of calibration data in payload
  16692. * Value:
  16693. *
  16694. * center frequency field
  16695. * - CENTER FREQUENCY 1
  16696. * Bits 15:0
  16697. * Purpose: indicates the channel center frequency
  16698. * Value: channel center frequency, in MHz units
  16699. * - CENTER FREQUENCY 2
  16700. * Bits 31:16
  16701. * Purpose: indicates the secondary channel center frequency,
  16702. * only for 11acvht 80plus80 mode
  16703. * Value: secondary channel center frequency, in MHz units, if applicable
  16704. *
  16705. * checksum field
  16706. * - CHECK_SUM
  16707. * Bits 31:0
  16708. * Purpose: check the payload data, it is just for this fragment.
  16709. * This is intended for the target to check that the channel
  16710. * calibration data returned by the host is the unmodified data
  16711. * that was previously provided to the host by the target.
  16712. * value: checksum of fragment payload
  16713. */
  16714. PREPACK struct htt_chan_caldata_msg {
  16715. /* DWORD 0: message info */
  16716. A_UINT32
  16717. msg_type: 8,
  16718. sub_type: 4 ,
  16719. chksum_valid: 1, /** 1:valid, 0:invalid */
  16720. reserved1: 3,
  16721. frag_idx: 4, /** fragment index for calibration data */
  16722. appending: 1, /** 0: no fragment appending,
  16723. * 1: extra fragment appending */
  16724. reserved2: 11;
  16725. /* DWORD 1: channel and payload size */
  16726. A_UINT32
  16727. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  16728. payload_size: 16; /** unit: bytes */
  16729. /* DWORD 2: center frequency */
  16730. A_UINT32
  16731. band_center_freq1: 16, /** Center frequency 1 in MHz */
  16732. band_center_freq2: 16; /** Center frequency 2 in MHz,
  16733. * valid only for 11acvht 80plus80 mode */
  16734. /* DWORD 3: check sum */
  16735. A_UINT32 chksum;
  16736. /* variable length for calibration data */
  16737. A_UINT32 payload[1/* or more */];
  16738. } POSTPACK;
  16739. /* T2H SUBTYPE */
  16740. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  16741. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  16742. /* H2T SUBTYPE */
  16743. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  16744. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  16745. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  16746. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  16747. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  16748. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  16749. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  16750. do { \
  16751. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  16752. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  16753. } while (0)
  16754. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  16755. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  16756. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  16757. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  16758. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  16759. do { \
  16760. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  16761. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  16762. } while (0)
  16763. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  16764. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  16765. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  16766. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  16767. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  16768. do { \
  16769. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  16770. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  16771. } while (0)
  16772. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  16773. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  16774. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  16775. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  16776. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  16777. do { \
  16778. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  16779. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  16780. } while (0)
  16781. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  16782. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  16783. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  16784. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  16785. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  16786. do { \
  16787. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  16788. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  16789. } while (0)
  16790. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  16791. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  16792. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  16793. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  16794. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  16795. do { \
  16796. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  16797. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  16798. } while (0)
  16799. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  16800. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  16801. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  16802. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  16803. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  16804. do { \
  16805. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  16806. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  16807. } while (0)
  16808. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  16809. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  16810. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  16811. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  16812. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  16813. do { \
  16814. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  16815. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  16816. } while (0)
  16817. /**
  16818. * @brief target -> host FSE CMEM based send
  16819. *
  16820. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  16821. *
  16822. * @details
  16823. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  16824. * FSE placement in CMEM is enabled.
  16825. *
  16826. * This message sends the non-secure CMEM base address.
  16827. * It will be sent to host in response to message
  16828. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  16829. * The message would appear as follows:
  16830. *
  16831. * |31 24|23 16|15 8|7 0|
  16832. * |----------------+----------------+----------------+----------------|
  16833. * | reserved | num_entries | msg_type |
  16834. * |----------------+----------------+----------------+----------------|
  16835. * | base_address_lo |
  16836. * |----------------+----------------+----------------+----------------|
  16837. * | base_address_hi |
  16838. * |-------------------------------------------------------------------|
  16839. *
  16840. * The message is interpreted as follows:
  16841. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  16842. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  16843. * b'8:15 - number_entries: Indicated the number of entries
  16844. * programmed.
  16845. * b'16:31 - reserved.
  16846. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  16847. * CMEM base address
  16848. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  16849. * CMEM base address
  16850. */
  16851. PREPACK struct htt_cmem_base_send_t {
  16852. A_UINT32 msg_type: 8,
  16853. num_entries: 8,
  16854. reserved: 16;
  16855. A_UINT32 base_address_lo;
  16856. A_UINT32 base_address_hi;
  16857. } POSTPACK;
  16858. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  16859. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  16860. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  16861. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  16862. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  16863. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  16864. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  16865. do { \
  16866. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  16867. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  16868. } while (0)
  16869. /**
  16870. * @brief - HTT PPDU ID format
  16871. *
  16872. * @details
  16873. * The following field definitions describe the format of the PPDU ID.
  16874. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  16875. *
  16876. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  16877. * +--------------------------------------------------------------------------
  16878. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  16879. * +--------------------------------------------------------------------------
  16880. *
  16881. * sch id :Schedule command id
  16882. * Bits [11 : 0] : monotonically increasing counter to track the
  16883. * PPDU posted to a specific transmit queue.
  16884. *
  16885. * hwq_id: Hardware Queue ID.
  16886. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  16887. *
  16888. * mac_id: MAC ID
  16889. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  16890. *
  16891. * seq_idx: Sequence index.
  16892. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  16893. * a particular TXOP.
  16894. *
  16895. * tqm_cmd: HWSCH/TQM flag.
  16896. * Bit [23] : Always set to 0.
  16897. *
  16898. * seq_cmd_type: Sequence command type.
  16899. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  16900. * Refer to enum HTT_STATS_FTYPE for values.
  16901. */
  16902. PREPACK struct htt_ppdu_id {
  16903. A_UINT32
  16904. sch_id: 12,
  16905. hwq_id: 5,
  16906. mac_id: 2,
  16907. seq_idx: 2,
  16908. reserved1: 2,
  16909. tqm_cmd: 1,
  16910. seq_cmd_type: 6,
  16911. reserved2: 2;
  16912. } POSTPACK;
  16913. #define HTT_PPDU_ID_SCH_ID_S 0
  16914. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  16915. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  16916. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  16917. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  16918. do { \
  16919. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  16920. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  16921. } while (0)
  16922. #define HTT_PPDU_ID_HWQ_ID_S 12
  16923. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  16924. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  16925. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  16926. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  16927. do { \
  16928. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  16929. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  16930. } while (0)
  16931. #define HTT_PPDU_ID_MAC_ID_S 17
  16932. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  16933. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  16934. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  16935. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  16936. do { \
  16937. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  16938. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  16939. } while (0)
  16940. #define HTT_PPDU_ID_SEQ_IDX_S 19
  16941. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  16942. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  16943. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  16944. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  16945. do { \
  16946. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  16947. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  16948. } while (0)
  16949. #define HTT_PPDU_ID_TQM_CMD_S 23
  16950. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  16951. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  16952. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  16953. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  16954. do { \
  16955. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  16956. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  16957. } while (0)
  16958. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  16959. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  16960. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  16961. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  16962. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  16963. do { \
  16964. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  16965. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  16966. } while (0)
  16967. /**
  16968. * @brief target -> RX PEER METADATA V0 format
  16969. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16970. * message from target, and will confirm to the target which peer metadata
  16971. * version to use in the wmi_init message.
  16972. *
  16973. * The following diagram shows the format of the RX PEER METADATA.
  16974. *
  16975. * |31 24|23 16|15 8|7 0|
  16976. * |-----------------------------------------------------------------------|
  16977. * | Reserved | VDEV ID | PEER ID |
  16978. * |-----------------------------------------------------------------------|
  16979. */
  16980. PREPACK struct htt_rx_peer_metadata_v0 {
  16981. A_UINT32
  16982. peer_id: 16,
  16983. vdev_id: 8,
  16984. reserved1: 8;
  16985. } POSTPACK;
  16986. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  16987. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  16988. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  16989. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  16990. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  16991. do { \
  16992. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  16993. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  16994. } while (0)
  16995. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  16996. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  16997. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  16998. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  16999. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  17000. do { \
  17001. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  17002. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  17003. } while (0)
  17004. /**
  17005. * @brief target -> RX PEER METADATA V1 format
  17006. * Host will know the peer metadata version from the wmi_service_ready_ext2
  17007. * message from target, and will confirm to the target which peer metadata
  17008. * version to use in the wmi_init message.
  17009. *
  17010. * The following diagram shows the format of the RX PEER METADATA V1 format.
  17011. *
  17012. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  17013. * |---------------------------------------------------------------------------|
  17014. * |Rsvd2|CHIP ID|LMAC ID|VDEV ID|logical_link_id|ML PEER|SW PEER ID/ML PEER ID|
  17015. * |---------------------------------------------------------------------------|
  17016. */
  17017. PREPACK struct htt_rx_peer_metadata_v1 {
  17018. A_UINT32
  17019. peer_id: 13,
  17020. ml_peer_valid: 1,
  17021. logical_link_id: 2,
  17022. vdev_id: 8,
  17023. lmac_id: 2,
  17024. chip_id: 3,
  17025. reserved2: 3;
  17026. } POSTPACK;
  17027. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  17028. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  17029. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  17030. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  17031. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  17032. do { \
  17033. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  17034. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  17035. } while (0)
  17036. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  17037. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  17038. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  17039. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  17040. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  17041. do { \
  17042. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  17043. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  17044. } while (0)
  17045. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  17046. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  17047. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  17048. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  17049. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S 14
  17050. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M 0x0000c000
  17051. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_GET(_var) \
  17052. (((_var) & HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M) >> HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)
  17053. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_SET(_var, _val) \
  17054. do { \
  17055. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID, _val); \
  17056. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)); \
  17057. } while (0)
  17058. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  17059. do { \
  17060. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  17061. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  17062. } while (0)
  17063. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  17064. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  17065. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  17066. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  17067. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  17068. do { \
  17069. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  17070. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  17071. } while (0)
  17072. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  17073. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  17074. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  17075. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  17076. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  17077. do { \
  17078. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  17079. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  17080. } while (0)
  17081. /*
  17082. * In some systems, the host SW wants to specify priorities between
  17083. * different MSDU / flow queues within the same peer-TID.
  17084. * The below enums are used for the host to identify to the target
  17085. * which MSDU queue's priority it wants to adjust.
  17086. */
  17087. /*
  17088. * The MSDUQ index describe index of TCL HW, where each index is
  17089. * used for queuing particular types of MSDUs.
  17090. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  17091. */
  17092. enum HTT_MSDUQ_INDEX {
  17093. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  17094. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  17095. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  17096. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  17097. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  17098. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  17099. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  17100. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  17101. HTT_MSDUQ_MAX_INDEX,
  17102. };
  17103. /* MSDU qtype definition */
  17104. enum HTT_MSDU_QTYPE {
  17105. /*
  17106. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  17107. * relative priority. Instead, the relative priority of CRIT_0 versus
  17108. * CRIT_1 is controlled by the FW, through the configuration parameters
  17109. * it applies to the queues.
  17110. */
  17111. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  17112. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  17113. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  17114. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  17115. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  17116. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  17117. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  17118. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  17119. /* New MSDU_QTYPE should be added above this line */
  17120. /*
  17121. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  17122. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  17123. * any host/target message definitions. The QTYPE_MAX value can
  17124. * only be used internally within the host or within the target.
  17125. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  17126. * it must regard the unexpected value as a default qtype value,
  17127. * or ignore it.
  17128. */
  17129. HTT_MSDU_QTYPE_MAX,
  17130. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  17131. };
  17132. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  17133. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  17134. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  17135. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  17136. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  17137. };
  17138. /**
  17139. * @brief target -> host mlo timestamp offset indication
  17140. *
  17141. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  17142. *
  17143. * @details
  17144. * The following field definitions describe the format of the HTT target
  17145. * to host mlo timestamp offset indication message.
  17146. *
  17147. *
  17148. * |31 16|15 12|11 10|9 8|7 0 |
  17149. * |----------------------------------------------------------------------|
  17150. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  17151. * |----------------------------------------------------------------------|
  17152. * | Sync time stamp lo in us |
  17153. * |----------------------------------------------------------------------|
  17154. * | Sync time stamp hi in us |
  17155. * |----------------------------------------------------------------------|
  17156. * | mlo time stamp offset lo in us |
  17157. * |----------------------------------------------------------------------|
  17158. * | mlo time stamp offset hi in us |
  17159. * |----------------------------------------------------------------------|
  17160. * | mlo time stamp offset clocks in clock ticks |
  17161. * |----------------------------------------------------------------------|
  17162. * |31 26|25 16|15 0 |
  17163. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  17164. * | | compensation in clks | |
  17165. * |----------------------------------------------------------------------|
  17166. * |31 22|21 0 |
  17167. * | rsvd 3 | mlo time stamp comp timer period |
  17168. * |----------------------------------------------------------------------|
  17169. * The message is interpreted as follows:
  17170. *
  17171. * dword0 - b'0:7 - msg_type: This will be set to
  17172. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  17173. * value: 0x28
  17174. *
  17175. * dword0 - b'9:8 - pdev_id
  17176. *
  17177. * dword0 - b'11:10 - chip_id
  17178. *
  17179. * dword0 - b'15:12 - rsvd1: Reserved for future use
  17180. *
  17181. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  17182. *
  17183. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  17184. * which last sync interrupt was received
  17185. *
  17186. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  17187. * which last sync interrupt was received
  17188. *
  17189. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  17190. *
  17191. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  17192. *
  17193. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  17194. *
  17195. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  17196. *
  17197. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  17198. * for sub us resolution
  17199. *
  17200. * dword6 - b'31:26 - rsvd2: Reserved for future use
  17201. *
  17202. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  17203. * is applied, in us
  17204. *
  17205. * dword7 - b'31:22 - rsvd3: Reserved for future use
  17206. */
  17207. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  17208. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  17209. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  17210. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  17211. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  17212. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  17213. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  17214. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  17215. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  17216. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  17217. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  17218. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  17219. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  17220. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  17221. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  17222. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  17223. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  17224. do { \
  17225. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  17226. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  17227. } while (0)
  17228. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  17229. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  17230. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  17231. do { \
  17232. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  17233. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  17234. } while (0)
  17235. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  17236. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  17237. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  17238. do { \
  17239. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  17240. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  17241. } while (0)
  17242. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  17243. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  17244. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  17245. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  17246. do { \
  17247. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  17248. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  17249. } while (0)
  17250. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  17251. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  17252. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  17253. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  17254. do { \
  17255. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  17256. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  17257. } while (0)
  17258. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  17259. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  17260. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  17261. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  17262. do { \
  17263. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  17264. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  17265. } while (0)
  17266. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  17267. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  17268. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  17269. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  17270. do { \
  17271. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  17272. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  17273. } while (0)
  17274. typedef struct {
  17275. A_UINT32 msg_type: 8, /* bits 7:0 */
  17276. pdev_id: 2, /* bits 9:8 */
  17277. chip_id: 2, /* bits 11:10 */
  17278. reserved1: 4, /* bits 15:12 */
  17279. mac_clk_freq_mhz: 16; /* bits 31:16 */
  17280. A_UINT32 sync_timestamp_lo_us;
  17281. A_UINT32 sync_timestamp_hi_us;
  17282. A_UINT32 mlo_timestamp_offset_lo_us;
  17283. A_UINT32 mlo_timestamp_offset_hi_us;
  17284. A_UINT32 mlo_timestamp_offset_clks;
  17285. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  17286. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  17287. reserved2: 6; /* bits 31:26 */
  17288. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  17289. reserved3: 10; /* bits 31:22 */
  17290. } htt_t2h_mlo_offset_ind_t;
  17291. /*
  17292. * @brief target -> host VDEV TX RX STATS
  17293. *
  17294. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  17295. *
  17296. * @details
  17297. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  17298. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  17299. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  17300. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  17301. * periodically by target even in the absence of any further HTT request
  17302. * messages from host.
  17303. *
  17304. * The message is formatted as follows:
  17305. *
  17306. * |31 16|15 8|7 0|
  17307. * |---------------------------------+----------------+----------------|
  17308. * | payload_size | pdev_id | msg_type |
  17309. * |---------------------------------+----------------+----------------|
  17310. * | reserved0 |
  17311. * |-------------------------------------------------------------------|
  17312. * | reserved1 |
  17313. * |-------------------------------------------------------------------|
  17314. * | reserved2 |
  17315. * |-------------------------------------------------------------------|
  17316. * | |
  17317. * | VDEV specific Tx Rx stats info |
  17318. * | |
  17319. * |-------------------------------------------------------------------|
  17320. *
  17321. * The message is interpreted as follows:
  17322. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  17323. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  17324. * b'8:15 - pdev_id
  17325. * b'16:31 - size in bytes of the payload that follows the 16-byte
  17326. * message header fields (msg_type through reserved2)
  17327. * dword1 - b'0:31 - reserved0.
  17328. * dword2 - b'0:31 - reserved1.
  17329. * dword3 - b'0:31 - reserved2.
  17330. */
  17331. typedef struct {
  17332. A_UINT32 msg_type: 8,
  17333. pdev_id: 8,
  17334. payload_size: 16;
  17335. A_UINT32 reserved0;
  17336. A_UINT32 reserved1;
  17337. A_UINT32 reserved2;
  17338. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  17339. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  17340. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  17341. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  17342. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  17343. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  17344. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  17345. do { \
  17346. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  17347. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  17348. } while (0)
  17349. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  17350. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  17351. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  17352. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  17353. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  17354. do { \
  17355. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  17356. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  17357. } while (0)
  17358. /* SOC related stats */
  17359. typedef struct {
  17360. htt_tlv_hdr_t tlv_hdr;
  17361. /* When TQM is not able to find the peers during Tx, then it drops the packets
  17362. * This can be due to either the peer is deleted or deletion is ongoing
  17363. * */
  17364. A_UINT32 inv_peers_msdu_drop_count_lo;
  17365. A_UINT32 inv_peers_msdu_drop_count_hi;
  17366. } htt_t2h_soc_txrx_stats_common_tlv;
  17367. /* VDEV HW Tx/Rx stats */
  17368. typedef struct {
  17369. htt_tlv_hdr_t tlv_hdr;
  17370. A_UINT32 vdev_id;
  17371. /* Rx msdu byte cnt */
  17372. A_UINT32 rx_msdu_byte_cnt_lo;
  17373. A_UINT32 rx_msdu_byte_cnt_hi;
  17374. /* Rx msdu cnt */
  17375. A_UINT32 rx_msdu_cnt_lo;
  17376. A_UINT32 rx_msdu_cnt_hi;
  17377. /* tx msdu byte cnt */
  17378. A_UINT32 tx_msdu_byte_cnt_lo;
  17379. A_UINT32 tx_msdu_byte_cnt_hi;
  17380. /* tx msdu cnt */
  17381. A_UINT32 tx_msdu_cnt_lo;
  17382. A_UINT32 tx_msdu_cnt_hi;
  17383. /* tx excessive retry discarded msdu cnt */
  17384. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  17385. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  17386. /* TX congestion ctrl msdu drop cnt */
  17387. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  17388. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  17389. /* discarded tx msdus cnt coz of time to live expiry */
  17390. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  17391. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  17392. /* tx excessive retry discarded msdu byte cnt */
  17393. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  17394. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  17395. /* TX congestion ctrl msdu drop byte cnt */
  17396. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  17397. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  17398. /* discarded tx msdus byte cnt coz of time to live expiry */
  17399. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  17400. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  17401. /* TQM bypass frame cnt */
  17402. A_UINT32 tqm_bypass_frame_cnt_lo;
  17403. A_UINT32 tqm_bypass_frame_cnt_hi;
  17404. /* TQM bypass byte cnt */
  17405. A_UINT32 tqm_bypass_byte_cnt_lo;
  17406. A_UINT32 tqm_bypass_byte_cnt_hi;
  17407. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  17408. /*
  17409. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  17410. *
  17411. * @details
  17412. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  17413. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  17414. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  17415. * the default MSDU queues of each of the specified TIDs for the peer
  17416. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  17417. * If the default MSDU queues of a given TID within the peer are not linked
  17418. * to a service class, the svc_class_id field for that TID will have a
  17419. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  17420. * queues for that TID are not mapped to any service class.
  17421. *
  17422. * |31 16|15 8|7 0|
  17423. * |------------------------------+--------------+--------------|
  17424. * | peer ID | reserved | msg type |
  17425. * |------------------------------+--------------+------+-------|
  17426. * | reserved | svc class ID | TID |
  17427. * |------------------------------------------------------------|
  17428. * ...
  17429. * |------------------------------------------------------------|
  17430. * | reserved | svc class ID | TID |
  17431. * |------------------------------------------------------------|
  17432. * Header fields:
  17433. * dword0 - b'7:0 - msg_type: This will be set to
  17434. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  17435. * b'31:16 - peer ID
  17436. * dword1 - b'7:0 - TID
  17437. * b'15:8 - svc class ID
  17438. * (dword2, etc. same format as dword1)
  17439. */
  17440. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  17441. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  17442. A_UINT32 msg_type :8,
  17443. reserved0 :8,
  17444. peer_id :16;
  17445. struct {
  17446. A_UINT32 tid :8,
  17447. svc_class_id :8,
  17448. reserved1 :16;
  17449. } tid_reports[1/*or more*/];
  17450. } POSTPACK;
  17451. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  17452. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  17453. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  17454. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  17455. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  17456. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  17457. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  17458. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  17459. do { \
  17460. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  17461. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  17462. } while (0)
  17463. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  17464. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  17465. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  17466. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  17467. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  17468. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  17469. do { \
  17470. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  17471. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  17472. } while (0)
  17473. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  17474. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  17475. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  17476. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  17477. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  17478. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  17479. do { \
  17480. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  17481. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  17482. } while (0)
  17483. /*
  17484. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  17485. *
  17486. * @details
  17487. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  17488. * flow if the flow is seen the associated service class is conveyed to the
  17489. * target via TCL Data Command. Target on the other hand internally creates the
  17490. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  17491. * of the newly created MSDUQ and some other identifiers to uniquely identity
  17492. * the newly created MSDUQ
  17493. *
  17494. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  17495. * |------------------------------+------------------------+--------------|
  17496. * | peer ID | HTT qtype | msg type |
  17497. * |---------------------------------+--------------+--+---+-------+------|
  17498. * | reserved |AST list index|FO|WC | HLOS | remap|
  17499. * | | | | | TID | TID |
  17500. * |---------------------+------------------------------------------------|
  17501. * | reserved1 | tgt_opaque_id |
  17502. * |---------------------+------------------------------------------------|
  17503. *
  17504. * Header fields:
  17505. *
  17506. * dword0 - b'7:0 - msg_type: This will be set to
  17507. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  17508. * b'15:8 - HTT qtype
  17509. * b'31:16 - peer ID
  17510. *
  17511. * dword1 - b'3:0 - remap TID, as assigned in firmware
  17512. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  17513. * hlos_tid : Common to Lithium and Beryllium
  17514. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  17515. * TCL Data Command : Beryllium
  17516. * b10 - flow_override (FO), as sent by host in
  17517. * TCL Data Command: Beryllium
  17518. * b11:14 - ast_list_idx
  17519. * Array index into the list of extension AST entries
  17520. * (not the actual AST 16-bit index).
  17521. * The ast_list_idx is one-based, with the following
  17522. * range of values:
  17523. * - legacy targets supporting 16 user-defined
  17524. * MSDU queues: 1-2
  17525. * - legacy targets supporting 48 user-defined
  17526. * MSDU queues: 1-6
  17527. * - new targets: 0 (peer_id is used instead)
  17528. * Note that since ast_list_idx is one-based,
  17529. * the host will need to subtract 1 to use it as an
  17530. * index into a list of extension AST entries.
  17531. * b15:31 - reserved
  17532. *
  17533. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  17534. * unique MSDUQ id in firmware
  17535. * b'24:31 - reserved1
  17536. */
  17537. PREPACK struct htt_t2h_sawf_msduq_event {
  17538. A_UINT32 msg_type : 8,
  17539. htt_qtype : 8,
  17540. peer_id :16;
  17541. A_UINT32 remap_tid : 4,
  17542. hlos_tid : 4,
  17543. who_classify_info_sel : 2,
  17544. flow_override : 1,
  17545. ast_list_idx : 4,
  17546. reserved :17;
  17547. A_UINT32 tgt_opaque_id :24,
  17548. reserved1 : 8;
  17549. } POSTPACK;
  17550. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  17551. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  17552. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  17553. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  17554. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  17555. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  17556. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  17557. do { \
  17558. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  17559. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  17560. } while (0)
  17561. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  17562. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  17563. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  17564. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  17565. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  17566. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  17567. do { \
  17568. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  17569. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  17570. } while (0)
  17571. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  17572. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  17573. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  17574. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  17575. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  17576. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  17577. do { \
  17578. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  17579. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  17580. } while (0)
  17581. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  17582. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  17583. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  17584. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  17585. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  17586. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  17587. do { \
  17588. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  17589. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  17590. } while (0)
  17591. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  17592. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  17593. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  17594. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  17595. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  17596. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  17597. do { \
  17598. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  17599. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  17600. } while (0)
  17601. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  17602. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  17603. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  17604. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  17605. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  17606. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  17607. do { \
  17608. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  17609. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  17610. } while (0)
  17611. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  17612. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  17613. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  17614. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  17615. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  17616. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  17617. do { \
  17618. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  17619. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  17620. } while (0)
  17621. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  17622. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  17623. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  17624. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  17625. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  17626. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  17627. do { \
  17628. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  17629. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  17630. } while (0)
  17631. /**
  17632. * @brief target -> PPDU id format indication
  17633. *
  17634. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  17635. *
  17636. * @details
  17637. * The following field definitions describe the format of the HTT target
  17638. * to host PPDU ID format indication message.
  17639. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  17640. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  17641. * seq_idx :- Sequence control index of this PPDU.
  17642. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  17643. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  17644. * tqm_cmd:-
  17645. *
  17646. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  17647. * |--------------------------------------------------+------------------------|
  17648. * | rsvd0 | msg type |
  17649. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17650. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  17651. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17652. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  17653. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17654. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  17655. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17656. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  17657. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17658. * Where: OF = bit offset, NB = number of bits, V = valid
  17659. * The message is interpreted as follows:
  17660. *
  17661. * dword0 - b'7:0 - msg_type: This will be set to
  17662. * HTT_T2H_PPDU_ID_FMT_IND
  17663. * value: 0x30
  17664. *
  17665. * dword0 - b'31:8 - reserved
  17666. *
  17667. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  17668. *
  17669. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  17670. *
  17671. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  17672. *
  17673. * dword1 - b'15:11 - reserved for future use
  17674. *
  17675. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  17676. *
  17677. * dword1 - b'21:17 - number of bits in ring_id
  17678. *
  17679. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  17680. *
  17681. * dword1 - b'31:27 - reserved for future use
  17682. *
  17683. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  17684. *
  17685. * dword2 - b'5:1 - number of bits in sequence index
  17686. *
  17687. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  17688. *
  17689. * dword2 - b'15:11 - reserved for future use
  17690. *
  17691. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  17692. *
  17693. * dword2 - b'21:17 - number of bits in link_id
  17694. *
  17695. * dword2 - b'26:22 - offset of link_id (in number of bits)
  17696. *
  17697. * dword2 - b'31:27 - reserved for future use
  17698. *
  17699. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  17700. *
  17701. * dword3 - b'5:1 - number of bits in seq_cmd_type
  17702. *
  17703. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  17704. *
  17705. * dword3 - b'15:11 - reserved for future use
  17706. *
  17707. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  17708. *
  17709. * dword3 - b'21:17 - number of bits in tqm_cmd
  17710. *
  17711. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  17712. *
  17713. * dword3 - b'31:27 - reserved for future use
  17714. *
  17715. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  17716. *
  17717. * dword4 - b'5:1 - number of bits in mac_id
  17718. *
  17719. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  17720. *
  17721. * dword4 - b'15:11 - reserved for future use
  17722. *
  17723. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  17724. *
  17725. * dword4 - b'21:17 - number of bits in crc
  17726. *
  17727. * dword4 - b'26:22 - offset of crc (in number of bits)
  17728. *
  17729. * dword4 - b'31:27 - reserved for future use
  17730. *
  17731. */
  17732. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  17733. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  17734. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  17735. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  17736. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  17737. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  17738. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  17739. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  17740. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  17741. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  17742. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  17743. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  17744. /* macros for accessing lower 16 bits in dword */
  17745. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  17746. do { \
  17747. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  17748. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  17749. } while (0)
  17750. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  17751. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  17752. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  17753. do { \
  17754. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  17755. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  17756. } while (0)
  17757. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  17758. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  17759. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  17760. do { \
  17761. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  17762. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  17763. } while (0)
  17764. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  17765. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  17766. /* macros for accessing upper 16 bits in dword */
  17767. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  17768. do { \
  17769. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  17770. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  17771. } while (0)
  17772. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  17773. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  17774. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  17775. do { \
  17776. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  17777. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  17778. } while (0)
  17779. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  17780. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  17781. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  17782. do { \
  17783. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  17784. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  17785. } while (0)
  17786. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  17787. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  17788. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  17789. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17790. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  17791. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17792. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  17793. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17794. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  17795. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17796. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  17797. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17798. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  17799. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17800. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  17801. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17802. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  17803. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17804. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  17805. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17806. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  17807. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17808. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  17809. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17810. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  17811. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17812. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  17813. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17814. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  17815. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17816. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  17817. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17818. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  17819. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17820. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  17821. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17822. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  17823. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17824. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  17825. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17826. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  17827. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17828. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  17829. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17830. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  17831. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17832. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  17833. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17834. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  17835. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17836. /* offsets in number dwords */
  17837. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  17838. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  17839. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  17840. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  17841. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  17842. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  17843. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  17844. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  17845. typedef struct {
  17846. A_UINT32 msg_type: 8, /* bits 7:0 */
  17847. rsvd0: 24;/* bits 31:8 */
  17848. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  17849. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  17850. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  17851. rsvd1: 5, /* bits 15:11 */
  17852. ring_id_valid: 1, /* bits 16:16 */
  17853. ring_id_bits: 5, /* bits 21:17 */
  17854. ring_id_offset: 5, /* bits 26:22 */
  17855. rsvd2: 5; /* bits 31:27 */
  17856. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  17857. seq_idx_bits: 5, /* bits 5:1 */
  17858. seq_idx_offset: 5, /* bits 10:6 */
  17859. rsvd3: 5, /* bits 15:11 */
  17860. link_id_valid: 1, /* bits 16:16 */
  17861. link_id_bits: 5, /* bits 21:17 */
  17862. link_id_offset: 5, /* bits 26:22 */
  17863. rsvd4: 5; /* bits 31:27 */
  17864. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  17865. seq_cmd_type_bits: 5, /* bits 5:1 */
  17866. seq_cmd_type_offset: 5, /* bits 10:6 */
  17867. rsvd5: 5, /* bits 15:11 */
  17868. tqm_cmd_valid: 1, /* bits 16:16 */
  17869. tqm_cmd_bits: 5, /* bits 21:17 */
  17870. tqm_cmd_offset: 5, /* bits 26:12 */
  17871. rsvd6: 5; /* bits 31:27 */
  17872. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  17873. mac_id_bits: 5, /* bits 5:1 */
  17874. mac_id_offset: 5, /* bits 10:6 */
  17875. rsvd8: 5, /* bits 15:11 */
  17876. crc_valid: 1, /* bits 16:16 */
  17877. crc_bits: 5, /* bits 21:17 */
  17878. crc_offset: 5, /* bits 26:12 */
  17879. rsvd9: 5; /* bits 31:27 */
  17880. } htt_t2h_ppdu_id_fmt_ind_t;
  17881. /**
  17882. * @brief target -> host RX_CCE_SUPER_RULE setup done message
  17883. *
  17884. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE
  17885. *
  17886. * @details
  17887. * HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE message is sent by the target
  17888. * when RX_CCE_SUPER_RULE setup is done
  17889. *
  17890. * This message shows the configuration results after the setup operation.
  17891. * It will always be sent to host.
  17892. * The message would appear as follows:
  17893. *
  17894. * |31 24|23 16|15 8|7 0|
  17895. * |-----------------+-----------------+----------------+----------------|
  17896. * | result | response_type | vdev_id | msg_type |
  17897. * |---------------------------------------------------------------------|
  17898. *
  17899. * The message is interpreted as follows:
  17900. * dword0 - b'0:7 - msg_type: This will be set to 0x33
  17901. * (HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE)
  17902. * b'8:15 - vdev_id: Identify which vdev RX_CCE_SUPER_RULE is setup on
  17903. * b'16:23 - response_type: Indicate the response type of this setup
  17904. * done msg
  17905. * 0: HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE,
  17906. * response to HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST
  17907. * 1: HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE,
  17908. * response to HTT_RX_CCE_SUPER_RULE_INSTALL
  17909. * 2: HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE,
  17910. * response to HTT_RX_CCE_SUPER_RULE_RELEASE
  17911. * b'24:31 - result: Indicate result of setup operation
  17912. * For HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE:
  17913. * b'24 - is_rule_enough: indicate if there are
  17914. * enough free cce rule slots
  17915. * 0: not enough
  17916. * 1: enough
  17917. * b'25:31 - avail_rule_num: indicate the number of
  17918. * remaining free cce rule slots, only makes sense
  17919. * when is_rule_enough = 0
  17920. * For HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE:
  17921. * b'24 - cfg_result_0: indicate the config result
  17922. * of RX_CCE_SUPER_RULE_0
  17923. * 0: Install/Uninstall fails
  17924. * 1: Install/Uninstall succeeds
  17925. * b'25 - cfg_result_1: indicate the config result
  17926. * of RX_CCE_SUPER_RULE_1
  17927. * 0: Install/Uninstall fails
  17928. * 1: Install/Uninstall succeeds
  17929. * b'26:31 - reserved
  17930. * For HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE:
  17931. * b'24 - cfg_result_0: indicate the config result
  17932. * of RX_CCE_SUPER_RULE_0
  17933. * 0: Release fails
  17934. * 1: Release succeeds
  17935. * b'25 - cfg_result_1: indicate the config result
  17936. * of RX_CCE_SUPER_RULE_1
  17937. * 0: Release fails
  17938. * 1: Release succeeds
  17939. * b'26:31 - reserved
  17940. */
  17941. enum htt_rx_cce_super_rule_setup_done_response_type {
  17942. HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE = 0,
  17943. HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE,
  17944. HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE,
  17945. /*All reply type should be before this*/
  17946. HTT_RX_CCE_SUPER_RULE_SETUP_INVALID_RESPONSE,
  17947. };
  17948. PREPACK struct htt_rx_cce_super_rule_setup_done_t {
  17949. A_UINT8 msg_type;
  17950. A_UINT8 vdev_id;
  17951. A_UINT8 response_type;
  17952. union {
  17953. struct {
  17954. /* For HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE */
  17955. A_UINT8 is_rule_enough: 1,
  17956. avail_rule_num: 7;
  17957. };
  17958. struct {
  17959. /*
  17960. * For HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE and
  17961. * HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE
  17962. */
  17963. A_UINT8 cfg_result_0: 1,
  17964. cfg_result_1: 1,
  17965. rsvd: 6;
  17966. };
  17967. } result;
  17968. } POSTPACK;
  17969. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_SZ (sizeof(struct htt_rx_cce_super_rule_setup_done_t))
  17970. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_M 0x0000ff00
  17971. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_S 8
  17972. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_GET(_var) \
  17973. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_M) >> \
  17974. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_S)
  17975. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_SET(_var, _val) \
  17976. do { \
  17977. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID, _val); \
  17978. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_VDEV_ID_S)); \
  17979. } while (0)
  17980. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_M 0x00ff0000
  17981. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S 16
  17982. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_GET(_var) \
  17983. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_M) >> \
  17984. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S)
  17985. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_SET(_var, _val) \
  17986. do { \
  17987. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE, _val); \
  17988. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S)); \
  17989. } while (0)
  17990. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_M 0xff000000
  17991. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S 24
  17992. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_GET(_var) \
  17993. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_M) >> \
  17994. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S)
  17995. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_SET(_var, _val) \
  17996. do { \
  17997. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT, _val); \
  17998. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S)); \
  17999. } while (0)
  18000. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_M 0x01000000
  18001. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S 24
  18002. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_GET(_var) \
  18003. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_M) >> \
  18004. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S)
  18005. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_SET(_var, _val) \
  18006. do { \
  18007. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH, _val); \
  18008. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S)); \
  18009. } while (0)
  18010. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_M 0xFE000000
  18011. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S 25
  18012. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_GET(_var) \
  18013. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_M) >> \
  18014. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S)
  18015. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_SET(_var, _val) \
  18016. do { \
  18017. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM, _val); \
  18018. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S)); \
  18019. } while (0)
  18020. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_M 0x01000000
  18021. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S 24
  18022. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_GET(_var) \
  18023. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_M) >> \
  18024. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S)
  18025. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_SET(_var, _val) \
  18026. do { \
  18027. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0, _val); \
  18028. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S)); \
  18029. } while (0)
  18030. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_M 0x02000000
  18031. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S 25
  18032. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_GET(_var) \
  18033. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_M) >> \
  18034. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S)
  18035. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_SET(_var, _val) \
  18036. do { \
  18037. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1, _val); \
  18038. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S)); \
  18039. } while (0)
  18040. #endif